[論文レビュー] OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
OmniQuantは、Learnable Weight ClippingとLearnable Equivalent Transformationを導入し、PTQ効率で大規模言語モデルの高品質な重みのみ量子化と重み-活性化量子化を実現します。
Large language models (LLMs) have revolutionized natural language processing tasks. However, their practical deployment is hindered by their immense memory and computation requirements. Although recent post-training quantization (PTQ) methods are effective in reducing memory footprint and improving the computational efficiency of LLM, they hand-craft quantization parameters, leading to low performance, especially in extremely low-bit quantization. To tackle this issue, we introduce an Omnidirectionally calibrated Quantization (\textbf{OmniQuant}) technique for LLMs, which achieves good performance in diverse quantization settings while maintaining the computational efficiency of PTQ by efficiently optimizing various quantization parameters. OmniQuant comprises two innovative components including Learnable Weight Clipping (LWC) and Learnable Equivalent Transformation (LET). LWC modulates the extreme values of weights by optimizing the clipping threshold. Meanwhile, LET tackles activation outliers by shifting the challenge of quantization from activations to weights. Operating within a differentiable framework using block-wise error minimization, OmniQuant can optimize the quantization process efficiently for both weight-only and weight-activation quantization. For instance, the LLaMA-2 model family size 7-70B can be processed with OmniQuant on a single A100-40G GPU within 1-16 hours using 128 samples. Extensive experiments validate OmniQuant's superior performance across diverse quantization configurations such as W4A4 (4-bit weight, 4-bit activation), W6A6, W4A16, W3A16, and W2A16. Additionally, OmniQuant demonstrates effectiveness in instruction-tuned models and delivers notable improvements in inference speed and memory reduction on real devices. Codes are available at \url{https://github.com/OpenGVLab/OmniQuant}.
研究の動機と目的
- 精度を犠牲にせず、巨大言語モデル(LLMs)のメモリと計算量のニーズを削減する動機付け。
- 微分可能な、ポストトレーニング量子化フレームワークを開発し、QATに近い性能を達成する。
- さまざまなLLM系へ信頼性の高い低ビット量子化(例:W2A16、W4A4)を実現する。
- 大規模モデル向けにPTQ風のデータ効率と単一GPUでの実用性を維持する。
提案手法
- 小さな量子化パラメータのセットを学習しつつ、全精度ウェイトを固定するブロック単位の量子化誤差最小化目的を定式化する。
- Learnable Weight Clipping (LWC) を導入し、ウェイト量子化を改善するためのクリッピング閾値を最適化する。
- Learnable Equivalent Transformation (LET) を導入し、線形層と注意機構におけるチャネル単位のスケーリング/シフトを介して量子化の難易度を活性化からウェイトへ移す。
- ブロック単位の枠組みでLWCとLETを共同最適化する微分可能な最適化を適用し、ウェイトのみ量子化とウェイト-活性化量子化を可能にする。
- 活性化とウェイトの量子化にはMinMax量子化器を使用し、最適化後にパラメータを元のウェイトに結合する。
- 複数モデル(LLaMA、OPT、Falcon、LLaMA-2、LLaMA-2-chat)および量子化設定(W4A4、W3A16、W2A16、W6A6 など)で検証する。
実験結果
リサーチクエスチョン
- RQ1勾配法ベースの最適化をPTQに組み込み、LLMの量子化でQATに近い性能を達成できるか?
- RQ2トランスフォーマーのウェイト分布と活性化の外れ値をどう軽減して、極めて低ビット量子化を可能にするか?
- RQ3学習可能な要素(LWCとLET)はモデルファミリや指示調整バリアント間で一般化するか?
- RQ4単一GPUハードウェアで大規模モデルを量子化する際の実用的なデータ量と時間要件はどの程度か?
- RQ5OmniQuantのウェイトのみ量子化とウェイト-活性化量子化は、従来のPTQ/QAT法とどう比較されるか?
主な発見
- OmniQuantは、さまざまな設定(W4A4、W3A16、W2A16、W6A6 など)とモデルファミリに渡って、従来のPTQベース手法を上回る。
- W2A16量子化では、LLaMA-1/2モデルでGPTQや他のベースラインよりもかなり良いパープレキシティを達成する。
- ウェイト-活性化設定では、ゼロショットタスクの精度で顕著な向上を示し(複数のLLaMA系で平均約5–12ポイント程度の改善など)、小型モデルでは一部のQAT手法を上回ることがある。
- OmniQuantはLLaMA-2-chatや他のinstruction-tunedモデルの量子化を、GPT-4評価プロトコル下で競争力のある性能で実現する。
- LLaMA-2ファミリや他のモデルの量子化は、単一のA100-40G GPUで、モデルサイズあたり最小128サンプル、1–16時間の計算量で実行できる。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。