Abstract
Large Language Model (LLM) pre-training is computationally intensive, driving interest in low-precision formats to reduce energy and time costs. While 8-bit floating-point (FP8) is gaining traction, 4-bit (FP4) training remains challenging due to numerical instability and quantization errors. This paper presents a mixed-precision FP4 pre-training framework that selectively applies higher precision to sensitive components and introduces a two-stage training schedule. Results demonstrate that this approach reduces theoretical compute costs by approximately 30% while maintaining performance parity with standard 16-bit training across various model scales.
Introduction
The computational demands of pre-training Large Language Models (LLMs) have led to a shift toward low-precision numerical representations. While FP8 is becoming an industry standard, pushing precision down to 4-bit (FP4) has historically resulted in training instability and performance degradation. This paper addresses these challenges by identifying the specific sensitivities of Transformer components to quantization noise and proposing a robust mixed-precision recipe that balances efficiency and accuracy.
The Challenges of FP4 Training
FP4 offers a severely restricted numerical range, leading to two primary issues: underflow and attention collapse. As training progresses, gradient values naturally diminish; in FP4, a significant portion of these gradients (approximately 8.6% of weight gradients and 18% of activation gradients) round to zero, a phenomenon known as underflow that halts the learning process. Furthermore, the Multi-Head Attention (MHA) mechanism is highly sensitive to quantization errors. Under pure FP4 training, attention scores tend toward a uniform distribution, preventing the model from learning meaningful token relationships and crippling convergence.
Proposed Methodology
The authors introduce a three-pronged strategy to stabilize FP4 training by identifying which parts of the model can handle 4-bit math and which require higher precision:
- Attention Protection: To preserve the integrity of the attention mechanism, Query, Key, Value (QKV) and output projections are maintained in FP8 precision.
- Gradient-Sensitive FFN Quantization: Since Feed-Forward Networks (FFNs) represent approximately 57% of total compute, they are targeted for FP4 in the forward pass using a per-block quantization strategy. However, to mitigate underflow in the backward pass, weight gradients are computed in FP8 and activation gradients in FP16.
- Target Precious Training Schedule: A two-stage schedule is employed where the model is trained in FP4 for the majority of the duration (90-95%), followed by a brief high-precision (FP16) recovery phase to "wash out" accumulated quantization noise and return the model to an ideal state.
Experimental Results
The methodology was validated on GPT-2 and LLaMA architectures ranging from 125M to 1B parameters. The proposed FP4-2-stage approach consistently matched the validation loss, WikiText perplexity, and GLUE benchmark performance of FP16 baselines.
A key finding was the necessity of the "Target Precious" recovery phase; without the final 5-10% FP16 training, models suffered a noticeable penalty, such as a 6.3-point increase in WikiText perplexity. By selectively using FP4 in FFN layers, the method achieves a theoretical reduction of computational costs by roughly 30% compared to standard FP16 training.
Conclusion and Future Work
This work demonstrates that FP4 pre-training is viable and efficient when combined with selective precision and a strategic training schedule. While currently limited to simulated hardware and models up to 1B parameters, the findings provide a clear path toward more sustainable LLM development. Future work will focus on hardware-native implementations on next-generation architectures and scaling the methodology to massive, state-of-the-art LLMs with 70B+ parameters.
Summary updated