通过残差压缩降低长文本模型显存占用,提升推理速度。
DeltaKV: Residual-Based KV Cache Compression via Long-Range Similarity
- 用历史片段的语义残差表示当前内容,减少存储冗余。
- 在LongBench等数据集上仅需原内存29%仍保持近无损精度。
- 适合需要长上下文推理的智能体、写作等高负载场景。
高效长上下文大模型在自主代理、长链推理和创意写作等应用中的部署,受限于KV缓存内存的线性增长。现有压缩与淘汰方法难以兼顾准确性、压缩率与硬件效率。本文提出DeltaKV,一种基于残差的KV缓存压缩框架,其灵感来自两个实证发现:远距离词元间相似性以及KV表示中高度共享的潜在成分。不同于丢弃词元,DeltaKV以检索到的历史参考为基准,编码语义残差,从而在大幅降低存储的同时保持精度。为进一步将压缩收益转化为实际系统加速,我们设计了Sparse-vLLM——一种高性能推理引擎,具备解耦的内存管理及针对稀疏不规则KV布局优化的内核。实验表明,DeltaKV可将KV缓存内存降至原始大小的29%,并在LongBench、SCBench和AIME上保持近无损精度;集成Sparse-vLLM后,在长上下文场景下相比vLLM最高实现2倍吞吐提升,为可扩展长上下文大模型部署提供了实用路径。代码、模型检查点与数据集见https://github.com/CURRENTF/Sparse-vLLM。
原文摘要 · Abstract (English)
The deployment of efficient long-context LLMs in applications like autonomous agents, long-chain reasoning, and creative writing is fundamentally bottlenecked by the linear growth of KV cache memory. Existing compression and eviction methods often struggle to balance accuracy, compression ratio, and hardware efficiency. We propose DeltaKV, a residual-based KV cache compression framework motivated by two empirical findings: long-range inter-token similarity and highly shared latent components in KV representations. Instead of discarding tokens, DeltaKV encodes semantic residuals relative to retrieved historical references, preserving fidelity while substantially reducing storage. To translate compression gains into real system speedups, we further introduce Sparse-vLLM, a high-performance inference engine with decoupled memory management and kernels optimized for sparse and irregular KV layouts. Experiments show that DeltaKV reduces KV cache memory to 29\% of the original while maintaining near-lossless accuracy on LongBench, SCBench, and AIME. When integrated with Sparse-vLLM, it achieves up to 2$\times$ throughput improvement over vLLM in long-context scenarios, demonstrating a practical path toward scalable long-context LLM deployment. Code, model checkpoints, and datasets are available at https://github.com/CURRENTF/Sparse-vLLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。