Knowledge Capsules: Structured Nonparametric Memory Units for LLMs

Bin Ju, Shenfeng Weng, Danying Zhou, Rongkai Xu, Kunkai Su
4/22/2026
cs.CLcs.AI

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ju2026knowledge,
  title  = {Knowledge Capsules: Structured Nonparametric Memory Units for LLMs},
  author = {Bin Ju and Shenfeng Weng and Danying Zhou and Rongkai Xu and Kunkai Su},
  year   = {2026},
  eprint = {2604.20487},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.20487v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.20487.svg)](https://codeofpaper.com/paper/2604.20487)

Discussion