The Curse and Blessing of Mean Bias in FP4-Quantized LLM Training
Authors: Hengjie Cao, Zhendong Huang, Mengyi Chen, Yifeng Yang, Fang Dong, Anrui Chen, Ruijun Huang, Xin Zhang, Mingzhi Dong, Yujiang Wang, Jinlong Hou, Qin Lv, Robert P. Dick, Yuan Cheng, Tun Lu, Fan Yang, Yixuan Chen, Li Shang
Organizations: Fudan University · Shanghai Innovation Institute · University of Bath · University of Oxford · Oxford Suzhou Centre for Advanced Research · University of Colorado Boulder · University of Michigan · Shenzhen Loop Area Institute
FP4 training promises substantial memory and compute savings for large language models, but remains fragile because blockwise quantization is dictated by extreme activation magnitudes, which inflate dynamic range and compress long-tail signals. We identify a counterintuitive source of this failure: dominant activation outliers are not merely arbitrary sparse events, but are largely induced by a coherent rank-one mean bias, whose direction aligns with the leading anisotropic spectral component. This mean component strengthens during training, is amplified and reshaped by attention and FFN operators, and increasingly dominates top activation magnitudes. Crucially, this discovery reveals that a seemingly complex outlier-suppression problem admits a truly simple solution: isolate the coherent mean before quantization. We therefore propose Averis, a mean-residual splitting quantization method that separates the mean component using only reductions and elementwise subtractions before FP4 quantization. Across Qwen3 0.6B Dense trained on 100B tokens and Qwen3 7B A1.5B MoE trained on 50B tokens, Averis enables robust W4A4G4 FP4 training, reducing BF16 loss gaps to 1.19%/0.81% versus 2.05%/1.10% for NVIDIA's recently released Hadamard-based outlier-smoothing method, while limiting downstream gaps to 0.89/0.71 points. With only 2.20% end-to-end overhead over vanilla NVFP4, about 30% of NVIDIA's Hadamard-based design, Averis provides a hardware-efficient path to stable low-bit LLM training. Complementary to Hadamard, Averis further reduces the Qwen3-0.6B loss and downstream gaps to 0.94% and 0.73 points when combined. Code is available at: https://anonymous.4open.science/r/averis-504D.
Figures & tables
Figure 1: Mean-bias evidence in layer-27 FFN-input activations of Qwen3-0.6B at step 170k. (A) A dominant leading singular value indicates strong anisotropy. (B) Token-wise cosine similarities stay mostly positive along the mean direction but are weaker and more mixed along a non-leading direction. (C) The mean vector aligns most strongly with the top right singular vector.
Figure 2: Evolution of mean bias across depth and training in Qwen3-0.6B activations. Left: the normalized mean-bias ratio R increases with training step. Right: the growing mean component remains tightly aligned with the dominant anisotropic direction.
Figure 3: Operator-level evidence for mean-bias amplification. We compare the evolution of mean-bias strength and mean-direction alignment across key operators, showing that nonlinear Transformer components further strengthen the coherent mean component during forward propagation.
Figure 4: Histograms of activation outlier mean and residual contribution shares (top 0.1% entries) across layers and training steps.
Figure 5: Empirical validation of the marginal Gaussian residual assumption. Raw activations deviate from Gaussianity, while residuals are much closer to a Gaussian fit in both density and QQ plots.
Figure 6: Training-loss curves across model scales. Left: Qwen3-0.6B. Right: Qwen3-7B-A1.5B. We compare BF16, vanilla NVFP4, NVFP4-Hadamard, Averis, and Averis-Hadamard.
Method
Loss
Loss Gap
ArcC
ArcE
HellaSwag
LAMBADA
PIQA
RACE
Avg
Qwen3-0.6B
BF16
2.780
–
28.92
53.37
49.83
47.76
71.00
55.31
51.03
NVFP4
2.855
2.70%
27.73
52.48
48.15
44.93
69.80
55.55
49.77
NVFP4-Hadamard
2.837
2.05%
27.56
52.99
48.51
45.78
70.02
55.45
50.05
Averis
2.813
1.19%
29.44
53.66
48.15
44.44
69.64
55.49
50.14
Averis-Hadamard
2.806
0.94%
28.92
52.86
48.43
46.96
70.02
54.60
50.30
Table 1: Training loss and downstream performance comparison on Qwen3-0.6B and Qwen3-7B-A1.5B. Loss gap denotes the relative loss increase over BF16. Downstream results are reported in percentage points. BF16 is shown as the full-precision reference and separated from FP4 methods; bold numbers indicate the best result among FP4 methods within each model block.
Shape (l,m)
Method
Mean
Std
Speedup
(512×2048,4096)
Tiled Hadamard
9.1614
0.0128
–
(512×2048,4096)
Averis
2.0494
0.0021
4.47×
(512×2048,8192)
Tiled Hadamard
18.8421
0.0103
–
(512×2048,8192)
Averis
3.9927
0.0028
4.72×
Table 2: Runtime overhead comparison between tiled Hadamard preprocessing and Averis mean extraction on large activation shapes. Latencies are reported in milliseconds. Speedup is computed from mean latency as THadamard/TAveris .
Setting
Qwen3-0.6B (ms)
0.6B Overhead
Qwen3-7B-A1.5B (ms)
7B Overhead
NVFP4
5545.30
–
24852.04
–
Averis
5656.80
2.01%
25398.78
2.20%
NVFP4-Hadamard
5922.38
6.80%
26744.92
7.62%
Table 3: End-to-end training-step latency on Blackwell GPUs for Qwen3-0.6B and Qwen3-7B-A1.5B.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7: Additional mean-bias visualization for layer 0 at training step 10k. The leading spectral spike, predominantly one-sided token alignment to the mean direction, and strong mean–top-singular-vector alignment are already visible at an early checkpoint.
Figure 8: Additional mean-bias visualization for layer 0 at training step 170k. Compared with the early checkpoint, the same qualitative structure persists and the coherence of the mean component becomes stronger.
Figure 9: Additional mean-bias visualization for layer 27 at training step 170k. The phenomenon is especially pronounced in this deep late-stage activation, matching the strongest regime discussed in the main text.
Figure 10: Empirical validation of the diagonal variance approximation. The diagonal spectral estimate closely matches the empirical residual variance, and cross-mode covariance terms contribute little to the total variance.
Figure 11: Raw-versus-residual value distributions at the 170k checkpoint for a shallow layer and a deep layer. In both cases, subtracting the feature-wise mean contracts the high-magnitude tail, with the effect becoming especially pronounced in the deep late-stage activation.
Figure 12: Three-panel visualization of a representative output-gradient matrix. Compared with activations, the mean-bias structure is weaker: spectral dominance is milder, token-wise alignment to the mean direction is less one-sided, and the mean vector is less sharply aligned with the top right singular vector. Even so, mean centering still yields a slight reduction in NVFP4 quantization error.
Why does full-pipeline FP4 training of large language models often diverge, even when forward activations and activation gradients remain stable? We address this question through a controlled study of MXFP4 quantization in transformer training, progressively enabling FP4 across forward propagation (Fprop), activation gradients (Dgrad), and weight gradients (Wgrad) while holding all other factors fixed. In full pretraining of Llama 3.1-8B on the C4 dataset, we observe that quantizing Wgrad is the primary driver of convergence degradation, whereas FP4 in Fprop and Dgrad alone introduces only modest additional token requirements. To interpret this behavior, we evaluate both structured and stochastic interventions under a controlled experimental setting. We find that stochastic rounding and randomized Hadamard rotations fail to stabilize training once Wgrad is quantized, whereas deterministic Hadamard rotations consistently restore stable optimization. These results suggest that FP4 training instability is driven by structured micro-scaling errors along sensitive gradient paths, rather than by insufficient stochasticity. We run experiments with native MXFP4 support on AMD Instinct MI355X GPUs, enabling controlled investigation of these effects without reliance on software emulation.
Musa Cim, Poovaiah Palangappa, Miro Hodak +3
1The Pennsylvania State University · 2Advanced Micro Devices, Inc.
Reducing training precision is a key lever for improving the e ciency of large language model (LLM) training, but pushing beyond FP8 to 4-bit oating point (FP4) remains challenging due to instability during optimization. We identify a fundamental source of this instability in existing microscaling approaches: scale inconsistency induced by tensor transposition. In conventional 1D block quantization, forward and backward passes assign di erent scaling factors to the same values after transposition, leading to biased and unstable gradient updates. To address this issue, we propose a low-precision training framework based on 2D block FP4 quantization, which enforces transposition-invariant scaling and preserves consistency between forward and backward computations. We further combine this with truncation-free scaling and stochastic rounding to control quantization error and maintain unbiased gradients. To handle the sensitivity of attention mechanisms, we adopt MXFP8 quantization for query and key projections, yielding a practical mixed-precision design. We evaluate our method on dense LLMs up to 7B parameters and a 30B Mixture-of-Experts model, trained on up to 100B tokens. Across all settings, our approach achieves stable end-to-end FP4 training and closely matches BF16 performance, with less than 1.3% degradation in perplexity and downstream accuracy. These results demonstrate that enforcing forwardbackward scaling consistency is su cient to enable practical FP4 training at scale, providing a simple and e ective pathway toward more e cient LLM training.
Mehdi Rahimifar, Amin Darabi, Mehran Taghian Jazi +6
Low-bit floating-point formats and semi-structured sparsity are increasingly supported by modern accelerators, yet combining them for LLM activation compression remains challenging: activations contain input-dependent outliers that dominate block scales in FP4 quantization, and directly applying N:M sparsity masks discards moderate values, coupling sparsification loss with quantization error. We introduce SharQ, a training-free inference method that bridges activation sparsity and FP4 quantization through an online sparse--dense decomposition. For each activation tensor, SharQ generates an input-adaptive N:M mask to extract an outlier-dominated sparse backbone, quantizes it to FP4, and defines a dense residual relative to the quantized sparse backbone rather than the unquantized sparse values. A sparse FP4 GEMM processes the backbone while a dense FP4 GEMM compensates for both mask-induced activation loss and sparse-path quantization error. The two paths share a single FP4 weight payload with path-specific scale views, and a fused preparation kernel absorbs mask generation, residual construction, and layer normalization into one operator. SharQ requires no calibration data, retraining, or model-specific tuning. Evaluated on Llama-3.1-8B, Qwen2.5-7B, Qwen3-30B-A3B, and Qwen3-VL-8B, SharQ recovers 43--63% of the NVFP4-to-FP16 accuracy gap across language and vision-language tasks, and generalizes across NVFP4, HiF4, and MXFP4 formats. On an RTX 5090, SharQ delivers 2.2--2.4× latency reduction over FP16 and 1.2--1.4× throughput improvement over FP8 in language model serving, and up to 1.58× speedup on Wan2.2-T2V-A14B video generation when combined with SageAttention. Our code is available at https://github.com/actypedef/SharQ.
Haoqian Meng, Yilun Luo, Yafei Zhao +4
School of Computer Science and Technology, Tianjin University