Lune

ICML2024Top-tier venue

CaM: Cache Merging for Memory-efficient LLMs Inference

Yuxin Zhang, Yuxuan Du, Gen Luo, Yunshan Zhong, Zhenyu Zhang, Shiwei Liu, Rongrong Ji

Abstract

Despite the exceptional performance of Large Language Models (LLMs), the substantial volume of key-value (KV) pairs cached during inference presents a barrier to their efficient deployment. To ameliorate this, recent works have aimed to selectively eliminate these caches, informed by the attention scores of associated tokens. However, such cache eviction invariably leads to output perturbation, regardless of the token choice. This perturbation escalates with the compression ratio, which can precipitate a marked deterioration in LLM inference performance. This paper introduces Cache Merging (CaM) as a solution to mitigate this challenge. CaM adaptively merges to-be-evicted caches into the remaining ones, employing a novel sampling strategy governed by the prominence of attention scores within discarded locations. In this manner, CaM enables memory-efficient LLMs to preserve critical token information, even obviating the need to maintain their corresponding caches. Extensive experiments utilizing LLaMA, OPT, and GPT-NeoX across various benchmarks corroborate CaM's proficiency in bolstering the performance of memory-efficient LLMs. Code is released at https://github.com/zyxxmu/cam .

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.

25 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Efficient Streaming Language Models with Attention Sinks cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • Efficient Streaming Language Models with Attention Sinks cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Efficient Streaming Language Models with Attention Sinks
  • Efficient Streaming Language Models with Attention Sinks cites Language Models are Few-Shot Learners
  • Efficient Streaming Language Models with Attention Sinks cites Compressive Transformers for Long-Range Sequence Modelling
  • R-KV: Redundancy-aware KV Cache Compression for Reasoning Models cites Efficient Streaming Language Models with Attention Sinks
  • R-KV: Redundancy-aware KV Cache Compression for Reasoning Models cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Flow Caching for Autoregressive Video Generation cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Memory-Efficient Visual Autoregressive Modeling with Scale-Aware KV Cache Compression cites Efficient Streaming Language Models with Attention Sinks
  • Memory-Efficient Visual Autoregressive Modeling with Scale-Aware KV Cache Compression cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Language Models are Few-Shot Learners
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Compressive Transformers for Long-Range Sequence Modelling
  • Neural Attention Search cites Efficient Streaming Language Models with Attention Sinks
  • Neural Attention Search cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Neural Attention Search cites Language Models are Few-Shot Learners
  • Neural Attention Search cites Compressive Transformers for Long-Range Sequence Modelling
  • Cartridges: Lightweight and general-purpose long context representations via self-study cites Efficient Streaming Language Models with Attention Sinks
  • Cartridges: Lightweight and general-purpose long context representations via self-study cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers25

  1. Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 citations
  2. Cartridges: Lightweight and general-purpose long context representations via self-studySabri Eyuboglu, Ryan Ehrlich, Simran Arora, Neel Guha et al.ICLR 2026 · 74 citations
  3. R-KV: Redundancy-aware KV Cache Compression for Reasoning ModelsZefan Cai, Wen Xiao, Hanshi Sun, Cheng Luo et al.NeurIPS 2025 · 50 citations
  4. Memory-Efficient Visual Autoregressive Modeling with Scale-Aware KV Cache CompressionKunjun Li, Zigeng Chen, Cheng-Yen Yang, Jenq-Neng HwangNeurIPS 2025 · 23 citations
  5. Flow Caching for Autoregressive Video GenerationYuexiao Ma, Xuzhe Zheng, Jing Xu, Xiwei Xu et al.ICLR 2026 · 20 citations

Builds on14

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao et al.AAAI 2020 · 2,916 citations
  3. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  4. H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen et al.NeurIPS 2023 · 1,003 citations
  5. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations

Related papers

  1. KeepKV: Achieving Periodic Lossless KV Cache Compression for Efficient LLM InferenceYuxuan Tian, Zihan Wang, Yebo Peng, Aomufei Yuan et al.AAAI 2026
  2. NACL: A General and Effective KV Cache Eviction Framework for LLM at Inference TimeYilong Chen, Guoxia Wang, Junyuan Shang, Shiyao Cui et al.ACL 2024 · 8 citations
  3. D2O: Dynamic Discriminative Operations for Efficient Long-Context Inference of Large Language ModelsZhongwei Wan, Xinjian Wu, Yu Zhang, Yi Xin et al.ICLR 2025
  4. RazorAttention: Efficient KV Cache Compression Through Retrieval HeadsHanlin Tang, Yang Lin, Jing Lin, Qingsen Han et al.ICLR 2025
  5. AttentionPredictor: Temporal Patterns Matter for KV Cache CompressionQingyue Yang, Jie Wang, Xing Li, Zhihai Wang et al.NeurIPS 2025 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines