TL;DR
Training foundation models in 4-bit floating point (FP4) promises a 2× throughput boost over FP8, but existing stabilization tricks often introduce heavy hidden computational overheads. This paper presents the first unified, gradient-based framework to systematically evaluate the performance-versus-overhead trade-offs of FP4 training across thousands of configurations. The authors discover that simple, hardware-fusable techniques—specifically Hadamard transforms, global tensor scaling, and stochastic rounding—reliably outperform complex gradient adjustments.
What Problem Does This Paper Address?
As foundation models scale into hundreds of billions of parameters, training becomes bottlenecked by memory bandwidth and matrix multiplication throughput. While halving precision to FP8 is now standard practice, pushing down to FP4 is the next frontier.
However, standard FP4 training quickly suffers from numerical instability, underflow, and outlier-induced precision loss. Recent literature has proposed various fixes: low-rank singular value decomposition (SVD), custom gradient approximations, and outlier-smoothing transformations. Unfortunately, these solutions have largely been developed in silos, tested only on isolated components (such as quantizing only weights or only gradients), and evaluated without factoring in computational overhead. Many proposed techniques add non-fusable $\mathcal{O}(n)$ or $\mathcal{O}(nk)$ operations that erase the hardware speedups FP4 is meant to deliver.
Methods
The authors introduce a rigorous, unified framework for microscaling (MX) quantization. In MX formats, tensors are partitioned into small blocks ($l$ elements) sharing a common scaling factor. Using this framework, the authors derive exact partial derivatives through the quantization and scale-factor transformations, cataloging the computational overhead and memory footprint of various techniques.
Across thousands of simulated configurations, they evaluate:
- Gradient Approximations: Straight-Through Estimators (STE) versus continuous approximations (piecewise linear splines and fractional power curves) for activation and scale gradients (Absmax, Softmax, and Hybrid).
- Scaling Strategies: Block-wise scaling versus two-level global tensor scaling (normalizing the whole tensor prior to block scaling).
- Scale Numerical Formats: Comparing standard formats like MXFP4 (with 8-bit scale
E8M0) and NVFP4 (withE4M3scale) against an alternative format,UE5M3(5 exponent bits, 3 mantissa bits). - Rounding Strategies: Round-to-nearest (RTN) versus stochastic rounding (SR) applied to forward activations, backward gradients, and scale factors, alongside subnormal rounding for zero/underflow handling.
- Outlier Mitigation & Optimizers: Block-wise random Hadamard transformations (fusable via GPU warp shuffles) to spread outlier energy, combined with standard Adam or bounded-momentum optimizers (StableSPAM).
Datasets
The authors benchmarked across a diverse suite of workloads:
- Synthetic Regression: Gaussian regression.
- Vision: MNIST, CIFAR-10, and ImageNet-100 image classification.
- Generative Diffusion: Small and large U-Net diffusion models.
- Language Modeling: Llama architectures ranging across scales: 9M, 60M, 350M, and 1B parameters.
Note: No new datasets were introduced; standard open-source benchmarks were used.
Key Insights and Ideas
The authors distill their extensive sweep into three core guiding principles:
- 1. Gradient Stability Outweighs Unbiasedness: Complex, "exact" scale and quantizer gradients (such as the gradient of absmax) concentrate updates onto a single element per block. This introduces high variance that destabilizes momentum-based optimizers like Adam. In contrast, the classic Straight-Through Estimator (STE) provides a dense, stable update with zero computational overhead, consistently outperforming intricate approximations.
- 2. Scale Representation is the Primary Bottleneck: NVFP4 (
E4M3scale) repeatedly failed to converge on language models at and above 350M parameters because its exponent range is too narrow, even with tensor scaling. Meanwhile, MXFP4 (E8M0) has abundant range but zero mantissa bits, sacrificing precision. The authors identifyUE5M3as an ideal middle ground, delivering superior language modeling performance when paired with tensor scaling and backward stochastic rounding. - 3. The Performance-Overhead Frontier is Sparse: Adding complexity quickly brings diminishing returns. Heavy, non-fusable operations like SVD or dense softmax scaling gradients waste memory and compute. A minimal recipe of fusable operations—Hadamard transformations, tensor scaling, and stochastic rounding—captures nearly all the stability benefits without killing runtime throughput.
Key Results
- Efficiency Frontier: Evaluated via a Pareto efficiency score balancing validation loss against complexity points, minimal configurations consistently beat highly engineered pipelines.
- Language Models (Llama 350M & 1B): Standard NVFP4 failed to match baseline convergence due to scale underflow/overflow. However, MXFP4 with Hadamard transformation, global tensor scaling, and stochastic rounding successfully stabilized training.
- Format Exploration: The proposed
UE5M3scale factor consistently outperformed the standardE8M0scale on Llama models when backward SR and global scaling were active.
Limitations and Future Work
- Simulation vs. Native Silicon: Experiments were conducted using high-precision emulation (BFLOAT16/PyTorch simulator) because production hardware with complete, end-to-end native FP4 training pipelines is not yet widely available.
- Scale Inconsistencies: The authors observe that FP4 training dynamics shift noticeably as models grow from toy scales to 1B parameters, meaning conclusions drawn on sub-billion models may still require validation on 7B+ scale foundation models.
- Future Directions: Developing dedicated, fusable GPU kernels for Hadamard transforms paired with custom scale formats like
UE5M3.
Summary updated