Abstract
Training state-of-the-art Large Language Models (LLMs) requires immense computational resources, often involving thousands of GPUs running for months. While 8-bit (FP8) training has become an industry standard to mitigate these costs, 4-bit (FP4) training has historically been unstable due to limited representational capacity. This paper presents a novel framework that enables successful training of LLMs from scratch using FP4 quantization. By introducing a Differentiable Gradient Estimator (DGE) and an Outlier Clamping and Compensation (OCC) strategy, the researchers achieve training stability and accuracy parity with 16-bit (BF16) baselines for models up to 13 billion parameters.
Introduction
The computational demand for training frontier models like Llama 3 405B—which required 16,000 H100 GPUs—has pushed the industry toward lower-precision arithmetic. Quantization reduces the bit-width of numerical representations, thereby decreasing memory bandwidth requirements and increasing throughput. However, moving from FP8 to FP4 is exceptionally difficult. An FP4 format can represent only 16 distinct values, leading to significant information loss when using standard quantization techniques.
This research addresses two primary failure modes in 4-bit training: gradient vanishing and activation collapse. Through architectural innovations in the training loop, the authors demonstrate that FP4 is not only viable but can match the performance of high-precision formats.
Challenges in 4-Bit Training
1. The Failure of the Straight-Through Estimator (STE)
In quantized training, the gradient of the non-differentiable quantization function is typically approximated as 1 (the STE approach). While effective at 8-bit, this approximation becomes too coarse at 4-bit. The discrepancy between the actual function and the estimator leads to inaccurate weight updates, causing the training process to stall or diverge.
2. Activation Outliers
LLM activations are characterized by "spiky" distributions where a small number of values are significantly larger than the rest. In a 4-bit regime, these outliers force the scaling factor to such high levels that the majority of standard values are rounded to zero. This "activation collapse" effectively destroys the model's internal signal flow.
Proposed Methodology
To overcome these barriers, the framework introduces two key technical components:
Differentiable Gradient Estimator (DGE)
Instead of relying on the coarse STE, DGE utilizes a differentiable approximation of the quantization step. This creates a "correction term" during backpropagation, allowing for more precise and nuanced weight updates. By smoothing the gradient flow, DGE ensures that the model continues to learn even within the constraints of a 16-value representational space.
Outlier Clamping and Compensation (OCC)
The OCC strategy targets the systematic nature of activation outliers. Research indicates that these outliers often appear in specific channels. OCC identifies the top 0.1% of extreme values and clamps them to a lower threshold to prevent them from distorting the scaling factor for the rest of the tensor. To preserve the information contained in these outliers, they are stored and processed in a high-precision sparse auxiliary matrix. This hybrid approach allows the bulk of the computation to benefit from FP4 speeds while maintaining the integrity of critical signals.
Quantization Format
The framework utilizes the E2M1 format (2 bits for the exponent, 1 for the mantissa). It employs vector-wise quantization—specifically token-wise for activations and channel-wise for weights—to maintain the necessary granularity for deep learning tasks.
Experimental Results
The researchers validated the framework using the DCLM dataset for pretraining and a comprehensive suite of downstream benchmarks, including Arc, BoolQ, HellaSwag, and PiQA.
Accuracy and Scaling
The method was tested across various scales, including 400M, 1.3B, 7B, and 13B parameter models. Notably, the 13B parameter LLaMA model trained in FP4 achieved an average zero-shot accuracy of 54.95%, slightly exceeding the BF16 baseline of 54.44%. This confirms that the proposed methods successfully mitigate the precision loss inherent in 4-bit representations.
Efficiency Gains
While current NVIDIA H100 hardware does not feature native FP4 tensor cores (requiring the researchers to emulate FP4 using FP8), the theoretical benefits are substantial. The authors calculate a theoretical speedup of 2.95x compared to FP32-based logic, even when accounting for the computational overhead of the DGE and OCC modules.
Conclusion and Future Work
This work demonstrates that the "4-bit barrier" in LLM training can be overcome through better gradient estimation and specialized handling of activation outliers. The success of the 13B parameter model suggests that FP4 could become the next standard for efficient large-scale training.
However, limitations remain. Native hardware support for FP4 is required to realize actual wall-clock time improvements, a feature expected in next-generation architectures like NVIDIA's Blackwell. Additionally, future research is needed to determine if these techniques scale to "frontier-class" models exceeding 100B parameters and how they interact with Mixture-of-Experts (MoE) architectures.
Summary updated