Scaling Laws for Floating Point Quantization Training
本文提出了一个针对低精度浮点量化训练的统一缩放定律,为未来低精度LLM训练提供了精确的指导。
更新于 2025-01-07。作者: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。
中文摘要
低精度训练被认为是降低训练和下游推理成本的有效策略。之前的精度扩展法则主要关注整数量化,对浮点量化的组成部分关注较少,因此不能很好地适应这种场景下的LLM损失。相比之下,尽管浮点量化训练在生产中更常见,但对其的研究相对较浅。在本文中,我们全面探讨了浮点量化目标、指数位、尾数位以及缩放因子的计算粒度对LLM模型浮点量化训练性能的影响。在提出准确的浮点量化统一扩展法则的同时,我们还为社区提供了有价值的建议:(1)指数位对模型性能的贡献略大于尾数位。我们提供了不同位数下的最佳指数-尾数位比率,可供硬件制造商参考;(2)我们发现低精度LLM训练中存在关键数据量。过多的训练数据超过关键数据量将反向导致LLM性能下降;(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 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.
解读
一句话总结
本文提出了一个针对低精度浮点量化训练的统一缩放定律,为未来低精度LLM训练提供了精确的指导。
问题1:这篇论文想要解决什么具体问题?
• 问题背景:低精度训练是降低训练和推理成本的有效策略,但现有缩放定律主要关注整数量化,对浮点量化关注不足。 • 现有方案不足:现有缩放定律无法很好地适应浮点量化训练场景,无法准确预测LLM在低精度下的性能。 • 研究目标:建立、验证和分析LLM浮点量化训练的缩放定律,为低精度LLM训练提供指导。
问题2:论文的核心创新点是什么?
• 技术创新:提出了一个针对浮点量化训练的统一缩放定律,考虑了数据大小、模型大小、指数、尾数和缩放因子块大小等因素。 • 方法改进:通过大量实验,系统地探索了不同精度设置下的基本缩放定律形成,以及量化目标、指数、尾数和块大小对损失的影响。 • 优势:与现有方法相比,该缩放定律能够更准确地预测LLM在不同浮点量化训练设置下的性能。
问题3:实验结果如何验证了方法的有效性?
• 关键实验:进行了大量实验,包括不同数据/模型大小、精度设置和量化目标组合。 • 性能提升:通过实验数据拟合,验证了缩放定律的有效性,并与现有缩放定律进行了比较。 • 对比结果:与现有缩放定律相比,该缩放定律在低精度训练设置下具有更好的预测性能。
问题4:这个研究的实际应用价值是什么?
• 应用场景:该缩放定律可用于指导未来低精度LLM训练,优化模型性能和计算效率。 • 实施建议:根据缩放定律,选择合适的浮点量化精度和配置,以实现最优的成本效益。 • 局限与展望:未来将进一步验证缩放定律在更大模型和数据规模下的适用性,并探索其他低比特LLM量化方法。