Pretraining Large Language Models with NVFP4
Authors: name: NVIDIA, name: Felix Abecassis, name: Anjulie Agrusa, name: Dong Ahn, name: Jonah Alben, name: Stefania Alborghetti, name: Michael Andersch, name: Sivakumar Arayandi, name: Alexis Bjorlin, name: Aaron Blakeman, name: Evan Briones, name: Ian Buck, name: Bryan Catanzaro, name: Jinhang Choi, name: Mike Chrzanowski, name: Eric Chung, name: Victor Cui, name: Steve Dai, name: Bita Darvish Rouhani, name: Carlo del Mundo, name: Deena Donia, name: Burc Eryilmaz, name: Henry Estela, name: Abhinav Goel, name: Oleg Goncharov, name: Yugi Guvvala, name: Robert Hesse, name: Russell Hewett, name: Herbert Hum, name: Ujval Kapasi, name: Brucek Khailany, name: Mikail Khona, name: Nick Knight, name: Alex Kondratenko, name: Ronny Krashinsky, name: Ben Lanir, name: Simon Layton, name: Michael Lightstone, name: Daniel Lo, name: Paulius Micikevicius, name: Asit Mishra, name: Tim Moon, name: Deepak Narayanan, name: Chao Ni, name: Abhijit Paithankar, name: Satish Pasumarthi, name: Ankit Patel, name: Mostofa Patwary, name: Ashwin Poojary, name: Gargi Prasad, name: Sweta Priyadarshi, name: Yigong Qin, name: Xiaowei Ren, name: Oleg Rybakov, name: Charbel Sakr, name: Sanjeev Satheesh, name: Stas Sergienko, name: Pasha Shamis, name: Kirthi Shankar, name: Nishant Sharma, name: Mohammad Shoeybi, name: Michael Siu, name: Misha Smelyanskiy, name: Darko Stosic, name: Dusan Stosic, name: Bor-Yiing Su, name: Frank Sun, name: Nima Tajbakhsh, name: Shelby Thomas, name: Przemek Tredak, name: Evgeny Tsykunov, name: Gandhi Vaithilingam, name: Aditya Vavre, name: Rangharajan Venkatesan, name: Roger Waleffe, name: Qiyu Wan, name: Hexin Wang, name: Mengdi Wang, name: Lizzie Wei, name: Hao Wu, name: Evan Wu, name: Keith Wyss, name: Ning Xu, name: Jinze Xue, name: Charlene Yang, name: Yujia Zhai, name: Ruoxi Zhang, name: Jingyang Zhu, name: Zhongbo Zhu
Organization: NVIDIA

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.