SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.20487 · 2026

Knowledge Capsules: Structured Nonparametric Memory Units for LLMs

Bin Ju, Shenfeng Weng, Danying Zhou, Rongkai Xu, Kunkai Su

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 6 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
jubin75/KVI canonical 5 of 6
FunctionStatusWhere it lives
detect_lang Ran jubin75/KVI/src/cleaning_and_dedupe.py
pointer only (licence: NONE) · get_code("2f5a1613dee9268c")
normalize_text Ran jubin75/KVI/src/cleaning_and_dedupe.py
pointer only (licence: NONE) · get_code("5aa9f2fbc850bd95")
parse_summary Ran jubin75/KVI/experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py
pointer only (licence: NONE) · get_code("9a1bf2a40c65de6f")
simhash64 Ran jubin75/KVI/src/cleaning_and_dedupe.py
pointer only (licence: NONE) · get_code("5f7a57f94c04f099")
write_jsonl Ran jubin75/KVI/src/chunk_store.py
pointer only (licence: NONE) · get_code("97adfe8849bb02b8")
run_one Not yet run jubin75/KVI/experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py
pointer only (licence: NONE) · get_code("3e104c93479435e0")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) encode knowledge in parametric weights, making it costly to update or extend without retraining. Retrieval-augmented generation (RAG) mitigates this limitation by appending retrieved text to the input, but operates purely through context expansion, where external knowledge competes as tokens within the attention mechanism. As a result, its influence is indirect and often unstable, particularly in long-context and multi-hop reasoning scenarios. We propose Knowledge Capsules, structured nonparametric memory units that represent normalized relational knowledge and can be constructed directly from document corpora using a frozen base model. Instead of injecting knowledge as text, we introduce an External Key-Value Injection (KVI) framework that compiles capsules into attention-compatible key-value representations, enabling external knowledge to directly participate in the model's attention computation. By shifting knowledge integration from context-level augmentation to memory-level interaction, the proposed framework consistently outperforms RAG and GraphRAG across multiple QA benchmarks, with improved stability and accuracy in long-context and multi-hop reasoning, while requiring no parameter updates. Code and datasets are available at https://github.com/jubin75/KVI.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2604.20487")
get_code_for_paper("2604.20487")
have("2604.20487")

Connect an agent — have() is free.