QAQ: Quality Adaptive Quantization for LLM KV Cache

要約

LLM の出現により、NLP アプリケーション、特に質問応答システムやテキスト生成などの分野で新たなブレークスルーが起こりました。
より長いコンテキストの必要性が高まるにつれ、コンテキストの長さに応じた Key-Value (KV) キャッシュの線形拡張が原因で、モデルのデプロイメントに重大なボトルネックが生じます。
既存の方法は主に、置換または削除のアテンション スコアに基づいて KV キャッシュを並べ替えるなど、さまざまな仮説に依存して、KV キャッシュを圧縮し、モデルのスループットを向上させます。
ただし、これらの戦略で使用されるヒューリスティックは、重要な KV キャッシュを誤って削除する可能性があり、モデルのパフォーマンスを大幅に低下させる可能性があります。
この論文では、KV キャッシュの品質適応量子化スキームである QAQ を提案します。
私たちは、キー キャッシュとバリュー キャッシュが量子化に対して異なる感度を示し、不均一な量子化に対して個別の量子化戦略を定式化することを理論的に実証します。
専用の外れ値処理の統合と、改善された注意を意識したアプローチにより、QAQ は、モデルのパフォーマンスへの影響を無視できる程度に、KV キャッシュ サイズの最大 10 倍の圧縮率を達成します。
QAQ は、LLM 導入の実際的なハードルを大幅に軽減し、より長いコンテキストのアプリケーションに新たな可能性をもたらします。
コードは github.com/ClubieDong/KVCacheQuantization で入手できます。

要約(オリジナル)

The emergence of LLMs has ignited a fresh surge of breakthroughs in NLP applications, particularly in domains such as question-answering systems and text generation. As the need for longer context grows, a significant bottleneck in model deployment emerges due to the linear expansion of the Key-Value (KV) cache with the context length. Existing methods primarily rely on various hypotheses, such as sorting the KV cache based on attention scores for replacement or eviction, to compress the KV cache and improve model throughput. However, heuristics used by these strategies may wrongly evict essential KV cache, which can significantly degrade model performance. In this paper, we propose QAQ, a Quality Adaptive Quantization scheme for the KV cache. We theoretically demonstrate that key cache and value cache exhibit distinct sensitivities to quantization, leading to the formulation of separate quantization strategies for their non-uniform quantization. Through the integration of dedicated outlier handling, as well as an improved attention-aware approach, QAQ achieves up to 10x the compression ratio of the KV cache size with a neglectable impact on model performance. QAQ significantly reduces the practical hurdles of deploying LLMs, opening up new possibilities for longer-context applications. The code is available at github.com/ClubieDong/KVCacheQuantization.

arxiv情報

著者 Shichen Dong,Wen Cheng,Jiayu Qin,Wei Wang
発行日 2024-04-12 13:00:25+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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