用4比特精度训练大模型,效率提升且性能不降。
Pretraining Large Language Models with NVFP4
- 引入随机哈达玛变换和二维量化,稳定4比特训练
- 120亿参数模型在10万亿词上训练,损失与FP8相当
- 适合追求高效训练的大模型研究者
当前大语言模型(LLMs)的性能随模型规模、训练数据量和质量持续提升,但前沿模型训练需数十至数百千焦耳浮点运算,计算成本巨大。提升预训练效率对下一代更强模型至关重要。尽管8位浮点(FP8)已广泛采用,但进一步使用更窄的4位浮点(FP4)可提升计算速度与资源利用率。然而,低精度训练面临稳定性、收敛性与实现难题,尤其在长序列训练中。本文提出一种基于NVFP4格式的稳定高效训练方法:通过随机哈达玛变换(RHT)控制块级异常值,采用二维量化保证前向与反向传递一致性,结合随机舍入实现无偏梯度估计,并引入选择性高精度层。我们在10万亿令牌上训练了一个120亿参数模型——目前公开报道中最长的4比特精度训练。结果表明,该方法训练出的模型在训练损失和下游任务准确率上均与FP8基线相当。证明了结合本方法的NVFP4是窄精度大模型训练的重要进展。
原文摘要 · Abstract (English)
Large Language Models (LLMs) today are powerful problem solvers across many domains, and they continue to get stronger as they scale in model size, training set size, and training set quality, as shown by extensive research and experimentation across the industry. Training a frontier model today requires on the order of tens to hundreds of yottaflops, which is a massive investment of time, compute, and energy. Improving pretraining efficiency is therefore essential to enable the next generation of even more capable LLMs. While 8-bit floating point (FP8) training is now widely adopted, transitioning to even narrower precision, such as 4-bit floating point (FP4), could unlock additional improvements in computational speed and resource utilization. However, quantization at this level poses challenges to training stability, convergence, and implementation, notably for large-scale models trained on long token horizons. In this study, we introduce a novel approach for stable and accurate training of large language models (LLMs) using the NVFP4 format. Our method integrates Random Hadamard transforms (RHT) to bound block-level outliers, employs a two-dimensional quantization scheme for consistent representations across both the forward and backward passes, utilizes stochastic rounding for unbiased gradient estimation, and incorporates selective high-precision layers. We validate our approach by training a 12-billion-parameter model on 10 trillion tokens -- the longest publicly documented training run in 4-bit precision to date. Our results show that the model trained with our NVFP4-based pretraining technique achieves training loss and downstream task accuracies comparable to an FP8 baseline. These findings highlight that NVFP4, when combined with our training approach, represents a major step forward in narrow-precision LLM training algorithms.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。