Skip to content

Bug: Memory Tree L1 summarizer can expand short sources and hallucinate people (fixed 5k output budget) #5570

Description

@acromega

Summary

OpenHuman v0.63.12 can produce Memory Tree L1 summaries that are longer than the source and contain invented people, teams, and facts.

I reproduced this with a fully synthetic local-folder corpus, local-only inference, and no external context. The clearest case was a 608-token source producing a 1,656-token L1 summary that invented four people and four teams that do not exist anywhere in the input or workspace.

This is not the same issue as #5500 (Notion parsing/misread). Here the source reaches the Memory Tree correctly and the hallucination is introduced during seal summarization itself.

Environment

  • OpenHuman: v0.63.12
  • macOS Apple Silicon / arm64
  • Privacy mode: local_only
  • Memory Tree backend: local
  • Ollama: 0.32.14, loopback only (127.0.0.1:11434)
  • Embeddings: bge-m3 / 1024 dimensions
  • Extraction + summarization: gemma3:4b-it-qat
  • Temperature: 0.0
  • Source: local Markdown folder, entirely synthetic data
  • No cloud inference calls observed during extraction/seal

Reproduction

  1. Configure Memory Tree summarization to use local Ollama with gemma3:4b-it-qat and embeddings with bge-m3.
  2. Add a local-folder source containing small Markdown documents with explicit factual statements.
  3. Ingest the documents and let the Memory Tree run extract_chunkappend_bufferseal.
  4. Inspect the generated L1 summaries under the local wiki/vault.

The test corpus contained 5 synthetic documents for a fictitious project. Across 12 deliberately checkable facts, the generated summaries:

  • preserved 8/12 facts;
  • omitted 2/12;
  • distorted several others;
  • invented multiple unsupported entities and details.

Minimal failing example

One source document was only 608 tokens. Its generated L1 summary was 1,656 tokens.

The summary invented these people, none of whom occur in the source chunks, database, or workspace outside the generated summary:

  • Dr. Elias Thorne
  • Dr. Anya Sharma
  • Ben Carter
  • Professor David Lee

It also invented four project teams (Knowledge Acquisition, Reasoning Engine, Natural Language Interface, Evaluation) and reframed the fictitious project as an NLP / knowledge-representation project based only on the project name/context.

A direct SQL/workspace search confirmed zero occurrences of those names before the summary was generated.

Root cause analysis

The v0.63.12 summarizer prompt is effectively:

Compress the supplied content into a concise summary, keep it under {budget} tokens, focus on key events, decisions, facts, patterns, and actionable insights, and preserve important names/dates/numbers/details.

The relevant behavior in this build is:

  • OUTPUT_TOKEN_BUDGET = 5000 (fixed constant)
  • same 5,000-token ceiling regardless of source length or tree level
  • no proportional compression target
  • provider call uses max_tokens: None
  • only a post-generation clamp enforces the 5,000-token ceiling
  • no explicit rule says "use only facts present in the supplied chunks"
  • prompt explicitly invites patterns and actionable insights
  • summarizer context contains only the chunks of the current tree buffer; no persona, other memories, global tree, or conversation history is supplied
  • temperature is 0.0

Therefore a 608-token source receives the same permissive "under 5,000 tokens" budget as a much larger input. A small model can expand into unsupported interpretation instead of compressing.

I also confirmed that the L0 input budget is 50,000 tokens, so ordinary small documents typically seal through stale/explicit flush rather than reaching the size threshold.

Current main

Current TinyCortex/OpenHuman main appears to have already revised the wording toward a "fold multiple notes into one compact summary" prompt. That is directionally better, but the fixed output budget remains worth testing: a short source should not be encouraged or allowed to expand several-fold, even with improved wording.

Expected behavior

Memory Tree summaries should be safe to use as durable factual memory:

  • never introduce people, organizations, dates, decisions, causes, or facts not supported by the input chunks;
  • preserve important names, dates, numbers, decisions, and constraints;
  • for already-concise sources, remain shorter than the input or minimally rewrite it;
  • avoid converting "insights" into unsupported factual claims.

Suggested fix

  1. Add an explicit grounding rule, e.g.:

    Use only information explicitly present in the supplied notes. Do not infer or add people, organizations, events, causes, motivations, or facts that are not stated in the source.

  2. Make the summary budget proportional to the source instead of always 5,000 tokens, for example:

    max_output = min(source_tokens / 2, 5000)

    Exact ratio can be tuned, but a concise 608-token document should not get a 5,000-token allowance.

  3. Remove or constrain actionable insights / patterns unless they are explicitly labelled as inference rather than stored as factual summary content.

  4. Add a regression fixture for a short factual source.

Proposed regression acceptance criteria

  • A ~600-token factual source produces a summary shorter than the source.
  • Zero unsupported named entities are introduced.
  • Zero unsupported organizations/teams are introduced.
  • Explicit names, dates, numbers, decisions, and constraints are preserved.
  • The test passes at temperature 0 with a supported small local model such as gemma3:4b-it-qat.
  • The same grounding constraints apply to L1 and higher-level folds.

Why this matters

The Memory Tree is durable memory. A normal chat hallucination disappears with the conversation; a hallucinated L1 summary can be persisted, embedded, retrieved later, and recursively folded into higher levels. That makes unsupported additions much more damaging than ordinary conversational embellishment.

I can provide the synthetic Mnemosyne test corpus and exact generated summaries if useful for a regression fixture.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions