ResKV:用残差缓存重建被剔除的注意力贡献,实现固定预算KV缓存压缩
ResKV: Reconstructing Omitted Attention Contributions for Fixed-Budget KV Cache Compression
ResKV将固定KV预算拆分为精确主缓存与紧凑残差缓存,让被剔除token的贡献以残差统计形式重新参与softmax归一化,同时恢复注意力分子与分母质量。该方法用构建期验证代理为每层和每个KV head分配残差,并在解码期通过动态门控按查询调整残差贡献。在LongBench与RULER上,相同保留KV预算下取得广泛提升,并保持压缩解码的峰值内存与长上下文吞吐效率。
arXiv:2607.29591v2 Announce Type: replace Abstract: KV cache compression is essential for efficient long-context inference. Existing eviction methods permanently discard unselected tokens and consequently remove their aggregate contribution to attention. Merging-based alternatives preserve more information but can perturb retained keys and values that should remain exact. We observe that the information omitted by cache eviction can be formulated as residual statistics in both the numerator and denominator of softmax attention. Based on this observation, we propose ResKV, which divides a fixed KV budget into an exact main cache and a compact residual cache that reconstructs the contribution of omitted tokens. ResKV lets main-cache tokens and residual entries participate in the same softmax normalization, so residual entries restore both attention numerator and denominator mass rather than acting as a post-hoc correction. A construction-time validation proxy determines residual allocation for each layer and KV head, while a decode-time dynamic gate adjusts residual contributions for individual queries. Comprehensive evaluations on LongBench and RULER, covering query-aware and query-agnostic settings, multiple backbones, cache budgets, and representative compression baselines, demonstrate broad improvements under the same retained KV budget while preserving the practical efficiency of compressed decoding, including peak memory usage and long-context decode throughput.
来源:arXiv (AI + Vision + Imaging) · arxiv.org