Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMs
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
- 2025KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments21 Apr
- 2025CAKE: Cascading and Adaptive KV Cache Eviction with Layer Preferences16 Mar
- 2025LLMs Know What to Drop: Self-Attention Guided KV Cache Eviction for Efficient Long-Context Inference11 Mar
- 2025Dialogue Without Limits: Constant-Sized KV Caches for Extended Responses in LLMs2 Mar
- 2024A Survey on Large Language Model Acceleration based on KV Cache Management27 Dec
- 2024SCBench: A KV Cache-Centric Analysis of Long-Context Methods13 Dec
- 2024ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference28 Oct
- 2024In-context KV-Cache Eviction for LLMs via Attention-Gate15 Oct
- 2024Locret: Enhancing Eviction in Long-Context LLM Inference with Trained Retaining Heads on Consumer-Grade Devices2 Oct
- 2024Eigen Attention: Attention in Low-Rank Space for KV Cache Compression10 Aug
- 2024NACL: A General and Effective KV Cache Eviction Framework for LLMs at Inference Time7 Aug
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
3 more
Other references · 47
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2025Qwen3 Technical Reportcited by 8,195
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
35 more
- 2024Phi-4 Technical Reportcited by 675
- 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 656
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 604
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
- 2023MemoryBank: Enhancing Large Language Models with Long-Term Memorycited by 539
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 391
- 2025Towards Reasoning Era: A Survey of Long Chain-of-Thought for Reasoning Large Language Modelscited by 381
- 2023Learning to Compress Prompts with Gist Tokenscited by 379
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 375
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
- 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 367
- 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 360
- 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 329
- 2024Titans: Learning to Memorize at Test Timecited by 303
- 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 243
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
- 2021BookSum: A Collection of Datasets for Long-form Narrative Summarizationcited by 184
- 2024Flex Attention: A Programming Model for Generating Optimized Attention Kernelscited by 180
- 2024How to Train Long-Context Language Models (Effectively)cited by 141
- 2022On The Computational Complexity of Self-Attentioncited by 137
- 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 120
- 2024Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inferencecited by 115
- 2024RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrievalcited by 114
- 2021Long-Short Transformer: Efficient Transformers for Language and Visioncited by 102
- 2025Lifelong Learning of Large Language Model based Agents: A Roadmapcited by 78
- 2024WKVQuant: Quantizing Weight and Key/Value Cache for Large Language Models Gains Morecited by 69
- 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 50
- 2025LongProc: Benchmarking Long-Context Language Models on Long Procedural Generationcited by 28
- 2025SeerAttention-R: Sparse Attention Adaptation for Long Reasoningcited by 28
- 2024InfiniPot: Infinite Context Processing on Memory-Constrained LLMscited by 27
- 2025Lattice: Learning to Efficiently Compress the Memorycited by 18
- 2025Semantic Integrity Matters: Benchmarking and Preserving High-Density Reasoning in KV Cache Compressioncited by 16
- 2024LARM: Large Auto-Regressive Model for Long-Horizon Embodied Intelligencecited by 10
Built on by
Citing papers per year: 2025: 1; 2026: 17.
18 papers.
Sort:
By area:
- 2026TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agentscited by 26
- 2026Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Evictioncited by 14
- 2026Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Evictioncited by 10
- 2026Position: Modular Memory is the Key to Continual Learning Agentscited by 7
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inferencecited by 6
- 2026Learning What Not to Forget: Long-Horizon Agent Memory from a Few Kilobytes of Learningcited by 4
- 2025KV Admission: Learning What to Write for Efficient Long-Context LLM Inferencecited by 3
- 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inferencecited by 3
- 2026Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Evictioncited by 2
- 2026KARA: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compressioncited by 2
- 2026Transactional Attention: Semantic Sponsorship for KV-Cache Retentioncited by 1
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoningcited by 1
6 more
- 2026Kalman Delta Networks: Uncertainty-aware Associative Memorycited by 1
- 2026EchoPress: Query-Agnostic KV Cache Pruning via Virtual Context Reconstructioncited by 1
- 2026SR-TTT Does Not Learn Retrieval: A Correction and Mechanistic Post-Mortem of Surprisal-Aware Residual Test-Time Trainingcited by 0
- 2026Sigmoid Attention as a Better Substrate for Learned KV Cache Evictioncited by 0
- 2026BeaconKV: Key-Value Cache Compression Guided by Beacon Queries for Efficient Large Reasoning Model Inferencecited by 0
- 2026CORE: COverage CAlibration and Evicted-Mass REdistribution for KV Cachecited by 0
- 2026EchoPress: Query-Agnostic KV Cache Pruning via Virtual Context Reconstruction30 Sep 2026
- 2026CORE: COverage CAlibration and Evicted-Mass REdistribution for KV Cache28 Sep 2026
- 2026Kalman Delta Networks: Uncertainty-aware Associative Memory7 Sep 2026
- 2026BeaconKV: Key-Value Cache Compression Guided by Beacon Queries for Efficient Large Reasoning Model Inference4 Sep 2026
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoning3 Sep 2026
- 2026Sigmoid Attention as a Better Substrate for Learned KV Cache Eviction24 Aug 2026
- 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inference12 Jul 2026
- 2026Learning What Not to Forget: Long-Horizon Agent Memory from a Few Kilobytes of Learning18 Jun 2026
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inference6 Jun 2026
- 2026Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Eviction18 May 2026
- 2026Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction10 May 2026
- 2026KARA: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compression1 May 2026
6 more
- 2026Transactional Attention: Semantic Sponsorship for KV-Cache Retention13 Apr 2026
- 2026Position: Modular Memory is the Key to Continual Learning Agents2 Mar 2026
- 2026SR-TTT Does Not Learn Retrieval: A Correction and Mechanistic Post-Mortem of Surprisal-Aware Residual Test-Time Training26 Feb 2026
- 2026Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Eviction25 Jan 2026
- 2026TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agents6 Jan 2026
- 2025KV Admission: Learning What to Write for Efficient Long-Context LLM Inference19 Dec 2025
- 2026Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Evictioncited by 14
- 2026Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Evictioncited by 10
- 2026Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Evictioncited by 2
- 2026Transactional Attention: Semantic Sponsorship for KV-Cache Retentioncited by 1
- 2026EchoPress: Query-Agnostic KV Cache Pruning via Virtual Context Reconstructioncited by 1
- 2026SR-TTT Does Not Learn Retrieval: A Correction and Mechanistic Post-Mortem of Surprisal-Aware Residual Test-Time Trainingcited by 0
- 2026Sigmoid Attention as a Better Substrate for Learned KV Cache Evictioncited by 0
- 2026CORE: COverage CAlibration and Evicted-Mass REdistribution for KV Cachecited by 0
- 2026EchoPress: Query-Agnostic KV Cache Pruning via Virtual Context Reconstruction30 Sep 2026
- 2026CORE: COverage CAlibration and Evicted-Mass REdistribution for KV Cache28 Sep 2026
- 2026Sigmoid Attention as a Better Substrate for Learned KV Cache Eviction24 Aug 2026
- 2026Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Eviction18 May 2026
- 2026Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction10 May 2026
- 2026Transactional Attention: Semantic Sponsorship for KV-Cache Retention13 Apr 2026
- 2026SR-TTT Does Not Learn Retrieval: A Correction and Mechanistic Post-Mortem of Surprisal-Aware Residual Test-Time Training26 Feb 2026
- 2026Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Eviction25 Jan 2026
- 2026TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agentscited by 26
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inferencecited by 6
- 2026Learning What Not to Forget: Long-Horizon Agent Memory from a Few Kilobytes of Learningcited by 4
- 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inferencecited by 3
- 2026MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inference12 Jul 2026
- 2026Learning What Not to Forget: Long-Horizon Agent Memory from a Few Kilobytes of Learning18 Jun 2026
- 2026IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inference6 Jun 2026
- 2026TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agents6 Jan 2026
- 2026Position: Modular Memory is the Key to Continual Learning Agentscited by 7
- 2026KARA: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compressioncited by 2
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoningcited by 1
- 2026BeaconKV: Key-Value Cache Compression Guided by Beacon Queries for Efficient Large Reasoning Model Inferencecited by 0
- 2026BeaconKV: Key-Value Cache Compression Guided by Beacon Queries for Efficient Large Reasoning Model Inference4 Sep 2026
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoning3 Sep 2026
- 2026KARA: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compression1 May 2026
- 2026Position: Modular Memory is the Key to Continual Learning Agents2 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026Reformulating KV Cache Eviction Problem for Long-Context LLM Inference
- 2024SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal Budget
- 2026KV Cache Optimization Strategies for Scalable and Efficient LLM Inference
- 2026Comparative Characterization of KV Cache Management Strategies for LLM Inference
- 2026TTKV: Temporal-Tiered KV Cache for Long-Context LLM Inference
- 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMs
- 2026AnchorKV: Anchor-Residual KV Cache Compression
- 2024Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference