xKV: Cross-Layer SVD for KV-Cache Compression

要約

長いコンテキストウィンドウを備えた大規模な言語モデル(LLMS)は、強力なアプリケーションを有効にしますが、キーと値の状態(KV-Cache)を保存するために高いメモリ消費量を犠牲にします。
最近の研究では、KVキャッシュを複数のレイヤーから共有表現に統合しようとしましたが、これらのアプローチは高価な前orainingを必要とするか、一般的には実際には保持されていないレイヤー間の高いトークンあたりのコサインの類似性の仮定に依存しています。
支配的な特異ベクトルは、KVキャッシュの複数の層にわたって非常によく整合されていることがわかります。
この洞察を活用して、グループ化された層のKVキャッシュに特異値分解(SVD)を適用する単純なトレーニング後の方法であるXKVを提案します。
XKVは、複数のレイヤーのKVキャッシュを共有低ランクの部分空間に統合し、KVキャッシュサイズを大幅に削減します。
XKVは、広く使用されているLLMS(例えば、Llama-3.1やQWEN2.5など)を使用したRuler Long Contextベンチマーク(例:Llama-3.1およびQwen2.5)を通じて広範囲にわたる評価を通じて、最先端のレイヤー間技術よりも最大6.8倍の圧縮率を達成し、精度を2.7%改善します。
さらに、XKVは、新たなマルチヘッド潜在的注意(MLA)(例えば、Deepseek-Coder-V2)と互換性があり、パフォーマンスの低下なしにコーディングタスクで顕著な3倍の圧縮率をもたらします。
これらの結果は、XKVの強力な能力と汎用性を強調し、長いコンテキストLLM推論のメモリボトルネックに対処します。
私たちのコードは、https://github.com/abdelfattah-lab/xkvで公開されています。

要約(オリジナル)

Large Language Models (LLMs) with long context windows enable powerful applications but come at the cost of high memory consumption to store the Key and Value states (KV-Cache). Recent studies attempted to merge KV-cache from multiple layers into shared representations, yet these approaches either require expensive pretraining or rely on assumptions of high per-token cosine similarity across layers which generally does not hold in practice. We find that the dominant singular vectors are remarkably well-aligned across multiple layers of the KV-Cache. Exploiting this insight, we propose xKV, a simple post-training method that applies Singular Value Decomposition (SVD) on the KV-Cache of grouped layers. xKV consolidates the KV-Cache of multiple layers into a shared low-rank subspace, significantly reducing KV-Cache sizes. Through extensive evaluations on the RULER long-context benchmark with widely-used LLMs (e.g., Llama-3.1 and Qwen2.5), xKV achieves up to 6.8x higher compression rates than state-of-the-art inter-layer technique while improving accuracy by 2.7%. Moreover, xKV is compatible with the emerging Multi-Head Latent Attention (MLA) (e.g., DeepSeek-Coder-V2), yielding a notable 3x compression rates on coding tasks without performance degradation. These results highlight xKV’s strong capability and versatility in addressing memory bottlenecks for long-context LLM inference. Our code is publicly available at: https://github.com/abdelfattah-lab/xKV.

arxiv情報

著者 Chi-Chih Chang,Chien-Yu Lin,Yash Akhauri,Wei-Cheng Lin,Kai-Chiang Wu,Luis Ceze,Mohamed S. Abdelfattah
発行日 2025-03-24 17:06:37+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.LG パーマリンク