RefineKV: Query-Adaptive KV Cache Compression via Attention-Error Bounds
Abstract
Repeatedly accessing the full key--value (KV) cache is a major bottleneck in long-context language model decoding. We find that small query-specific subsets can accurately approximate full attention, yet their union covers nearly the entire cache, motivating query-adaptive access for the KV cache. A natural approach is to split the KV cache into clusters, using compact representatives for clusters that incur negligible error while expanding the rest to their original KV entries. We derive a selection criterion from an upper bound on attention-output error, which reveals two complementary factors governing the error: importance measures the impact of a cluster, while distortion measures how faithfully the cluster can be represented. Based on this criterion, we propose RefineKV, a decoding-time query-adaptive KV compression method. Experiments on two models and three benchmarks demonstrate that RefineKV retains near-full-attention quality while achieving up to 7.6x speedup in the attention phase and 1.66x faster decoding, establishing a new quality-latency Pareto frontier.
Create a lesson
Related papers
Turnout: Adaptive Attention Switching for Efficient Reasoning
Shared title terminology · Anna Kuzina, Mart van Baalen, Paul N. Whatmough et al.
DisSparse: Pipelined Top-p Sparse Attention for Long-Context LLM Serving
Shared title terminology · Nurlan Nazaraliyev, Elaheh Sadredini, Nael Abu-Ghazaleh
HiPPO Functional Memory: Coordinate-Queryable Attention for Irregular Time Series
Shared title terminology · Zhaodong Guo, Haoyun Feng
Benchmarking EEG feature families for ADHD research in children and adolescents: performance and explainability across attention tasks
Shared title terminology · Javier Sanchis, Jorge García-Carrasco, Álvaro Navarro et al.
Mixture of Latent Recursions for Low-Rank Adaptation
Shared title terminology · Weixun Luo, Ye Mao, Ranran Huang et al.
DPMA: Learning to Compress Mixture-of-Experts Models
Shared title terminology · Jon Irureta, Jon Imaz, Philipp Wiesner et al.