arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.08005cs.CLcs.AI
收藏

DeltaKV: 基于残差的KV缓存压缩 via 长距离相似性

ResidualKV: Residual-Based KV Cache Compression for Efficient Long-Context Inference

Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳))

Jitai Hao, Qiang Huang, Yaowei Wang, Min Zhang, Jun Yu

AI总结:

DeltaKV通过残差编码减少KV缓存内存,提升长上下文LLM的部署效率。

摘要:

高效长上下文LLM在自主代理、长链推理和创意写作等应用中的部署受到KV缓存内存线性增长的限制。现有压缩和淘汰方法往往难以在精度、压缩率和硬件效率之间取得平衡。我们提出DeltaKV,一种基于残差的KV缓存压缩框架,受两个经验发现的启发:长距离跨令牌相似性和KV表示中高度共享的潜在组件。与丢弃令牌不同,DeltaKV通过编码相对于检索历史参考的语义残差,在保持保真度的同时显著减少存储。为了将压缩增益转化为实际系统加速,我们进一步引入Sparse-vLLM,一种高性能推理引擎,具有解耦的内存管理和优化稀疏和不规则KV布局的内核。实验表明,DeltaKV将KV缓存内存减少到原始的29%,在LongBench、SCBench和AIME上保持接近无损的精度。当与Sparse-vLLM集成时,它在长上下文场景中实现了比vLLM高2倍的吞吐量提升,展示了可扩展长上下文LLM部署的实用路径。代码、模型检查点和数据集可在https://github.com/CURRENTF/Sparse-vLLM上获得。

英文摘要:

Efficient long-context inference faces two coupled bottlenecks: KV-cache memory grows linearly with context length, while attention computation grows quadratically. Existing approaches typically address one at the expense of irreversible token eviction, full-cache retention, or full-history reconstruction, limiting their effectiveness for multi-turn interaction and long-form reasoning. Motivated by two empirical properties, Long-Range Inter-Token Similarity and Smooth Residual Distribution, we propose ResidualKV, which factorizes the KV cache into a sparse set of globally retrieved references and compact, quantized residual codes for the remaining tokens. This representation preserves token-specific information without permanent eviction and, when combined with sparse attention, reconstructs only the selected states on demand. Dynamic-stride scheduling further reduces reference growth from linear to approximately logarithmic at ultra-long contexts. Across Llama, Qwen, LLaVA-OV, and Qwen3-VL backbones, ResidualKV maintains near-full-cache performance using only 13%-16% KV storage and 30% attention computation on LongBench, and 8%-10% storage and 10% computation in matched-budget multimodal evaluation. It also accelerates decoding by up to $1.5\times$ with KV-cache quantization and $3.4\times$ without it. These results show that global cross-token redundancy supports accurate, memory-efficient, and computation-efficient long-context inference. The source code is available at https://github.com/CURRENTF/ResidualKV.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