arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.01586cs.LGcs.AIcs.CL

EliteKV:通过 RoPE 频率选择与联合低秩投影实现可扩展的 KV 缓存压缩

EliteKV: Scalable KV Cache Compression via RoPE Frequency Selection and Joint Low-Rank Projection

Fudan University(复旦大学)

Yuhao Zhou, Sirui Song, Boyang Liu, Zhiheng Xi, Senjie Jin, Xiaoran Fan, Zhihao Zhang, Wei Li, Xuanjing Huang

AI总结:

本文提出 EliteKV 框架,通过 RoPElite 识别频率偏好以选择性恢复 key 线性,并结合联合低秩压缩,在仅用 0.6% 数据追加训练下实现 75% 的 KV 缓存压缩且几乎无损性能。

摘要:

旋转位置编码(RoPE)使每个注意力头能够沿序列维度捕获多频率信息,并广泛应用于基础模型。然而,RoPE 引入的非线性使得基于 RoPE 的注意力中 Key-Value(KV)缓存的 key 状态优化变得复杂。现有的 KV 缓存压缩方法通常在旋转前存储 key 状态,并在解码期间应用该变换,引入了额外的计算开销。本文提出了 EliteKV,这是一个用于基于 RoPE 的模型的灵活修改框架,支持可变的 KV 缓存压缩比。EliteKV 首先使用 RoPElite 识别每个头的内在频率偏好,选择性地在注意力计算内对 key 的某些维度恢复线性。在此基础上,key 和 value 的联合低秩压缩实现了部分缓存共享。实验结果表明,仅在原始训练数据的 0.6% 上进行少量追加训练,基于 RoPE 的模型即可实现 KV 缓存大小 75% 的减少,同时将性能保持在可忽略的误差范围内。此外,EliteKV 在同一系列不同规模的模型中始终表现良好。

英文摘要:

Rotary Position Embedding (RoPE) enables each attention head to capture multi-frequency information along the sequence dimension and is widely applied in foundation models. However, the nonlinearity introduced by RoPE complicates optimization of the key state in the Key-Value (KV) cache for RoPE-based attention. Existing KV cache compression methods typically store key state before rotation and apply the transformation during decoding, introducing additional computational overhead. This paper introduces EliteKV, a flexible modification framework for RoPE-based models supporting variable KV cache compression ratios. EliteKV first identifies the intrinsic frequency preference of each head using RoPElite, selectively restoring linearity to certain dimensions of key within attention computation. Building on this, joint low-rank compression of key and value enables partial cache sharing. Experimental results show that with minimal uptraining on only $0.6\%$ of the original training data, RoPE-based models achieve a $75\%$ reduction in KV cache size while preserving performance within a negligible margin. Furthermore, EliteKV consistently performs well across models of different scales within the same family.

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

↑