Full-Stack FP4: Stable LLM Pretraining with Quantized Projections, Optimizers, and Attention

Siyu Ding, Mingchuan Ma, Jiabo Tong, Xingrun Xing, Ziming Wang, Guoqi LiarXiv 2026

TL;DR

Full-Stack FP4 introduces a modular framework to enable stable, near-lossless LLM pretraining entirely utilizing 4-bit (NVFP4) precision across linear projections, optimizer states, and attention paths. By tailoring quantization strategies to the unique numerical structures of each module, it achieves a tiny 0.838% loss gap compared to BF16 on a 3B model, while delivering up to 2.83× optimizer speedups and over 40% memory savings on next-generation hardware like the RTX 5090.

What Problem Does This Paper Address?

As Large Language Models (LLMs) scale, the computational and memory costs of pretraining become massive bottlenecks. While moving from FP32 to BF16 and FP8 has yielded major efficiency gains, the community is now eyeing 4-bit quantization (specifically the hardware-native NVFP4 format supported by NVIDIA Blackwell GPUs) as the next frontier.

However, prior 4-bit pretraining methods focused almost exclusively on quantizing the weights and activations of standard linear layers. They left persistent optimizer states (like AdamW moments), optimizer computations, and attention layers in higher precision (BF16 or FP32). A uniform, "one-size-fits-all" 4-bit quantization rule fails because these modules have vastly different numerical properties. For instance, AdamW's second moment is non-negative and heavy-tailed, while attention layers contain highly softmax-sensitive paths. This paper tackles the challenge of creating a stable, fully 4-bit "full-stack" pretraining pipeline without destroying model convergence.

Methods

The authors propose Full-Stack FP4, a collection of independent and composable low-precision recipes designed for specific training modules:

  • LoRA-SVD Projections: To combat the issue of weakening gradient signals later in training, this method protects a compact principal subspace in BF16 using a mergeable low-rank adaptation (LoRA) structure, while leaving the dominant dense matrix multiplication in NVFP4. It uses a Cholesky-QR constraint and periodic randomized SVD realignment to keep the subspace optimized.
  • Quantized-State AdamW (Q-AdamW): Instead of directly quantizing the heavy-tailed second moment ($v_t$), the framework passes it through an ordered three-stage pipeline: a square root to shorten the distribution tail, a tile-mean subtraction to isolate the common positive component, and a 16-element Hadamard transform to smooth out localized outliers. The result is stably stored in NVFP4.
  • NVFP4 Root Optimizer (Q-Root): For matrix-valued updates (like the Muon or Root optimizers), the authors execute Newton-Schulz orthogonalization iterations directly in NVFP4 by introducing shape-dependent coefficients and $p99$ outlier clipping to prevent error amplification.
  • Mixed-Precision Attention (Q-Attn): Recognizing that full 4-bit attention degrades accuracy, the authors split the precision. They quantize the large matrix multiplications ($QK^\top$ and the backward pass $dS$ paths) to NVFP4, while keeping the softmax-sensitive operations ($PV$ and $dOV^\top$) in BF16.

An overview of how these components fit together in the Transformer block is illustrated below:

Figure 1: Full-Stack FP4 overview. LoRA-SVD protects a low-rank projection subspace; Q-AdamW compresses persistent momentum states; Q-Root executes eligible matrix updates through NVFP4 Newton–Schulz iterations; and Q-Attn assigns NVFP4 and BF16 to different attention paths. The recipes are independent and composable.

Datasets

  • Pretraining: The models were pretrained on a high-quality subset of the Nemotron-CC v2 dataset.
  • Evaluation: Downstream zero-shot capabilities were evaluated using standard benchmarks: WikiText (for perplexity), LAMBADA, ARC-Easy (ARC-E), ARC-Challenge (ARC-C), HellaSwag, and PIQA.

Key Insights and Ideas

  • Numerical Specialization is Mandatory: You cannot treat an optimizer state the same way you treat a weight matrix. Reshaping the numerical structure before quantization (e.g., taking the square root of the second moment) is what makes 4-bit optimization stable.
  • Order Matters for Quantization Pipelines: In Q-AdamW, subtracting the mean before applying the Hadamard transform prevents same-sign terms from constructively adding up into massive outliers.
  • Subspace Protection Extends FP4 Lifespans: As training progresses, gradient norms drop below the quantization noise floor. By dedicating a tiny fraction of parameters (via LoRA-SVD) to high precision, the model continues to learn effectively even when dense weights are heavily quantized. As seen in the error analysis below, LoRA-SVD consistently reduces relative mean squared error (MSE) across outputs and gradients throughout training:
Linear-projection error comparison between naive NVFP4 and LoRA-SVD.

Key Results

The authors validated Full-Stack FP4 by training a 3B parameter model from scratch over 64 billion tokens and benchmarking it on an NVIDIA RTX 5090 GPU:

  • Minimal Loss Gap: The BF16 baseline achieved a final training loss of 2.267, while Full-Stack FP4 reached 2.286—a tiny relative gap of just 0.838%.
  • Downstream Parity: Zero-shot evaluation showed that Full-Stack FP4 achieved an average perplexity of 26.665 (vs. 26.675 for BF16) and trailed by a mere 0.10 percentage points in average accuracy.
  • Hardware Speedups: Native hardware benchmarks of the Root optimizer blocks on an RTX 5090 showed a 2.50× to 2.83× speedup over optimized BF16 implementations.
  • Memory Savings: Q-AdamW reduced peak optimizer memory consumption by 37.9% to 42.5% compared to standard BF16 training.

Limitations and Future Work

  • Scale and Horizon Limits: The convergence experiments were capped at a 3B parameter model size and 64B tokens. Whether these exact recipes hold up without divergence at the 7B+ scale or over trillion-token horizons remains to be proven.
  • Incomplete Kernel Fusion: The current implementation does not fully fuse the LoRA backward paths and attention kernels, meaning there is still unrealized performance headroom left on the table.
  • Format Specificity: The recipes are highly tailored to the block-scaled structure of the NVFP4 format and may not directly transfer to alternative 4-bit formats like MXFP4.

Summary updated

BibTeX
@misc{ding2026full,
  author = {Siyu Ding and Mingchuan Ma and Jiabo Tong and Xingrun Xing and Ziming Wang and Guoqi Li},
  title = {{Full-Stack FP4: Stable LLM Pretraining with Quantized Projections, Optimizers, and Attention}},
  year = {2026},
  eprint = {2607.04422},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.04422},
}
Figure