[Paper Review] Facts as First Class Objects: Knowledge Objects for Persistent LLM Memory
The paper compares in-context memory to a Knowledge Object (KO) architecture for persistent LLM memory, showing KOs achieve exact retrieval at far lower cost and resist lifecycle degradation, with a density-adaptive retrieval mechanism to handle adversarial facts.
Large language models increasingly serve as persistent knowledge workers, with in-context memory - facts stored in the prompt - as the default strategy. We benchmark in-context memory against Knowledge Objects (KOs), discrete hash-addressed tuples with O(1) retrieval. Within the context window, Claude Sonnet 4.5 achieves 100% exact-match accuracy from 10 to 7,000 facts (97.5% of its 200K window). However, production deployment reveals three failure modes: capacity limits (prompts overflow at 8,000 facts), compaction loss (summarization destroys 60% of facts), and goal drift (cascading compaction erodes 54% of project constraints while the model continues with full confidence). KOs achieve 100% accuracy across all conditions at 252x lower cost. On multi-hop reasoning, KOs reach 78.9% versus 31.6% for in-context. Cross-model replication across four frontier models confirms compaction loss is architectural, not model-specific. We additionally show that embedding retrieval fails on adversarial facts (20% precision at 1) and that neural memory (Titans) stores facts but fails to retrieve them on demand. We introduce density-adaptive retrieval as a switching mechanism and release the benchmark suite.
Motivation & Objective
- Assess how in-context memory scales with corpus size and semantic density in frontier LLMs.
- Identify failure modes of in-context memory in production (capacity limits, compaction loss, goal drift).
- Propose Knowledge Objects as an external memory layer to prevent memory degradation.
- Develop and evaluate a density-adaptive retrieval mechanism to handle adversarial facts in retrieval.
- Quantify production costs and performance implications of memory architectures for enterprise-scale data.
Proposed method
- Benchmark in-context memory using a pharmacological fact corpus across N from 10 to 10,000.
- Compare memory architectures: in-context memory (Claude Sonnet 4.5 and GPT-4o) vs. Knowledge Objects (KO) with O(1) retrieval.
- Introduce Knowledge Objects as discrete (subject,predicate,object,provenance) tuples stored externally with hash-based lookup.
- Quantify compaction loss and goal drift under memory pressure and cascading compression.
- Develop density-adaptive retrieval that switches to exact key matching when retrieved-set density exceeds a threshold (τ).
- Evaluate adversarial facts where embedding retrieval fails and test hybrid retrieval performance.
Experimental results
Research questions
- RQ1How does exact-match retrieval performance of in-context memory change as the number of stored facts increases within and beyond the model's context window?
- RQ2What are the production failure modes (capacity, compaction, goal drift) of in-context memory when memory lifecycles are considered?
- RQ3Do Knowledge Objects provide accurate, scalable, and cost-efficient memory for persistent LLM use across large corpora?
- RQ4Can a density-adaptive retrieval mechanism mitigate adversarial facts in retrieval and maintain high precision?
- RQ5What are the relative costs of in-context memory versus KO-based memory as corpus size grows?
Key findings
- Claude Sonnet 4.5 achieves 100% exact-match accuracy from N=10 to N=7,000 within its 200K token window (97.5% of the window).
- Capacity limits cause hard prompt overflow at around 8,000 facts for Claude; even larger window models still have practical limits.
- Compaction reduces recall by 60% (6 of 10, original facts unrecoverable) after 36.7x compression, and goal drift reduces preserved constraints to 46% after three cascading rounds.
- KOs achieve 100% accuracy across all tested conditions at 252x lower per-query cost than within-context memory, and remain feasible at corpus sizes where in-context memory is not.
- Embedding retrieval fails on adversarial facts with 20% precision@1; density-adaptive retrieval switching to exact key matching when density exceeds a threshold (τ=0.85) yields 100% P@1 on adversarial corpora while preserving embedding benefits on normal data.
- Production economics show KO memory sustains 97–99% token reduction and a fixed annual cost (~$56/year) regardless of corpus size, versus rising costs for in-context memory.
- The work confirms the failure mode of context rot via compaction and demonstrates architectural separation as a practical solution.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.