Context Memorization for Efficient Long Context Generation
Not on the map. Why?
Abstract (arXiv)
Modern large language model (LLM) applications increasingly rely on long conditioning prefixes to control model behavior at inference time. While prefix-augmented inference is effective, it incurs two structural limitations: i) the prefix's influence fades as generation proceeds, and ii) attention computation over the prefix scales linearly with its length. Existing approaches either keep the prefix in attention while compressing it, or internalize it into model parameters through gradient-based training. The former still attends to the prefix at inference, while the latter is training-intensive and ill-suited to prefix updates. To address these issues, we propose attention-state memory, a training-free approach that externalizes the prefix into a lightweight, lookup-based memory of precomputed attention states between prefix and query tokens. On ManyICLBench with LLaMA-3.1-8B, our method improves accuracy over in-context learning at 1K-8K memory budgets while reducing attention latency by 1.36x at 8K, and surpasses full-attention RAG performance on NBA benchmark using only 20% of its memory footprint.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 43 of its 46 references that are in the map. First posted on arXiv 18 May 2026.
Builds on
43 of 46 references.
References · 43
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2017Billion-scale similarity search with GPUscited by 2,497
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,141
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 880
31 more
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
- 2023Learning to Compress Prompts with Gist Tokenscited by 390
- 2023Adapting Language Models to Compress Contextscited by 356
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 348
- 2024Many-Shot In-Context Learningcited by 206
- 2021Whitening Sentence Representations for Better Semantics and Faster Retrievalcited by 202
- 2023In-context Autoencoder for Context Compression in a Large Language Modelcited by 199
- 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 189
- 2021Self-attention Does Not Need O(n2) Memorycited by 154
- 2022Learning by Distilling Contextcited by 138
- 2024RAGCache: Efficient Knowledge Caching for Retrieval-Augmented Generationcited by 98
- 2025KVzip: Query-Agnostic KV Cache Compression with Context Reconstructioncited by 95
- 2022Parallel Context Windows for Large Language Modelscited by 81
- 2021WhiteningBERT: An Easy Unsupervised Sentence Embedding Approachcited by 69
- 2025Text-to-LoRA: Instant Transformer Adaptioncited by 58
- 2024Squeezed Attention: Accelerating Long Context Length LLM Inferencecited by 57
- 2024Measuring and Controlling Instruction (In)Stability in Language Model Dialogscited by 53
- 2026Doc-to-LoRA: Learning to Instantly Internalize Contextscited by 43
- 2024Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Taskscited by 38
- 2025APE: Faster and Longer Context-Augmented Generation via Adaptive Parallel Encodingcited by 29
- 2024RuleArena: A Benchmark for Rule-Guided Reasoning with LLMs in Real-World Scenarioscited by 27
- 2024Efficient Knowledge Injection in LLMs via Self-Distillationcited by 24
- 2024On Many-Shot In-Context Learning for Long-Context Evaluationcited by 10
- 2024Generative Prompt Internalizationcited by 8
- 2024Efficient LLM Context Distillationcited by 4
- 2026SIEVE: Sample-Efficient Parametric Learning from Natural Languagecited by 2
- 2026CSAttention: Centroid-Scoring Attention for Accelerating LLM Inferencecited by 2
- 2026AQPIM: Breaking the PIM Capacity Wall for LLMs with In-Memory Activation Quantizationcited by 2
- 2026MAC-Attention: a Match-Amend-Complete Scheme for Fast and Accurate Attention Computationcited by 1
- 2026TSUBASA: Improving Long-Horizon Personalization via Evolving Memory and Self-Learning with Context Distillationcited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Training-free Context-adaptive Attention for Efficient Long Context Modeling
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models
- 2026Tail-Replay: Escaping the Curse of Linear Attention in Prefix Caching for Hybrid LLMs
- 2026Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps
- 2024A Little Goes a Long Way: Efficient Long Context Training and Inference with Partial Contexts
- 2026Titan-Llama: Retrofitting Pre-trained LLMs with External Neural Memory Modules
- 2026Summarize Before You Speak with ARACH: A Training-Free Inference-Time Plug-In for Enhancing LLMs via Global Attention Reallocation
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference