浮点量化训练的缩放定律

Scaling Laws for Floating Point Quantization Training

孙兴武 Xingwu Sun · Tencent Hunyuan · 2025-01-05 · arXiv:2501.02423 ↗ · 被引 7

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

低精度训练被认为是降低训练和下游推理成本的有效策略。以往的精度缩放定律主要关注整数量化,较少关注浮点量化的组成部分,因此无法很好地拟合该场景下大语言模型的损失。相比之下,浮点量化训练在生产中更常见,但其研究相对浅显。本文深入探讨了浮点量化目标、指数位、尾数位以及缩放因子计算粒度对大语言模型浮点量化训练性能的影响。除了提出准确的浮点量化统一缩放定律外,我们还为社区提供了有价值的建议:(1)指数位对模型性能的贡献略大于尾数位。我们给出了不同比特数下的最优指数-尾数比,可供硬件制造商未来参考;(2)我们发现了低精度大语言模型训练中临界数据量的形成。超过临界数据量的过多训练数据反而会导致大语言模型性能下降;(3)最优浮点量化精度与计算能力成正比,但仅限于较宽的计算能力范围内。我们估计最佳性价比精度应在 4-8 位之间。

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 (FP) quantization, and thus cannot well fit the LLM losses in this scenario. In contrast, while FP quantization training is more commonly implemented in production, it's research has been relatively superficial. In this paper, we thoroughly explore the effects of FP quantization targets, exponent bits, mantissa bits, and the calculation granularity of the scaling factor in FP quantization training performance of LLM models. In addition to an accurate FP 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 FP quantization precision is directly proportional to the computational power, but within a wide computational power range. We estimate that the best cost-performance precision should lie between 4-8 bits.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 17)

阅读逐段中英对照全文 →