Lune

ICML2026Top-tier venue

OBCache: Optimal Brain KV Cache Pruning for Efficient Long-Context LLM Inference

Yuzhe Gu, Xiyu Liang, Jiaojiao Zhao, Enmao Diao

Abstract

Large language models (LLMs) with extended context windows enable powerful applications but impose significant memory overhead, as caching all key-value (KV) states scales linearly with sequence length and batch size. Existing cache eviction methods address this by exploiting attention sparsity, yet they typically rank tokens heuristically using accumulated attention weights without considering their true impact on attention outputs. We propose Optimal Brain Cache (OBCache), a principled framework that formulates cache eviction as a layer-wise structured pruning problem. Building upon the Optimal Brain Damage (OBD) theory, OBCache quantifies token saliency by measuring the perturbation in attention outputs induced by pruning tokens, with closed-form scores derived for isolated keys, isolated values, and joint key-value pairs. Our scores account not only for attention weights but also for information from value states and attention outputs, thereby enhancing existing eviction strategies with output-aware signals. Experiments on LLaMA and Qwen models demonstrate that replacing the heuristic scores in existing works, which estimate token saliency across different query positions, with OBCache's output-aware scores consistently improves longcontext accuracy. Code is available at https:// github.com/DreamSoul-AI/OBCache .

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.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inference cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inference cites LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding
  • Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inference cites KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction
  • KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction cites Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inference
  • KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction cites LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on6

  1. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
  2. Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM InferenceYuan Feng, Junlin Lv, Yukun Cao, Xike Xie et al.NeurIPS 2025 · 256 citations
  3. KVzip: Query-Agnostic KV Cache Compression with Context ReconstructionJang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee et al.NeurIPS 2025 · 103 citations
  4. Evaluating Open-Domain Question Answering in the Era of Large Language ModelsEhsan Kamalloo, Nouha Dziri, Charles L. A. Clarke, Davood RafieiACL 2023 · 96 citations
  5. LongBench: A Bilingual, Multitask Benchmark for Long Context UnderstandingYushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu et al.ACL 2024 · 94 citations

Related papers

  1. Lookahead Q-Cache: Achieving More Consistent KV Cache Eviction via Pseudo QueryYixuan Wang, Shiyu Ji, Yijun Liu, Yuzhuang Xu et al.EMNLP 2025
  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. LazyEviction: Lagged KV Eviction with Attention Pattern Observation for Efficient Long ReasoningHaoyue Zhang, Hualei Zhang, Xiaosong Ma, Jie Zhang et al.ACL 2026 · 7 citations
  4. CriticalKV: Optimizing KV Cache Eviction from an Output Perturbation PerspectiveYuan Feng, Junlin Lv, Haoyu Guo, Yukun Cao et al.ICML 2026 · 21 citations
  5. 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
Dusk over the sea between two cliffs drawn in fine vertical lines