在原生 FP4 硬件上使用 MXFP4 预训练大语言模型
文章背景与核心概要
大语言模型(LLM)的全面 4 位浮点数(FP4)训练在实际操作中经常面临模型发散的问题,即便前向激活值和激活梯度保持稳定也是如此。为了破解这一技术难题,研究人员在 C4 数据集上对 Llama 3.1-8B 模型进行预训练时,利用 MXFP4 量化开展了对照实验,最终发现对权重梯度(Wgrad)进行量化是导致模型收敛恶化的主要根源。
为了探究背后的根本原因,研究团队测试了结构化和随机化干预手段。结果表明,当权重梯度被量化后,随机舍入(stochastic rounding)和随机阿达玛旋转(randomized Hadamard rotations)均无法稳定训练过程,而确定性阿达玛旋转(deterministic Hadamard rotations)则能够始终如一地恢复稳定的优化状态。这一发现证明了 FP4 训练的不稳定性源于敏感梯度路径上的结构化微缩放误差,而非缺乏随机性。更重要的是,所有这些洞察都在AMD Instinct MI355X GPU的原生 MXFP4 硬件支持下得到了验证,完全摆脱了对软件模拟的依赖。
论文元数据 (Paper Metadata)
- arXiv ID: arXiv:2605.09825 [cs.LG]
- 主要学科 (Primary Subject): 机器学习 (
cs.LG) - 次要学科 (Secondary Subject): 人工智能 (
cs.AI) - 作者 (Authors):
- Musa Cim
- Sarthak Arora
- Poovaiah Palangappa
- Miro Hodak
- Ravi Dwivedula
- Meena Arunachalam
- Mahmut Taylan Kandemir
- 提交日期 (Submission Date): 2026年5月11日 (v1),2026年8月12日最后修订 (v4)
- 许可证 (License): 知识共享署名 4.0

摘要 (Abstract)
为什么大语言模型的全流程 FP4 训练经常会发散,即使前向激活和激活梯度保持稳定也是如此?我们通过对 Transformer 训练中的 MXFP4 量化进行对照研究来解决这个问题,在保持所有其他因素不变的情况下,逐步在正向传播(Fprop)、激活梯度(Dgrad)和权重梯度(Wgrad)中启用 FP4。
Why does full-pipeline FP4 training of large language models often diverge, even when forward activations and activation gradients remain stable? We address this question through a controlled study of MXFP4 quantization in transformer training, progressively enabling FP4 across forward propagation (Fprop), activation gradients (Dgrad), and weight gradients (Wgrad) while holding all other factors fixed.
在 C4 数据集上对 Llama 3.1-8B 进行完整预训练时,我们观察到量化 Wgrad 是收敛退化的主要驱动因素,而仅在 Fprop 和 Dgrad 中使用 FP4 只会带来微不足道的额外 Token 需求。为了解释这种行为,我们在受控的实验设置下评估了结构化和随机化干预。我们发现,一旦量化 Wgrad,随机舍入和随机阿达玛旋转就无法稳定训练,而确定性阿达玛旋转始终能恢复稳定的优化。这些结果表明,FP4 训练的不稳定性是由敏感梯度路径上的结构化微缩放误差驱动的,而不是由随机性不足引起的。我们在 AMD Instinct MI355X GPU 上使用原生 MXFP4 支持运行了实验,从而能够在不依赖软件模拟的情况下对这些影响进行受控研究。
In full pretraining of Llama 3.1-8B on the C4 dataset, we observe that quantizing Wgrad is the primary driver of convergence degradation, whereas FP4 in Fprop and Dgrad alone introduces only modest additional token requirements. To interpret this behavior, we evaluate both structured and stochastic interventions under a controlled experimental setting. We find that stochastic rounding and randomized Hadamard rotations fail to stabilize training once Wgrad is quantized, whereas deterministic Hadamard rotations consistently restore stable optimization. These results suggest that FP4 training instability is driven by structured micro-scaling errors along sensitive gradient paths, rather than by insufficient stochasticity. We run experiments with native MXFP4 support on AMD Instinct MI355X GPUs, enabling controlled investigation of these effects without reliance on software emulation.