PrefixQuant: Eliminating Outliers by Prefixed Tokens for Large Language Models Quantization

要約

大規模な言語モデル(LLM)の既存の重量活性化量子化方法は、主にチャネルごとの外れ値に対処しますが、多くの場合、量子化モデルの精度を制限するトークンごとの外れ値を無視します。
この作業では、トークンごとの外れ値を効果的に分離することにより、さまざまな精密レベル(W4A4KV4およびW4A8KV4)と粒度(動的および静的量子化)にわたって最先端のパフォーマンスを達成する新しい量子化方法であるプレフィックスクアントを提案します。
最初に、プレフィックスは、KVキャッシュの外れ値トークンをプレフィックスにすることによりトークンごとの外れ値を排除します。これは、トレーニングなしで非常に効率的なプロセスです(例えば、llama-3-70bの場合は1分)。
第二に、プレフィックスは、量子化エラーを補うために、ブロックごとのトレーニング用の新しいトレーニング可能なパラメーターを導入します。
私たちの実験は、プレフィックスが粗い静的量子化設定の下であっても、既存の動的量子化法を大幅に上回ることを示しています。
たとえば、プレフィックスは、W4A4KV4 LLAMA-3-8Bで、それぞれ動的および静的な量子化設定で5つのゼロショット推論タスクで、スピクアント(動的量子化)よりも+3.08および+2.85ポイントの平均精度改善を達成します。
さらに、W4A4プレフィックスを使用して、LLMSの最大2.74倍のプレディリングスピードアップと2.16倍のデコードスピードアップを示します。
私たちのコードは、https://github.com/chenmnz/prefixquantで入手できます。

要約(オリジナル)

Existing weight-activation quantization methods for Large Language Models (LLMs) primarily address channel-wise outliers but often neglect token-wise outliers, which limits the accuracy of quantized models. In this work, we propose PrefixQuant, a novel quantization method that achieves state-of-the-art performance across various precision levels (W4A4KV4 and W4A8KV4) and granularities (dynamic and static quantization) by effectively isolating token-wise outliers. First, PrefixQuant eliminates token-wise outliers by prefixing outlier tokens in the KV cache, a process that is training-free and highly efficient (e.g., 1 minutes for Llama-3-70B). Second, PrefixQuant introduces new trainable parameters for block-wise training to compensate for quantization error. Our experiments show that PrefixQuant significantly outperforms existing dynamic quantization methods, even under coarser static quantization settings. For instance, PrefixQuant achieves an average accuracy improvement of +3.08 and +2.85 points over SpinQuant (dynamic quantization) on five zero-shot reasoning tasks under dynamic and static quantization settings, respectively, on W4A4KV4 Llama-3-8B. Additionally, we demonstrate up to 2.74x prefilling speedup and 2.16x decoding speedup for LLMs using W4A4 PrefixQuant. Our code is available at https://github.com/ChenMnZ/PrefixQuant.

arxiv情報

著者 Mengzhao Chen,Yi Liu,Jiahao Wang,Yi Bin,Wenqi Shao,Ping Luo
発行日 2025-01-27 13:39:25+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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