mlsanityData to 7 Oct 2026

Structured Memory for Edge Language Models: Persistent Context and Corpus Retrieval via O(1) SSM State Injection

arXiv 2608.02560 ↗First posted 3 Aug 2026cs.LG cs.AI cs.IRcited by 0

On the map: Retrieval-augmented generation → Generation and context integration

also in 1 more
Abstract (arXiv)

Retrieval-augmented generation (RAG) imposes a prefill cost proportional to retrieved context length, and -- with Transformer backbones -- a KV-cache that grows with each generated token. State-Space Models (SSMs) avoid the second cost by construction; we eliminate the first, collapsing prefill from O(Lcontext) to O(1) per query. We introduce PRECOG (Pre-Computed Context Injection), a retrieval mechanism that exploits a property unique to SSMs: the fixed-size, position-agnostic recurrent hidden state is a complete summary of everything the model has read. PRECOG pre-encodes document corpora offline as SSM hidden states and injects the best-matching state directly at query time, bypassing in-context re-ingestion entirely. The same state-injection mechanism enables SMC (Structured Memory Consolidation): a hierarchical persistent memory with cognitive-domain clustering, an adjustable fidelity-vs-storage dial, and O(1) session initialization, which consolidates short-term episodic states into long-term semantic memory and fuses both with retrieved corpus states at query time. We demonstrate the system on TENNs-LLM, a 1.2B-parameter gated-SSM language model with a 192 KB hidden state. PRECOG matches in-context RAG answer quality, reducing prefill latency from ~27 s to <6 ms on edge hardware -- a ~4500× speedup that crosses the threshold from unusable to interactive. The mechanism is architecturally impossible for Transformer KV-caches, which are position-entangled and grow linearly with context length.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 30 of its 35 references that are in the map. First posted on arXiv 3 Aug 2026.

Builds on

30 of 35 references.

Closest ancestors · 4

Same direction, newest first

  1. 2024xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token22 May
  2. 2023REPLUG: Retrieval-Augmented Black-Box Language Models30 Jan
  3. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Models5 Aug
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks22 May

Other references · 26

  1. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  2. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  3. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  4. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  5. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
  6. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
  7. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  8. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  9. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  10. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  11. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
  12. 2021Improving language models by retrieving from trillions of tokenscited by 1,278
14 more
  1. 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,203
  2. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
  3. 2022Simplified State Space Layers for Sequence Modelingcited by 776
  4. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
  5. 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
  6. 2023Learning to Compress Prompts with Gist Tokenscited by 379
  7. 2023Adapting Language Models to Compress Contextscited by 350
  8. 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 279
  9. 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
  10. 2024MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Casescited by 216
  11. 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
  12. 2026Memory Caching: RNNs with Growing Memorycited by 12
  13. 2025PICASO: Permutation-Invariant Context Composition with State Space Modelscited by 4
  14. 2024State Soup: In-Context Skill Learning, Retrieval and Mixingcited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Understanding the Skill Gap in Recurrent Language Models: The Role of the Gather-and-Aggregate Mechanism
  2. 2026MARCH: Scaling Recurrent Memory with Content-Routed State Anchors
  3. 2024MemLong: Memory-Augmented Retrieval for Long Text Modeling
  4. 2024Expansion Span: Combining Fading Memory and Retrieval in Hybrid State Space Models
  5. 2025Memory in Large Language Models: Mechanisms, Evaluation and Evolution
  6. 2026Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memory
  7. 2026To Memorize or to Retrieve: Scaling the Interaction Between Pretraining and Retrieval
  8. 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models