SKVQ: Sliding-window Key and Value Cache Quantization for Large Language Models

要約

大規模言語モデル (LLM) は、より長いトークンのシーケンスを処理できるようになり、本の理解や長い小説の生成などの複雑なタスクが可能になります。
ただし、LLM に必要なキー/値 (KV) キャッシュは、コンテキストの長さが増加するにつれて大量のメモリを消費し、展開のボトルネックになります。
このペーパーでは、極度に低いビット幅の KV キャッシュ量子化の問題に対処するために、スライディング ウィンドウ KV キャッシュ量子化の略である SKVQ と呼ばれる戦略を紹介します。
これを達成するために、SKVQ は量子化グループ内のチャネルの類似性を向上させるために KV キャッシュのチャネルを再配置し、グループ レベルでクリップされた動的量子化を適用します。
さらに、SKVQ は、KV キャッシュ内の最新のウィンドウ トークンが高精度で保存されることを保証します。
これは、KV キャッシュの小さいながらも重要な部分の精度を維持するのに役立ちます。SKVQ は、精度を維持しながら高い圧縮率を実現します。
LLM に関する評価では、SKVQ が以前の量子化アプローチを上回り、精度の損失を最小限に抑えながら KV キャッシュを 2 ビット キーと 1.5 ビット値に量子化できることが実証されました。
SKVQ を使用すると、7b モデルの 80GB メモリ GPU で最大 1M のコンテキスト長を処理し、最大 7 倍高速にデコードできます。

要約(オリジナル)

Large language models (LLMs) can now handle longer sequences of tokens, enabling complex tasks like book understanding and generating lengthy novels. However, the key-value (KV) cache required for LLMs consumes substantial memory as context length increasing, becoming the bottleneck for deployment. In this paper, we present a strategy called SKVQ, which stands for sliding-window KV cache quantization, to address the issue of extremely low bitwidth KV cache quantization. To achieve this, SKVQ rearranges the channels of the KV cache in order to improve the similarity of channels in quantization groups, and applies clipped dynamic quantization at the group level. Additionally, SKVQ ensures that the most recent window tokens in the KV cache are preserved with high precision. This helps maintain the accuracy of a small but important portion of the KV cache.SKVQ achieves high compression ratios while maintaining accuracy. Our evaluation on LLMs demonstrates that SKVQ surpasses previous quantization approaches, allowing for quantization of the KV cache to 2-bit keys and 1.5-bit values with minimal loss of accuracy. With SKVQ, it is possible to process context lengths of up to 1M on an 80GB memory GPU for a 7b model and up to 7 times faster decoding.

arxiv情報

著者 Haojie Duanmu,Zhihang Yuan,Xiuhong Li,Jiangfei Duan,Xingcheng Zhang,Dahua Lin
発行日 2024-05-13 14:39:11+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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