arXiv:2509.15038cs.CL2025-09NeurIPS被引 4

用矩阵分解选关键键值对,提升大模型推理速度与准确率

Value-Guided KV Compression for LLMs via Approximated CUR Decomposition

  • 基于CUR分解计算重要性,从输出角度选择保留的键值对
  • 在强压缩下比现有方法最高提升9.6%准确率,延迟降低40%
  • 适合追求推理效率与精度平衡的大模型部署场景

键值(KV)缓存压缩已成为降低自回归语言模型推理内存与延迟开销的关键技术。以往方法主要依赖查询-键注意力分数排序和淘汰缓存项,假设注意力强度与语义重要性相关。然而,该启发式忽略了直接影响注意力输出的值向量。本文提出CurDKV,一种以值为中心的新型KV压缩方法,基于CUR矩阵分解计算的杠杆得分选择键和值。该方法近似注意力输出 $softmax(QK^T)V$ 的主导子空间,确保保留项最大程度维持模型预测行为。理论上,我们证明注意力分数近似不保证输出保持;并表明基于CUR的选择能最小化端到端注意力重建损失。实验上,CurDKV在LLaMA和Mistral上于激进压缩预算下,准确率比SnapKV和ChunkKV等先进方法最高提升9.6%,同时兼容FlashAttention和分组查询注意力。此外,其生成延迟最高降低40%,提供了实用的速度-精度权衡。

原文摘要 · Abstract (English)

Key-value (KV) cache compression has emerged as a critical technique for reducing the memory and latency overhead of autoregressive language models during inference. Prior approaches predominantly rely on query-key attention scores to rank and evict cached tokens, assuming that attention intensity correlates with semantic importance. However, this heuristic overlooks the contribution of value vectors, which directly influence the attention output. In this paper, we propose CurDKV, a novel, value-centric KV compression method that selects keys and values based on leverage scores computed from CUR matrix decomposition. Our approach approximates the dominant subspace of the attention output $softmax(QK^T)V$, ensuring that the retained tokens best preserve the model's predictive behavior. Theoretically, we show that attention score approximation does not guarantee output preservation, and demonstrate that CUR-based selection minimizes end-to-end attention reconstruction loss. Empirically, CurDKV achieves up to 9.6% higher accuracy than state-of-the-art methods like SnapKV and ChunkKV under aggressive compression budgets on LLaMA and Mistral, while maintaining compatibility with FlashAttention and Grouped Query Attention. In addition to improved accuracy, CurDKV reduces generation latency by up to 40% at high compression, offering a practical speed-accuracy tradeoff.

大模型压缩注意力机制推理优化

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