arXiv:2508.16134cs.LGcs.AI2025-08被引 7

无需训练即可大幅压缩大模型注意力缓存,且不损失性能。

CommonKV: Compressing KV Cache with Cross-layer Parameter Sharing

  • 通过相邻层参数共享实现跨层缓存压缩,无需修改模型结构。
  • 在不同压缩率下均优于现有方法,最高达98%压缩率无明显性能下降。
  • 可与量化、淘汰策略协同使用,适合部署在资源受限场景。

大型语言模型因序列长度增加导致注意力缓存(KV cache)内存压力剧增。现有跨层缓存共享方法或需修改模型架构并重新预训练,或在高压缩率下显著降低性能。为此,我们提出CommonKV,一种无需训练的跨层缓存压缩方法,通过相邻层参数共享实现。受跨层隐藏状态高度相似的启发,采用奇异值分解(SVD)实现相邻权重共享,使潜在缓存更易合并。同时引入自适应预算分配策略,基于余弦相似度动态分配压缩预算,避免差异较大的缓存被过度压缩。在LongBench和Ruler等多个骨干模型与基准测试中,该方法在不同压缩比下均持续优于现有低秩与跨层方法。此外,CommonKV的优势与其他量化及淘汰方法正交,结合后可实现98%压缩率而性能损失极小。

原文摘要 · Abstract (English)

Large Language Models (LLMs) confront significant memory challenges due to the escalating KV cache with increasing sequence length. As a crucial technique, existing cross-layer KV cache sharing methods either necessitate modified model architectures with subsequent pre-training or incur significant performance degradation at high compression rates. To mitigate these challenges, we propose CommonKV, a training-free method for cross-layer KV cache compression through adjacent parameters sharing. Inspired by the high similarity observed in cross-layer hidden states, we utilize Singular Value Decomposition (SVD) to achieve weight sharing across adjacent parameters, resulting in a more easily mergeable latent KV cache. Furthermore, we also introduce an adaptive budget allocation strategy. It dynamically assigns compression budgets based on cosine similarity, ensuring that dissimilar caches are not over-compressed. Experiments across multiple backbone models and benchmarks including LongBench and Ruler demonstrate that the proposed method consistently outperforms existing low-rank and cross-layer approaches at various compression ratios. Moreover, we find that the benefits of CommonKV are orthogonal to other quantization and eviction methods. By integrating these approaches, we can ultimately achieve a 98\% compression ratio without significant performance loss.

KV缓存压缩大模型优化参数共享推理加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。