CompKV: Compensation-Aware KV Selection for Long-Context LLM Inference
Zhen Huang, Ruizhe Yao, Danyi Liu, Xinrui Chen, Shuwei Li, Siru Zhong, Zijian Cao, Yushan Lai, Mingming Guo, Weijie Zheng, Haohuan Fu
Abstract
Despite their strong performance, large language models (LLMs) are bottlenecked by KV cache memory traffic during long-context inference. Sparse attention is widely used to accelerate LLM inference by computing exact attention over a selected subset of tokens. To recover the contribution of tokens excluded from exact attention, recent methods apply coarse-grained compensation to the omitted attention tail. However, existing methods typically select tokens based on attention mass and only then compensate for the unselected tokens. This decoupled design overlooks their interaction: selection should prioritize tokens that would leave the largest compensation error if omitted. To address this limitation, we introduce CompKV, the first compensation-aware sparse attention framework that divides tokens into blocks and explicitly optimizes selection for the downstream compensation mechanism. Our theoretical analysis shows that the residual left by block-level mean compensation is governed by both block attention mass and within-block logit variation. We approximate this residual using compact block-level statistics, yielding a deployable selection criterion. We further develop an efficient asynchronous implementation. Experiments on RULER and LongBench-Pro show that CompKV performs best among the evaluated sparse baselines while delivering up to a self-attention speedup over full attention.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
LinearSpec: Drafting from the Target's Memory for Long-Context Speculative Decoding in Hybrid Vision-Language Models
Shared title terminologycs.LGHaiyu Wang, Sai Qian Zhang, Steven Li
SpaFactor: Lightweight Spatial Context-Aware Gene Program Modeling for Histology-to-Transcriptomics Inference
Shared title terminologycs.LGShiting Ruan, Xitong Ling, Qiming He et al.
FIMOSS: Fair In-Context Learning via Multi-Objective Subset Selection
Shared title terminologycs.LGManish Chandra, Debasis Ganguly, Iadh Ounis
Beyond Point-wise Matching: Diversity-Aware Data Selection for Instruction Tuning via Gradient Subspace Optimization
Shared title terminologycs.LGJiyu Tian, Jiyuan Gan, Runfa Zhang et al.
Geometry-Screened Refit-Aware Compression of ReLU Networks
Shared title terminologycs.LGRavi Dhiman
A Matched Filter Representation for Environment-Aware MIMO Channel Estimation
Shared title terminologycs.LGMd. Farhan Shadiq, Md Tawheedul Islam Bhuian, Kyoung-Don Kang