SQuat: Subspace-orthogonal KV Cache Quantization

要約

キー価値(KV)キャッシュは、以前に生成されたトークンからKVテンソルを保存することにより、LLMSデコードを加速します。
メモリ使用量の増加のコストで冗長計算を削減します。
このオーバーヘッドを軽減するために、既存のアプローチはKVテンソルを低ビット表現に圧縮します。
ただし、量子化エラーは、より多くのトークンが生成されると蓄積する可能性があり、潜在的に望ましくない出力が生成されます。
この論文では、Squat(サブスペース整中KVキャッシュの量子化)を紹介します。
最初に、クエリテンソルに及ぶ部分空間を構築して、最も重要なタスク関連情報をキャプチャします。
主要なテンソル量子化中、(de)量子化されたキーと元のキーの違いがこの部分空間に直交するままであることを強制し、注意メカニズムの出力に対する量子化エラーの影響を最小限に抑えます。
Squatには、モデルの微調整、オフライン学習のための追加のキャリブレーションデータセットは必要ありません。また、私たちが開発する理論的フレームワークに基づいています。
数値実験を通じて、私たちの方法がピークメモリを2.17から2.82に減らし、スループットを2.45から3.60に改善し、既存のKVキャッシュ量子化アルゴリズムよりも優れたベンチマークスコアを達成することを示します。

要約(オリジナル)

The key-value (KV) cache accelerates LLMs decoding by storing KV tensors from previously generated tokens. It reduces redundant computation at the cost of increased memory usage. To mitigate this overhead, existing approaches compress KV tensors into lower-bit representations; however, quantization errors can accumulate as more tokens are generated, potentially resulting in undesired outputs. In this paper, we introduce SQuat (Subspace-orthogonal KV cache quantization). It first constructs a subspace spanned by query tensors to capture the most critical task-related information. During key tensor quantization, it enforces that the difference between the (de)quantized and original keys remains orthogonal to this subspace, minimizing the impact of quantization errors on the attention mechanism’s outputs. SQuat requires no model fine-tuning, no additional calibration dataset for offline learning, and is grounded in a theoretical framework we develop. Through numerical experiments, we show that our method reduces peak memory by 2.17 to 2.82, improves throughput by 2.45 to 3.60, and achieves more favorable benchmark scores than existing KV cache quantization algorithms.

arxiv情報

著者 Hao Wang,Ligong Han,Kai Xu,Akash Srivastava
発行日 2025-03-31 17:37:32+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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