迈向高效预训练:探索大语言模型中的FP4精度
Towards Efficient Pre-training: Exploring FP4 Precision in Large Language Models
AI总结:
针对大语言模型训练的高计算需求,提出基于Transformer架构的FP4训练方案,通过模块和阶段适配的混合精度量化策略保证训练稳定性,实现与BF16、FP8相当的精度且计算成本更低,为高效超低精度训练奠基。
摘要:
大语言模型(LLMs)训练激增的计算需求需要高效方法,包括量化训练——利用低位算术运算降低成本。尽管FP8精度已展现潜力,但FP4因固有量化误差和有限的表示能力仍具挑战。基于Transformer架构,我们提出一种LLMs的FP4训练方案,通过针对不同模块和训练阶段的混合精度量化策略克服这些障碍。这使我们能对模型内不同组件应用合适的精度级别,确保多头注意力和线性层得到恰当处理。我们的预训练方案通过结合细粒度量化方法与目标精度训练调度,保证反向传播的稳定性。实验结果表明,我们的FP4训练方案达到与BF16和FP8相当的精度,且理论计算成本更低。随着支持FP4的下一代硬件问世,我们的方法为高效超低精度训练奠定了基础。
英文摘要:
The burgeoning computational demands for training large language models (LLMs) necessitate efficient methods, including quantized training, which leverages low-bit arithmetic operations to reduce costs. While FP8 precision has shown potential, leveraging FP4 remains challenging due to inherent quantization errors and limited representation capability. Based on the Transformer architecture, we present an FP4 training scheme for LLMs, overcoming these obstacles through mixed-precision quantization strategies tailed for different modules and training stages. This allows us to apply the precision level suitable to distinct components within the model, ensuring that multi-head attention and linear layers are handled appropriately. Our pretraining recipe ensures stability in backpropagation by incorporating fine-grained quantization methods with a target precision training schedule. Experimental results demonstrate that our FP4 training scheme achieves accuracy comparable to BF16 and FP8, with smaller theoretical computational cost. With the advent of next-generation hardware supporting FP4, our method sets the foundation for efficient ultra-low precision training.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。