mlsanityData to 7 Oct 2026

Model Tells You Where to Merge: Adaptive KV Cache Merging for LLMs on Long-Context Tasks

arXiv 2407.08454 ↗First posted 11 Jul 2024cs.CLcited by 94

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

Abstract (arXiv)

How to efficiently serve Large Language Models (LLMs) has become a pressing issue because of their huge computational cost in their autoregressive generation process. To mitigate computational costs, LLMs often employ the KV Cache technique to improve the generation speed. While improving the computational efficiency, the storage requirements of the KV cache are substantial, particularly in long-context scenarios, leading to significant memory consumption. Existing KV cache eviction methods often degrade the performance of LLMs in long-context scenarios due to the information loss introduced by eviction. In this paper, we propose a novel KV cache merging approach, called KVMerger, to achieve adaptive KV cache compression for long-context tasks without significant performance degradation under constrained memory budgets. Our approach is inspired by the intriguing observation that key states exhibit high similarity at the token level within a single sequence. To facilitate merging, we develop an effective yet straightforward merging set identification algorithm to identify suitable KV states for merging. Our merging set identification algorithm stimulates the second observation that KV cache sparsity, from similarity perspective, is independent of the dataset and remains persistent at the model level. Subsequently, we propose a Gaussian kernel weighted merging algorithm to selectively merge all states within each merging set. We conduct extensive experiments to demonstrate the effectiveness of KVMerger for long-context tasks under constrained memory budgets, applying it to models including Llama2-7B-chat and Llama2-13B-chat. Using the LongBench and ZeroScroll benchmarks, we compare our method with other KV cache compression techniques, including H2O and CaM, showing that our method achieves superior performance across tasks with both 50% and 35% KV cache budgets.

Key facts. Cited by 94 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 28 of its 36 references that are in the map. First posted on arXiv 11 Jul 2024.

Builds on

28 of 36 references.

Closest ancestors · 9

Same direction, newest first

  1. 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
  2. 2024Effectively Compress KV Heads for LLM11 Jun
  3. 2024MiniCache: KV Cache Compression in Depth Dimension for Large Language Models23 May
  4. 2024CORM: Cache Optimization with Recent Message for Large Language Model Inference24 Apr
  5. 2024GEAR: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference of LLM8 Mar
  6. 2024No Token Left Behind: Reliable KV Cache Compression via Importance-Aware Mixed Precision Quantization28 Feb
  7. 2024On the Efficacy of Eviction Policy for Key-Value Constrained Generative Language Model Inference9 Feb
  8. 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs3 Oct
  9. 2023Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression at Test Time26 May

Other references · 19

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  5. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  6. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  7. 2022Token Merging: Your ViT But Fastercited by 995
  8. 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
  9. 2023FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPUcited by 567
  10. 2023LLM-QAT: Data-Free Quantization Aware Training for Large Language Modelscited by 320
  11. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 175
  12. 2023Token Fusion: Bridging the Gap between Token Pruning and Token Mergingcited by 123
7 more
  1. 2022Not All Tokens Are Equal: Human-centric Visual Analysis via Token Clustering Transformercited by 99
  2. 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 89
  3. 2024ZipCache: Accurate and Efficient KV Cache Quantization with Salient Token Identificationcited by 86
  4. 2024KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantizationcited by 74
  5. 2024Unveiling and Harnessing Hidden Attention Sinks: Enhancing Large Language Models without Training through Attention Calibrationcited by 70
  6. 2022Looking for a Needle in a Haystack: A Comprehensive Study of Hallucinations in Neural Machine Translationcited by 60
  7. 2024TinyChart: Efficient Chart Understanding with Visual Token Merging and Program-of-Thoughts Learningcited by 51

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 14; 2025: 42; 2026: 38.

94 papers.

Sort:

By area:

  1. 2024A Survey on Large Language Model Acceleration based on KV Cache Managementcited by 125
  2. 2024Keep the Cost Down: A Review on Methods to Optimize LLM' s KV-Cache Consumptioncited by 96
  3. 2025Cartridges: Lightweight and general-purpose long context representations via self-studycited by 74
  4. 2024TurboRAG: Accelerating Retrieval-Augmented Generation with Precomputed KV Caches for Chunked Textcited by 60
  5. 2024ZipVL: Efficient Large Vision-Language Models with Dynamic Token Sparsificationcited by 43
  6. 2024TokenSelect: Efficient Long-Context Inference and Length Extrapolation for LLMs via Dynamic Token-Level KV Cache Selectioncited by 38
  7. 2025KVTuner: Sensitivity-Aware Layer-Wise Mixed-Precision KV Cache Quantization for Efficient and Nearly Lossless LLM Inferencecited by 36
  8. 2024MatryoshkaKV: Adaptive KV Compression via Trainable Orthogonal Projectioncited by 29
  9. 2025Shifting AI Efficiency From Model-Centric to Data-Centric Compressioncited by 29
  10. 2025Cognitive Memory in Large Language Modelscited by 28
  11. 2025The Sparse Frontier: Sparse Attention Trade-offs in Transformer LLMscited by 28
  12. 2025ThinKV: Thought-Adaptive KV Cache Compression for Efficient Reasoning Modelscited by 21
