arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.21686cs.LG
收藏

不要那么Stief!在Stiefel流形上学习KV缓存低秩近似

Don't be so Stief! Learning KV Cache low-rank approximation over the Stiefel manifold

Department of Control and Computer Engineering, Politecnico di Torino(控制与计算机工程系,托里诺理工学院);Huawei Zurich Research Center(华为苏黎世研究中心)

Luca Benfenati, Matteo Risso, Andrea Vannozzi, Ahmet Caner Yüzügüler, Lukas Cavigelli, Enrico Macii, Daniele Jahier Pagliari, Alessio Burrello

AI总结:

提出StiefAttention方法,通过在Stiefel流形上学习正交投影基并最小化解码器层输出重建误差,实现KV缓存压缩,优于现有SVD方法。

摘要:

键值(KV)缓存能够实现快速自回归解码,但在长上下文中成为高带宽内存(HBM)容量和带宽的主要瓶颈。一种常见的缓解方法是通过将每个头的矩阵投影到较低秩来压缩缓存的键和值,仅将投影存储在HBM中。然而,现有的训练后方法通常使用SVD风格的代理目标来拟合这些投影,这可能无法很好地反映softmax、值混合以及后续解码器层变换后的端到端重建。为此,我们引入了StiefAttention,一种训练后KV缓存压缩方法,通过直接最小化解码器层输出重建误差来学习正交投影基。StiefAttention还构建了候选秩上的逐层误差-秩分布,从而能够在用户指定的KV缓存预算下进行顺序秩分配。值得注意的是,在相同条件下,对于Llama3-8B,StiefAttention在C4困惑度上比EigenAttention高出4.2个点,在0-shot MMLU准确率上高出8.9个点,在等压缩率下,相对于原始解码器层输出,实现了更低的相对误差和更高的余弦相似度。

英文摘要:

Key-value (KV) caching enables fast autoregressive decoding but at long contexts becomes a dominant bottleneck in High Bandwidth Memory (HBM) capacity and bandwidth. A common mitigation is to compress cached keys and values by projecting per-head matrices to a lower rank, storing only the projections in the HBM. However, existing post-training approaches typically fit these projections using SVD-style proxy objectives, which may poorly reflect end-to-end reconstruction after softmax, value mixing, and subsequent decoder-layer transformations. For these reasons, we introduce StiefAttention, a post-training KV-cache compression method that learns orthonormal projection bases by directly minimizing decoder-layer output reconstruction error. StiefAttention additionally constructs layer-wise error-rank profiles over candidate ranks, enabling sequential rank allocation under a user-specified KV cache budget. Notably, on Llama3-8B under the same conditions, StiefAttention outperforms EigenAttention by $4.2$ points on C4 perplexity and $8.9$ points on 0-shot MMLU accuracy at iso-compression, yielding lower relative error and higher cosine similarity with respect to the original decoder-layer outputs.

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

↑