FP4 All the Way: Fully Quantized Training of LLMs

Brian Chmiel, Maxim Fishman, Ron Banner, Daniel Soudry

TL;DR

This paper presents the first successful end-to-end Fully Quantized Training (FQT) of a 7-billion-parameter LLM using 4-bit floating-point (FP4) precision for weights, activations, and gradients. By optimizing micro-scaled formats, introducing a split rounding strategy, and leveraging a brief quantization-aware finetuning phase, the authors achieve downstream task performance on par with a standard BF16 baseline.

What Problem Does This Paper Address?

As Large Language Models (LLMs) scale to hundreds of billions of parameters, the computational power and memory bandwidth required to train them have become massive bottlenecks. While 8-bit floating-point (FP8) precision is rapidly becoming the industry standard to alleviate these costs, pushing the boundary down to 4-bit precision (FP4) promises even greater hardware efficiency and memory savings.

However, training entirely in FP4 is notoriously difficult. The extremely limited dynamic range of 4-bit representations typically introduces massive quantization errors and training instability. Previous attempts at FP4 training either quantized only parts of the pipeline (e.g., keeping gradients in higher precision) or required complex, high-overhead workarounds like residual sparse matrices. This paper tackles the challenge of fully quantized training—accelerating all three core matrix multiplications (GEMMs) involved in training (forward, backward, and update passes) in FP4 without sacrificing final model quality.

Methods

The authors systematically explore the FP4 design space and introduce three key innovations to stabilize training:

  1. Format Optimization: They evaluate various micro-scaled floating-point configurations to find the best exponent-mantissa split. They demonstrate that the NVFP4 format—an E2M1 data representation where blocks of 16 values share an E4M3 scale factor—provides the optimal balance between dynamic range and precision.
  2. Split Rounding Strategy: Instead of using a single rounding mode throughout the pipeline, the authors deploy a hybrid approach. They use deterministic Round-to-Nearest (RtN) for the forward pass to maintain stability, and Stochastic Rounding (SR) for the backward and update passes (specifically on neural gradients and update activations) to eliminate quantization bias.
  3. Precision Transition Analysis & QAF: The authors derive a theoretical threshold showing that FP4 training stalls when the full-precision gradient standard deviation drops below $\sqrt{3}$ times the quantization noise standard deviation. To overcome this stagnation, they introduce a brief Quantization-Aware Finetuning (QAF) phase at the very end of training, keeping the forward pass in FP4 (ensuring inference compatibility) but switching the backward pass to BF16 to boost the signal-to-noise ratio.

Datasets

  • Pre-training: The models were trained from scratch on the open-source Red Pajama dataset, scaling up to 1 trillion tokens for the primary 7B parameter model evaluation.
  • Evaluation: The final model was evaluated across a wide suite of standard zero-shot downstream benchmarks, including HellaSwag, Winogrande, BoolQ, Arc-Challenge, PiQA, Lambada, GPQA, If Eval, MBPP, TrivialQA, and XSum, alongside WikiText perplexity.

Key Insights and Ideas

  • Hardware Validation: The finding that a block size of 16 with an E4M3 scale format performs best directly validates the architectural choices NVIDIA made for its new Blackwell GPU architecture. The authors show that block sizes smaller than 16 yield diminishing returns relative to their hardware overhead.
Figure 1: Formats E4M3 (used in NVFP4) and E3M4 achieved the best results. Comparison of different scaling formats (E1M6, E2M5, E3M4, E4M3, E5M2, E6M1, E8M0) when training a 350M Llama model using FP4 format (E2M1) with block size 16. The formats E3M4 and E4M3 achieve the best results (recall E4M3 is used in NVFP4), whereas E1M6 results in complete divergence.
Figure 2: Block size 16 is the best option. We examine the impact of different block sizes (8, 16, 32, 64, 128) on training accuracy using scaling formats: (a) E8M0 (used in MXFP4) and (b) E4M3 (used in NVFP4). Smaller block sizes yield modest improvements in accuracy, with diminishing returns below 16 elements per block. Thus, a block size of 16 provides an optimal compromise between performance and computational overhead.
  • Bias is the Real Enemy: Deterministic rounding (RtN) in the gradient updates introduces a persistent bias that creates an irreducible error floor, halting convergence. Stochastic rounding acts as zero-mean noise, allowing the optimizer to continue descending even under aggressive 4-bit quantization. However, applying SR everywhere hurts; keeping RtN in the forward pass is crucial for stability.
Figure 3: Comparison of different rounding schemes when training a 350M Llama model using NVFP4 format. In each graph, we apply SR in one of the six elements in one of the GEMMs while the rest use round-to-nearest (RtN). Notice that applying SR to neural gradients during both ‘Update’ and ‘Backward’ GEMMs and activations during the ‘Update’ GEMM leads to lower training loss, while applying SR to other components has the opposite effect, increasing the loss.
  • The $\sqrt{3}$ Stagnation Point: The mathematical derivation of the critical gradient-to-noise ratio ($\sqrt{3}$) provides a principled explanation for why ultra-low precision training runs stall out. It shifts the conversation from heuristic tuning to predictable precision scheduling, telling practitioners exactly when they need to transition to a QAF phase.

Key Results

  • End-to-End Scale: The authors successfully trained a 7B parameter Llama-style model on 1 trillion tokens using 256 Intel Gaudi2 accelerators.
  • Closing the Gap: While pure FP4 training left a small loss gap compared to the BF16 baseline, the brief QAF phase (representing only 4% of total training tokens) completely closed it.
  • Downstream Parity: On downstream tasks, the final FP4+QAF model achieved an average zero-shot accuracy score of 45.75%, performing on par with (and slightly outperforming) the 1.04T token BF16 baseline average of 45.13%.

Limitations and Future Work

  • Hardware Simulation Overhead: Because current Intel Gaudi2 hardware lacks native FP4 support, the authors conducted their experiments using FP4 simulations via precision casting. This incurred additional overhead and lengthened runtimes. The actual hardware speedup remains an estimate (projected at ~85% time-to-train acceleration compared to a BF16 baseline based on prior FP8 benchmarks).
  • Architecture Scope: The large-scale evaluation focused strictly on the LLaMA architecture. While the authors note that preliminary experiments show promise for Mixture-of-Experts (MoE) architectures, extensive validation on MoE variants and vision models is left for future work.

Summary updated

BibTeX
@inproceedings{chmiel2025fp,
  author = {Brian Chmiel and Maxim Fishman and Ron Banner and Daniel Soudry},
  title = {{FP4 All the Way: Fully Quantized Training of LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=kuzye4EPLR},
}
Figure