EMNLP Findings2025
DynamicKV: Task-Aware Adaptive KV Cache Compression for Long Context LLMs
Xiabin Zhou, Wenbin Wang, Minyan Zeng, Jiaxian Guo, Xuebo Liu, Li Shen, Min Zhang, Liang Ding
Abstract
Efficient KV cache management in LLMs is crucial for long-context tasks like RAG and summarization.Existing KV cache compression methods enforce a fixed pattern, neglecting task-specific characteristics and reducing the retention of essential information.However, we observe distinct activation patterns across layers in various tasks, highlighting the need for adaptive strategies tailored to each task's unique demands.Based on this insight, we propose DynamicKV, a method that dynamically optimizes token retention by adjusting the number of tokens retained at each layer to adapt to the specific task.DynamicKV establishes global and per-layer maximum KV cache budgets, temporarily retaining the maximum budget for the current layer, and periodically updating the KV cache sizes of all preceding layers during inference.Our method retains only 1.7% of the KV cache size while achieving ∼ 90% of the Full KV cache performance on LongBench.Notably, even under extreme compression (0.9%), DynamicKV surpasses state-of-the-art (SOTA) methods by 11% in the Needle-in-a-Haystack test using Mistral-7B-Instruct-v0.2.The code is available at repository https://github.com/DreamMr/ DynamicKV. KV Cache SizeLayer Step a. FullKV b.StreamingLLM/H2O/SnapKV c. PyramidKV d.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization cites Efficient Streaming Language Models with Attention Sinks
- KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization cites SnapKV: LLM Knows What You are Looking for Before Generation
- ReST-KV: Robust KV Cache Eviction with Layer-wise Output Reconstruction and Spatial-Temporal Smoothing cites Efficient Streaming Language Models with Attention Sinks
- SnapKV: LLM Knows What You are Looking for Before Generation cites Efficient Streaming Language Models with Attention Sinks
- Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites Efficient Streaming Language Models with Attention Sinks
- Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites SnapKV: LLM Knows What You are Looking for Before Generation
- Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites Efficient Memory Management for Large Language Model Serving with PagedAttention
- Accurate KV Cache Eviction via Anchor Direction Projection for Efficient LLM Inference cites Efficient Streaming Language Models with Attention Sinks
- Accurate KV Cache Eviction via Anchor Direction Projection for Efficient LLM Inference cites KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization
- Accurate KV Cache Eviction via Anchor Direction Projection for Efficient LLM Inference cites SnapKV: LLM Knows What You are Looking for Before Generation
- From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generation cites Efficient Streaming Language Models with Attention Sinks
- From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generation cites SnapKV: LLM Knows What You are Looking for Before Generation
- From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generation cites Efficient Memory Management for Large Language Model Serving with PagedAttention
- From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generation cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
Cited by top-tier papers9
- OmniSVG: A Unified Scalable Vector Graphics Generation ModelYiying Yang, Wei Cheng, Sijin Chen, Xianfang Zeng et al.NeurIPS 2025 · 90 citations
- Twilight: Adaptive Attention Sparsity with Hierarchical Top- PruningChaofan Lin, Jiaming Tang, Shuo Yang, Hanshuo Wang et al.NeurIPS 2025 · 53 citations
- ReST-KV: Robust KV Cache Eviction with Layer-wise Output Reconstruction and Spatial-Temporal SmoothingYongqi An, Chang Lu, Kuan Zhu, Tao Yu et al.ICLR 2026 · 11 citations
- Accurate KV Cache Eviction via Anchor Direction Projection for Efficient LLM InferenceZijie Geng, Jie Wang, Ziqi Liu, Feng Ju et al.NeurIPS 2025 · 6 citations
- From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented GenerationJiahao Wang, Weiyu Xie, Mingxing Zhang, Boxin Zhang et al.SIGMOD 2026 · 4 citations
Builds on15
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
- SnapKV: LLM Knows What You are Looking for Before GenerationYuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh et al.NeurIPS 2024 · 1,019 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache QuantizationColeman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney et al.NeurIPS 2024 · 738 citations
Related papers
- LAVa: Layer-wise KV Cache Eviction with Dynamic Budget AllocationYiqun Shen, Song Yuan, Zhengze Zhang, Xiaoliang Wang et al.EMNLP Findings 2025
- Not All Heads Matter: A Head-Level KV Cache Compression Method with Integrated Retrieval and ReasoningYu Fu, Zefan Cai, Abedelkadir Asi, Wayne Xiong et al.ICLR 2025
- IndexMem: Learned KV-Cache Eviction with Latent Memory for Long-Context LLM InferenceXintong Yang, Hao Gu, Binxing Xu, Lujun Li et al.ICML 2026 · 2 citations
- KVmix: Gradient-Based Layer Importance-Aware Mixed-Precision Quantization for KV CacheFei Li, Song Liu, Weiguo Wu, Shiqiang Nie et al.AAAI 2026 · 1 citation
- EntroKV: Entropy-Guided Dynamic Budget Allocation for KV-Cache CompressionWenhao Gao, Haoran Cao, Yueyan Li, YongGao Xiao et al.ICML 2026
