FP4 All the Way: Fully Quantized Training of Large Language Models

Brian Chmiel, Maxim Fishman, Ron Banner, Daniel Soudry

Overview

This paper presents the first successful demonstration of Fully Quantized Training (FQT) for Large Language Models using 4-bit floating-point (FP4) precision for weights, activations, and gradients. By combining a specific "NVFP4" format with a clever split-rounding strategy and a brief high-precision "polish" phase, the researchers trained a 7B parameter model that matches the performance of standard 16-bit (BF16) baselines while promising massive gains in computational efficiency.

The Challenge of 4-bit Training

Training state-of-the-art LLMs is an exercise in managing massive resource bottlenecks. While the industry has recently moved from 16-bit (BF16) to 8-bit (FP8) training to save memory and speed up compute, the "holy grail" is to push even lower.

The challenge with 4-bit training is precision collapse. At 4 bits, the dynamic range (the distance between the smallest and largest representable numbers) and the precision (the "gap" between numbers) are extremely limited. Previous attempts at 4-bit training usually kept the gradients in higher precision or relied on complex "outlier" management. This paper tackles the "Full" in Fully Quantized Training: making 4-bit work for every major matrix multiplication in the training loop without sacrificing the final model's intelligence.

Methods for Stable FP4 Training

The authors introduce several key innovations to make FP4 training stable:

  1. Optimized Format (NVFP4): They found that the best configuration uses the E2M1 format (1 sign bit, 2 exponent bits, 1 mantissa bit) for data, grouped into blocks of 16 values that share a single 8-bit scale factor (E4M3). This "microscaling" allows the hardware to adapt to different ranges of values across the network.
  2. Split Rounding Strategy: They discovered that different parts of the training loop prefer different rounding math. They use Round-to-Nearest (RtN) for the forward pass to maintain stability and Stochastic Rounding (SR) for the backward and update passes. SR is crucial because it is "unbiased"—on average, it points in the right direction, preventing the model from getting stuck due to quantization errors.
Effect of different rounding strategies on training loss. Applying Stochastic Rounding (SR) to backward and update passes improves over Full Round-to-Nearest (RtN), while applying it to the forward pass degrades performance.
  1. Quantization-Aware Fine-tuning (QAF): Toward the very end of training, the authors switch the backward pass to BF16 for a brief period (about 4% of the total tokens). This "closes the gap" created by the noise inherent in 4-bit gradients.

Key Insights and Ideas

  • The $\sqrt{3}$ Threshold: This is the paper's most significant theoretical contribution. The authors derived a mathematical "critical point": when the gradient signal falls below roughly $\sqrt{3}$ times the quantization noise, training progress stalls. This provides a principled way to know exactly when 4-bit precision is no longer enough and when to trigger the QAF phase.
  • Block Size Sweet Spot: While smaller blocks (sharing a scale factor among fewer numbers) are more accurate, the authors found diminishing returns below a block size of 16. This validates the hardware design choices made in modern architectures like NVIDIA’s Blackwell.
Training loss across different block sizes. Diminishing returns are observed for block sizes smaller than 16, validating it as an optimal sweet spot for efficiency and accuracy.
  • Gradients are the Hardest: The study confirms that while weights and activations are relatively easy to quantize, gradients are highly sensitive. Stochastic rounding is the "secret sauce" that allows these noisy 4-bit gradients to still provide useful updates to the model.

Key Results

  • Parity with BF16: A 7B Llama-style model trained with the FP4 pipeline achieved an average score of 45.75% across downstream tasks (including HellaSwag, Winogrande, PiQA, and others), slightly outperforming the BF16 baseline of 45.63%.
  • Efficiency Gains: While the experiments were simulated on Intel Gaudi2 hardware (which doesn't have native FP4 support yet), the authors estimate that native FP4 execution would be ~35-40% faster than FP8 and roughly 85% faster than BF16.
  • Stability at Scale: The method proved stable over 1 trillion tokens on the Red Pajama dataset, a significant jump from prior academic work that usually stopped at 100 billion tokens or smaller models.

Limitations and Future Work

  • Hardware Gap: The biggest limitation is that current-generation hardware does not natively support FP4 matrix multiplication. The results are based on simulations that incur a software overhead. The true speed benefits will only be realized on next-gen chips.
  • Architecture Specifics: The work focused on the Llama (Transformer) architecture. While the authors believe the logic holds for other architectures like Mixture-of-Experts (MoE), they haven't yet published large-scale results for those or for vision-based models.
  • The "Brief" QAF: While the QAF phase is short, it still requires switching to higher precision. Future work might look for ways to eliminate this phase entirely through even more advanced rounding or scaling techniques.

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 Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=kuzye4EPLR},
}
Figure