{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2604-20487","title":"Knowledge Capsules: Structured Nonparametric Memory Units for LLMs","arxiv_id":"2604.20487","date":"2026-04-22","proceeding":null,"authors":["Bin Ju","Shenfeng Weng","Danying Zhou","Rongkai Xu","Kunkai Su"],"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.","url_abs":"https://arxiv.org/abs/2604.20487","url_pdf":"https://arxiv.org/pdf/2604.20487","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2604.20487","atlas_url":"https://app.syntology.ai/?focus=2604.20487","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2604.20487"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/jubin75/KVI","reach":null}],"summary":{"ran":5,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":6,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":6,"samples":[{"code_sha256_prefix":"2f5a1613dee9268c","entry":"detect_lang","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"src/cleaning_and_dedupe.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/src/cleaning_and_dedupe.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2f5a1613dee9268c"}},{"code_sha256_prefix":"5aa9f2fbc850bd95","entry":"normalize_text","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"src/cleaning_and_dedupe.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/src/cleaning_and_dedupe.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5aa9f2fbc850bd95"}},{"code_sha256_prefix":"9a1bf2a40c65de6f","entry":"parse_summary","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9a1bf2a40c65de6f"}},{"code_sha256_prefix":"5f7a57f94c04f099","entry":"simhash64","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"src/cleaning_and_dedupe.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/src/cleaning_and_dedupe.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5f7a57f94c04f099"}},{"code_sha256_prefix":"97adfe8849bb02b8","entry":"write_jsonl","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"src/chunk_store.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/src/chunk_store.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"97adfe8849bb02b8"}},{"code_sha256_prefix":"3e104c93479435e0","entry":"run_one","repo":"jubin75/KVI","repo_kind":"found_in_text","path":"experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py","file_url":"https://github.com/jubin75/KVI/blob/HEAD/experiments/exp02_hallucination/code/auto_truthfulqa_kvi_iterate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3e104c93479435e0"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}