mlsanityData to 7 Oct 2026

Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMs

arXiv 2512.03324 ↗First posted 3 Dec 2025cs.LG cs.AIcited by 18

On the map: Efficient LLM inference and serving → KV cache optimization

Abstract (arXiv)

Memory and computation remain core bottlenecks in long-horizon LLM inference due to the quadratic cost of self-attention and the ever-growing key-value (KV) cache. Existing strategies for memory-bounded inference, such as quantization, offloading, or heuristic KV eviction, either incur high orchestration costs or rely on unreliable attention-based proxies of importance. We propose TRIM-KV, a novel approach that learns each token's intrinsic importance at creation time via a lightweight retention gate. Each gate predicts a scalar retention score that decays over time, reflecting the long-term utility of the token for a specific layer and head. Tokens with low scores are evicted when the memory budget is exceeded, ensuring that the cache always contains the most critical tokens. TRIM-KV is trained efficiently through distillation from a frozen LLM combined with a capacity loss, requiring only gate fine-tuning and adding negligible inference overhead. Across mathematical reasoning (GSM8K, MATH-500, AIME24), procedural generation (LongProc), conversational long-memory benchmarks (LongMemEval), and long-context understanding (LongBenchV2 and SCBench), TRIM-KV consistently outperforms strong eviction and learnable retrieval baselines, especially in low-memory regimes. Remarkably, it even surpasses full-cache models in some settings, showing that selective retention can serve as a form of regularization, suppressing noise from uninformative tokens. Qualitative analyses further reveal that learned retention scores align with human intuition, naturally recovering heuristics such as sink tokens, sliding windows, and gist compression without explicit design. Beyond efficiency, retention scores provide insights into layer- and head-specific roles, suggesting a new path toward LLM interpretability.

Key facts. Cited by 18 papers in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 62 of its 76 references that are in the map. First posted on arXiv 3 Dec 2025.

Builds on

62 of 76 references.

Closest ancestors · 15

Same direction, newest first

  1. 2025KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments21 Apr
  2. 2025CAKE: Cascading and Adaptive KV Cache Eviction with Layer Preferences16 Mar
  3. 2025LLMs Know What to Drop: Self-Attention Guided KV Cache Eviction for Efficient Long-Context Inference11 Mar
  4. 2025Dialogue Without Limits: Constant-Sized KV Caches for Extended Responses in LLMs2 Mar
  5. 2024A Survey on Large Language Model Acceleration based on KV Cache Management27 Dec
  6. 2024SCBench: A KV Cache-Centric Analysis of Long-Context Methods13 Dec
  7. 2024ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference28 Oct
  8. 2024In-context KV-Cache Eviction for LLMs via Attention-Gate15 Oct
  9. 2024Locret: Enhancing Eviction in Long-Context LLM Inference with Trained Retaining Heads on Consumer-Grade Devices2 Oct
  10. 2024Eigen Attention: Attention in Low-Rank Space for KV Cache Compression10 Aug
  11. 2024NACL: A General and Effective KV Cache Eviction Framework for LLMs at Inference Time7 Aug
  12. 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
3 more
  1. 2024PyramidKV: Dynamic KV Cache Compression based on Pyramidal Information Funneling4 Jun
  2. 2024SnapKV: LLM Knows What You are Looking for Before Generation22 Apr
  3. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun

Other references · 47

  1. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  2. 2025Qwen3 Technical Reportcited by 8,195
  3. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  4. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  5. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  6. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  7. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  8. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  9. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
  10. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  11. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  12. 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
35 more
  1. 2024Phi-4 Technical Reportcited by 675
  2. 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 656
  3. 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 604
  4. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
  5. 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
  6. 2023MemoryBank: Enhancing Large Language Models with Long-Term Memorycited by 539
  7. 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
  8. 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 391
  9. 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Modelscited by 381
  10. 2023Learning to Compress Prompts with Gist Tokenscited by 379
  11. 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 375
  12. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
  13. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 367
  14. 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 360
  15. 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 329
  16. 2024Titans: Learning to Memorize at Test Timecited by 303
  17. 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 243
  18. 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
  19. 2021BookSum: A Collection of Datasets for Long-form Narrative Summarizationcited by 184
  20. 2024Flex Attention: A Programming Model for Generating Optimized Attention Kernelscited by 180
  21. 2024How to Train Long-Context Language Models (Effectively)cited by 141
  22. 2022On The Computational Complexity of Self-Attentioncited by 137
  23. 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 120
  24. 2024Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inferencecited by 115
  25. 2024RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrievalcited by 114
  26. 2021Long-Short Transformer: Efficient Transformers for Language and Visioncited by 102
  27. 2025Lifelong Learning of Large Language Model based Agents: A Roadmapcited by 78
  28. 2024WKVQuant: Quantizing Weight and Key/Value Cache for Large Language Models Gains Morecited by 69
  29. 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 50
  30. 2025LongProc: Benchmarking Long-Context Language Models on Long Procedural Generationcited by 28
  31. 2025SeerAttention-R: Sparse Attention Adaptation for Long Reasoningcited by 28
  32. 2024InfiniPot: Infinite Context Processing on Memory-Constrained LLMscited by 27
  33. 2025Lattice: Learning to Efficiently Compress the Memorycited by 18
  34. 2025Semantic Integrity Matters: Benchmarking and Preserving High-Density Reasoning in KV Cache Compressioncited by 16
  35. 2024LARM: Large Auto-Regressive Model for Long-Horizon Embodied Intelligencecited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 17.

18 papers.

Sort:

By area:

  1. 2026TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agentscited by 26
  2. 2026Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Evictioncited by 14
  3. 2026Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Evictioncited by 10
  4. 2026Position: Modular Memory is the Key to Continual Learning Agentscited by 7
  5. 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inferencecited by 6
  6. 2026Learning What Not to Forget: Long-Horizon Agent Memory from a Few Kilobytes of Learningcited by 4
  7. 2025KV Admission: Learning What to Write for Efficient Long-Context LLM Inferencecited by 3
  8. 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inferencecited by 3
  9. 2026Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Evictioncited by 2
  10. 2026KARA: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compressioncited by 2
  11. 2026Transactional Attention: Semantic Sponsorship for KV-Cache Retentioncited by 1
  12. 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoningcited by 1
6 more
  1. 2026Kalman Delta Networks: Uncertainty-aware Associative Memorycited by 1
  2. 2026EchoPress: Query-Agnostic KV Cache Pruning via Virtual Context Reconstructioncited by 1
  3. 2026SR-TTT Does Not Learn Retrieval: A Correction and Mechanistic Post-Mortem of Surprisal-Aware Residual Test-Time Trainingcited by 0
  4. 2026Sigmoid Attention as a Better Substrate for Learned KV Cache Evictioncited by 0
  5. 2026BeaconKV: Key-Value Cache Compression Guided by Beacon Queries for Efficient Large Reasoning Model Inferencecited by 0
  6. 2026CORE: COverage CAlibration and Evicted-Mass REdistribution for KV Cachecited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026Reformulating KV Cache Eviction Problem for Long-Context LLM Inference
  2. 2024SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal Budget
  3. 2026KV Cache Optimization Strategies for Scalable and Efficient LLM Inference
  4. 2026Comparative Characterization of KV Cache Management Strategies for LLM Inference
  5. 2026TTKV: Temporal-Tiered KV Cache for Long-Context LLM Inference
  6. 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMs
  7. 2026AnchorKV: Anchor-Residual KV Cache Compression
  8. 2024Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference