量子化対応トレーニングのスケーリング則
Scaling Law for Quantization-Aware Training
May 20, 2025
著者: Mengzhao Chen, Chaoyi Zhang, Jing Liu, Yutao Zeng, Zeyue Xue, Zhiheng Liu, Yunshui Li, Jin Ma, Jie Huang, Xun Zhou, Ping Luo
cs.AI
要旨
大規模言語モデル(LLM)は、膨大な計算リソースとメモリを必要とし、デプロイメントにおける課題を生み出します。量子化対応トレーニング(QAT)は、モデルの精度を低下させながらも性能を維持することで、これらの課題に対処します。しかし、特に4ビット精度(W4A4)におけるQATのスケーリング挙動は十分に理解されていません。既存のQATスケーリング則は、トレーニングトークン数や量子化粒度といった重要な要素を無視することが多く、その適用性が制限されています。本論文では、モデルサイズ、トレーニングデータ量、量子化グループサイズの関数として量子化誤差をモデル化する統一的なスケーリング則を提案します。268回のQAT実験を通じて、量子化誤差はモデルサイズが増大するにつれて減少するが、トレーニングトークンが増えるほど、また量子化粒度が粗くなるほど増加することを示します。W4A4量子化誤差の原因を特定するため、これを重みと活性化の成分に分解します。両成分はW4A4量子化誤差の全体的な傾向に従いますが、異なる感度を持ちます。具体的には、重み量子化誤差はトレーニングトークンが増えるほど急速に増加します。さらに分析を行った結果、外れ値によって引き起こされるFC2層の活性化量子化誤差が、W4A4 QAT量子化誤差の主要なボトルネックであることが明らかになりました。このボトルネックに対処するために混合精度量子化を適用することで、重みと活性化の量子化誤差が同程度に収束することを実証します。また、トレーニングデータが増えると、重み量子化誤差は最終的に活性化量子化誤差を上回り、そのようなシナリオでは重み量子化誤差を低減することも重要であることが示唆されます。これらの知見は、QATの研究開発を改善するための重要な洞察を提供します。
English
Large language models (LLMs) demand substantial computational and memory
resources, creating deployment challenges. Quantization-aware training (QAT)
addresses these challenges by reducing model precision while maintaining
performance. However, the scaling behavior of QAT, especially at 4-bit
precision (W4A4), is not well understood. Existing QAT scaling laws often
ignore key factors such as the number of training tokens and quantization
granularity, which limits their applicability. This paper proposes a unified
scaling law for QAT that models quantization error as a function of model size,
training data volume, and quantization group size. Through 268 QAT experiments,
we show that quantization error decreases as model size increases, but rises
with more training tokens and coarser quantization granularity. To identify the
sources of W4A4 quantization error, we decompose it into weight and activation
components. Both components follow the overall trend of W4A4 quantization
error, but with different sensitivities. Specifically, weight quantization
error increases more rapidly with more training tokens. Further analysis shows
that the activation quantization error in the FC2 layer, caused by outliers, is
the primary bottleneck of W4A4 QAT quantization error. By applying
mixed-precision quantization to address this bottleneck, we demonstrate that
weight and activation quantization errors can converge to similar levels.
Additionally, with more training data, weight quantization error eventually
exceeds activation quantization error, suggesting that reducing weight
quantization error is also important in such scenarios. These findings offer
key insights for improving QAT research and development.Summary
AI-Generated Summary