38 more
  1. 2026MemRoPE: Training-Free Infinite Video Generation via Evolving Memory Tokenscited by 20
  2. 2024Lexico: Extreme KV Cache Compression via Sparse Coding over Universal Dictionariescited by 17
  3. 2024METIS: Fast Quality-Aware RAG Systems with Configuration Adaptationcited by 16
  4. 2024UNComp: Can Matrix Entropy Uncover Sparsity? -- A Compressor Design from an Uncertainty-Aware Perspectivecited by 14
  5. 2025Multipole Attention for Efficient Long Context Reasoningcited by 14
  6. 2024PrefixKV: Adaptive Prefix KV Cache is What Vision Instruction-Following Models Need for Efficient Generationcited by 13
  7. 2026LongLive-RAG: A General Retrieval-Augmented Framework for Long Video Generationcited by 12
  8. 2024LightTransfer: Your Long-Context LLM is Secretly a Hybrid Model with Effortless Adaptationcited by 11
  9. 2024House of Cards: Massive Weights in LLMscited by 9
  10. 2025SpindleKV: A Novel KV Cache Reduction Method Balancing Both Shallow and Deep Layerscited by 9
  11. 2025LaCache: Ladder-Shaped KV Caching for Efficient Long-Context Modeling of Large Language Modelscited by 9
  12. 2025Artificial Hippocampus Networks for Efficient Long-Context Modelingcited by 9
  13. 2026PackCache: A Training-Free Acceleration Method for Unified Autoregressive Video Generation via Compact KV-Cachecited by 9
  14. 2025KeepKV: Achieving Periodic Lossless KV Cache Compression for Efficient LLM Inferencecited by 8
  15. 2025CentroidKV: Efficient Long-Context LLM Inference via KV Cache Clusteringcited by 8
  16. 2025UniGist: Towards General and Hardware-aligned Sequence-level Long Context Compressioncited by 8
  17. 2026ResidualKV: Residual-Based KV Cache Compression for Efficient Long-Context Inferencecited by 8
  18. 2026STAC: Plug-and-Play Spatio-Temporal Aware Cache Compression for Streaming 3D Reconstructioncited by 8
  19. 2025SQuat: Subspace-orthogonal KV Cache Quantizationcited by 7
  20. 2025FreqKV: Key-Value Compression in Frequency Domain for Context Window Extensioncited by 7
  21. 2025Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMscited by 7
  22. 2025IAM: Efficient Inference through Attention Mapping between Different-scale LLMscited by 7
  23. 2025PagedEviction: Structured Block-wise KV Cache Pruning for Efficient Large Language Model Inferencecited by 7
  24. 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
  25. 2025SparK: Query-Aware Unstructured Sparsity with Recoverable KV Cache Channel Pruningcited by 6
  26. 2025FlowMM: Cross-Modal Information Flow Guided KV Cache Merging for Efficient Multimodal Context Inferencecited by 6
  27. 2026FASA: Frequency-aware Sparse Attentioncited by 6
  28. 2026Cartridges at Scale: Training Modular KV Caches over Large Document Collectionscited by 6
  29. 2025Curse of High Dimensionality Issue in Transformer for Long-context Modelingcited by 5
  30. 2025LOOM-Scope: a comprehensive and efficient LOng-cOntext Model evaluation frameworkcited by 5
  31. 2025SmallKV: Small Model Assisted Compensation of KV Cache Compression for Efficient LLM Inferencecited by 5
  32. 2025GraphKV: Breaking the Static Selection Paradigm with Graph-Based KV Cache Evictioncited by 5
  33. 2026From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generationcited by 5
  34. 2026SemantiCache: Efficient KV Cache Compression via Semantic Chunking and Clustered Mergingcited by 5
  35. 2026MomentKV: Closing the Directional Gap in KV Cache Eviction for Long-Context Inferencecited by 5
  36. 2025WeightedKV: Attention Scores Weighted Key-Value Cache Merging for Large Language Modelscited by 4
  37. 2025X-EcoMLA: Upcycling Pre-Trained Attention into MLA for Efficient and Extreme KV Compressioncited by 4
  38. 2025HGCA: Hybrid GPU-CPU Attention for Long Context LLM Inferencecited by 4

50 most cited of 94 All 94 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2026KV Cache Optimization Strategies for Scalable and Efficient LLM Inference
  2. 2025KV Cache Compression for Inference Efficiency in LLMs: A Review
  3. 2024EMS: Adaptive Evict-then-Merge Strategy for Head-wise KV Cache Compression Based on Global-Local Importance
  4. 2025EVICPRESS: Joint KV-Cache Compression and Eviction for Efficient LLM Serving
  5. 2025KVShare: An LLM Service System with Efficient and Effective Multi-Tenant KV Cache Reuse
  6. 2024SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal Budget
  7. 2025PackKV: Reducing KV Cache Memory Footprint through LLM-Aware Lossy Compression
  8. 2024More Tokens, Lower Precision: Towards the Optimal Token-Precision Trade-off in KV Cache Compression