Lois d'échelle pour l'entraînement par quantification en virgule flottante
Scaling Laws for Floating Point Quantization Training
January 5, 2025
Auteurs: Xingwu Sun, Shuaipeng Li, Ruobing Xie, Weidong Han, Kan Wu, Zhen Yang, Yixing Li, An Wang, Shuai Li, Jinbao Xue, Yu Cheng, Yangyu Tao, Zhanhui Kang, Chengzhong Xu, Di Wang, Jie Jiang
cs.AI
Résumé
L'entraînement à faible précision est considéré comme une stratégie efficace pour réduire à la fois les coûts d'entraînement et d'inférence en aval. Les lois d'échelle précédentes pour la précision se concentrent principalement sur la quantification en nombres entiers, accordant moins d'attention aux composants de la quantification en virgule flottante et ne s'adaptant donc pas bien aux pertes LLM dans ce scénario. En revanche, bien que l'entraînement par quantification en virgule flottante soit plus couramment mis en œuvre en production, la recherche à ce sujet a été relativement superficielle. Dans cet article, nous explorons en détail les effets des cibles de quantification en virgule flottante, des bits d'exposant, des bits de mantisse et de la granularité de calcul du facteur d'échelle dans les performances d'entraînement des modèles LLM par quantification en virgule flottante. Tout en présentant une loi d'échelle unifiée précise pour la quantification en virgule flottante, nous fournissons également des suggestions précieuses pour la communauté : (1) Les bits d'exposant contribuent légèrement plus aux performances du modèle que les bits de mantisse. Nous fournissons le rapport optimal entre les bits d'exposant et de mantisse pour différents nombres de bits, disponible pour référence future par les fabricants de matériel ; (2) Nous découvrons la formation de la taille critique des données dans l'entraînement LLM à faible précision. Trop de données d'entraînement dépassant la taille critique des données entraînera inversement une dégradation des performances du LLM ; (3) La précision optimale de la quantification en virgule flottante est directement proportionnelle à la puissance de calcul, mais dans une large plage de puissance de calcul, nous estimons que la meilleure précision en termes de coût-performance se situe entre 4 et 8 bits.
English
Low-precision training is considered an effective strategy for reducing both
training and downstream inference costs. Previous scaling laws for precision
mainly focus on integer quantization, which pay less attention to the
constituents in floating-point quantization and thus cannot well fit the LLM
losses in this scenario. In contrast, while floating-point quantization
training is more commonly implemented in production, the research on it has
been relatively superficial. In this paper, we thoroughly explore the effects
of floating-point quantization targets, exponent bits, mantissa bits, and the
calculation granularity of the scaling factor in floating-point quantization
training performance of LLM models. While presenting an accurate floating-point
quantization unified scaling law, we also provide valuable suggestions for the
community: (1) Exponent bits contribute slightly more to the model performance
than mantissa bits. We provide the optimal exponent-mantissa bit ratio for
different bit numbers, which is available for future reference by hardware
manufacturers; (2) We discover the formation of the critical data size in
low-precision LLM training. Too much training data exceeding the critical data
size will inversely bring in degradation of LLM performance; (3) The optimal
floating-point quantization precision is directly proportional to the
computational power, but within a wide computational power range, we estimate
that the best cost-performance precision lies between 4-8 bits.Summary
AI-Generated Summary