Source-linked AI summary
Quartet II: Accurate LLM Pre-Training in NVFP4 by Improved Unbiased Gradient Estimation
Andrei Panferov, Erik Schultheis, Soroush Tabesh, Dan Alistarh
TL;DR
NVFP4 training must retain FP16/FP8-quality optimization while performing most operations at 4-bit precision, but unbiased gradient estimation remains challenging. Quartet II addresses this with MS-EDEN and a fully-NVFP4 training graph, yielding consistently improved gradient estimation and better model quality in end-to-end LLM pre-training.
Problem
NVFP4 training seeks FP16/FP8-quality optimization at 4-bit precision, where biased gradient estimates can accumulate systematic error during long pre-training runs.
Method
MS-EDEN moves stochasticity from individual FP4 values to microscale factors, enabling Quartet II’s fully-NVFP4 graph with improved forward and unbiased backward quantization.
Results
Quartet II yields consistently improved gradient estimation across major transformer-training matrix multiplications, while validation shows better model quality and practical hardware potential.
Takeaways & Limitations
The proposed microscaling quantization scheme demonstrates practical potential for NVFP4 LLM pre-training through improved model quality and supporting CUDA kernels.
Takeaways & Limitations
Experimental verification focuses on LLM pre-training in NVFP4, currently supported on only one generation of NVIDIA accelerators, and broader generalization may require hyper-parameter tuning.
Abstract
from arXiv · showhide
The NVFP4 lower-precision format, supported in hardware by NVIDIA Blackwell GPUs, promises to allow, for the first time, end-to-end fully-quantized pre-training of massive models such as LLMs. Yet, existing quantized training methods still sacrifice some of the representation capacity of this format in favor of more accurate unbiased quantized gradient estimation by stochastic rounding (SR), losing noticeable accuracy relative to standard FP16 and FP8 training. In this paper, improve the state of the art for quantized training in NVFP4 via a novel unbiased quantization routine for micro-scaled formats, called MS-EDEN, that has more than 2x lower quantization error than SR. We integrate it into a novel fully-NVFP4 quantization scheme for linear layers, called Quartet II. We show analytically that Quartet II achieves consistently better gradient estimation across all major matrix multiplications, both on the forward and on the backward passes. In addition, our proposal synergizes well with recent training improvements aimed specifically at NVFP4. We further validate Quartet II on end-to-end LLM training with up to 1.9B parameters on 38B tokens. We provide kernels for execution on NVIDIA Blackwell GPUs with up to 4.2x speedup over BF16. Our code is available at https://github.com/IST-DASLab/Quartet-II .
1. Introduction
Training costs are driven largely by dense matrix multiplications, motivating reduced-precision GEMMs while retaining FP16/FP8-quality optimization. Quartet II addresses this challenge with MS-EDEN and a fully-NVFP4 linear-layer graph that improves forward and backward quantization.
- Motivation: Dense matrix multiplications dominate Transformer pretraining, making reduced-precision GEMMs a direct lever for lowering end-to-end training costs.The relevant operations include linear projections in attention and MLPs.
- Challenge: 4-bit microscaling formats preserve dynamic range with higher-precision block scales, but naive quantization can diverge during long pretraining runs.The central challenge is retaining FP16/FP8-quality optimization while performing most operations at 4-bit precision.
- Contributions: MS-EDEN is an unbiased microscaling-FP4 quantization primitive that reduces quantization error by moving stochasticity from FP4 values to microscale factors.It remains hardware-compatible and efficient while retaining unbiasedness in expectation.
- Contributions: Quartet II combines high-capacity native-NVFP4 forward quantization with an unbiased MS-EDEN backward pass and randomized block rotations.Its forward pass also uses the Four-over-Six scale-selection heuristic.
- Validation and implementation: 4.2x speedup vs BF16 is achieved by efficient kernels implemented for NVIDIA Blackwell GPUs.The paper also reports end-to-end accuracy validation and consistent improvements over prior NVFP4 recipes.
2. Related Work
Prior low-precision training established that careful scaling and outlier handling can preserve accuracy, while recent microscaling FP4 work developed increasingly stable fully-quantized training recipes. Quartet II revisits stochastic rounding and proposes MS-EDEN as an unbiased gradient estimator with better MSE and validation loss.
- Lower-precision training: 4-bit training and matrix multiplication studies showed that careful scaling and outlier handling can maintain accuracy in constrained regimes.These early demonstrations primarily focused on INT4.
- Training in microscaling FP4: Recent NVFP4 and MXFP4 work examined microscaling, kernel behavior, selective precision, rotations, outlier control, and oscillation reduction for stable training.The cited approaches include backward-only MXFP4, fully-quantized recipes, square block quantization, Hadamard rotations, higher-precision layers, and TetraJetV2 enhancements.
- Unbiased quantization and rotations: Existing methods employ variants of stochastic rounding to preserve unbiasedness on the backward pass.The paper reconsiders this common design choice for low-precision training.
- Unbiased quantization and rotations: MS-EDEN is proposed as a new unbiased gradient estimator that provides significantly better MSE and validation loss.The proposal is motivated by stochastic rounding’s variance inflation at lower bitwidths.
3. Backward Pass Quantization
Backward-pass quantization requires unbiased gradient estimates for stable long-term LLM convergence, but EDEN’s correction factors cannot be represented by NVFP4’s coarse scales. MS-EDEN resolves this by merging corrections into group scales, reducing error while preserving unbiasedness under stated conditions.
- Unbiased backward-pass quantization is crucial for stable long-term LLM convergence because persistent gradient-estimation bias can produce consistently incorrect descent directions.
- EDEN’s correction factor S ranges from [0.94, 1.06], exceeding NVFP4 FP8 scales’ minimum relative update of ×1.0625 and preventing direct application to gradient estimation.
- MS-EDEN applies randomized rotations, RTN quantization, and stochastic rounding only to group micro-scales, merging EDEN corrections without per-element stochastic rounding.The procedure processes chunks whose lengths are multiples of the 16-value quantization group size.
- MS-EDEN is unbiased when the quantizer satisfies sign-symmetry and nonzero-output conditions, which hold for non-underflowing NVFP4 scale quantization.
- More than 2x lower quantization error than SR is achieved by MS-EDEN, while SR incurs approximately 2.5x higher MSE than RTN.The method attributes its lower error to avoiding per-element stochastic-rounding variance and using lower-variance stochastic rounding for 8-bit scales.
- Randomized rotations constrain micro-scaling groups to subdivisions of rotation groups, requiring rotations and scale corrections on the inner dimension of multiplied tensors.These hardware-driven constraints affect the computation scheme for unbiased gradient estimation in LLMs.
4. Forward Pass Quantization
Forward-pass quantization commonly uses square blocks so quantized weights can be reused in the backward pass, halving backward quantization error but reducing forward representation capacity. Quartet II instead requantizes weights and activations for MS-EDEN, while Four Over Six improves forward-pass accuracy but introduces biased gradient estimation.
- Square-block quantization: Square-block quantization enables reusing quantized weights in the backward pass, effectively halving backward-pass quantization error.This comes at the cost of worse outlier preservation and lower forward-pass representation capacity because one FP8 scale covers 256 FP4 values instead of 16.
- MS-EDEN choice: More than 2x lower quadratic error lets MS-EDEN outperform stochastic rounding even when weight re-quantization is required.Randomized rotations along the micro-scaling group dimension require requantizing both the weight tensor W and activations tensor X in the backward pass.
- Four Over Six: Four Over Six improves forward-pass quantization by selecting between scale factors 4.0 and 6.0 according to lower MSE.Its scale-selection step introduces bias, so the combined method does not provide unbiased gradient estimations and is excluded from backward-pass comparisons.
- Four Over Six: Roughly double the improvement over square-block quantization is achieved when Four Over Six synergizes with native NVFP4 scales on the forward pass.The effect is measured on forward-pass QAT through validation-loss increases relative to BF16 pre-training in Figure 2.
5. The Quartet II Computation Graph
Quartet II is a fully-NVFP4 linear-layer computation scheme for LLM pre-training with unbiased gradient estimation guarantees. It uses deterministic Round-to-Nearest FP4 quantization with native NVFP4 scaling and finer “4/6” scale selection on the forward pass, while replacing stochastic rounding with MS-EDEN on the backward pass.
- Overall scheme: Quartet II provides a fully-NVFP4 linear-layer computation scheme with unbiased gradient estimation guarantees.The scheme targets LLM pre-training.
- Forward Pass: Forward-pass weights and activations use Round-to-Nearest FP4 rounding, native NVFP4 scaling, one per-tensor FP32 range-extension scale, and local “4/6” scale selection.Native NVFP4 scaling uses one FP8 E4M3 scale per 16 elements.
- Forward Pass: Forward-pass quantized weights and activations enable native NVFP4 tensor-core multiplication on Blackwell GPUs and are saved for backward computation.The saved tensors are later de-quantized, transposed, and re-quantized for the backward pass.
- Backward Pass: Backward computation generates a pseudo-random group RHT rotation, then re-quantizes de-quantized transposed tensors with MS-EDEN before NVFP4 tensor-core multiplication.The tensors E and ET are quantized alongside the saved weights and activations; rotations cancel along inner GEMM dimensions, so product outputs need no further processing.
- Novelty: Compared with TetraJet-v2 and the NVIDIA recipe, Quartet II replaces backward-pass SR quantization with MS-EDEN and adds finer “4/6” forward-pass scale selection.These are identified as key differences in the computation graph.
6. Experimental Validation and Extensions
Experiments show that MS-EDEN, “4/6,” and full Quartet II quantization consistently improve NVFP4 training relative to stochastic rounding, prior schemes, and BF16 loss gaps. Larger-scale Nanochat results confirm Quartet II’s stability and pre-training advantage, while later zero-shot differences are insignificant.
- Backward pass quantization: MS-EDEN consistently outperforms stochastic rounding wherever both apply, including fully quantized weight-requantized training versus fully quantized stochastic rounding without weight re-quantization.MS-EDEN requires weight re-quantization and is therefore incompatible with schemes (b) and (d).
- Forward pass quantization: “4/6” consistently improves both square-group-scaling and native-group-scaling NVFP4 weight quantization by reducing the performance gap versus BF16.Native weight scales show approximately double the improvement, consistent with “4/6” improving both weights and activations quantization.
- Full quantization: At least 20% lower loss distinguishes Quartet II from isolated ablations and prior schemes, including NVIDIA et al. (2025), FourOverSix, and TetraJet-v2.The comparison combines forward-pass and backward-pass quantization in fully quantized training.
- Nanochat validation: 15-25% reduction in the BF16 pre-training loss gap is achieved by stable Quartet II relative to existing NVFP4 methods in the Nanochat pre-training phase.Nanochat uses Muon, WSD scheduling, QK-normalization, ReLU2 activations, and higher-quality data than the ablation setup.
- Nanochat validation: Insignificant zero-shot benchmark differences emerge among QAT methods after additional mid-training and supervised fine-tuning.The passage attributes this result to short instruction tuning and small test datasets.
7. Kernel Support
Quartet II provides hardware-tailored CUDA kernels and a post hoc range-alignment strategy for efficient MS-EDEN re-quantization. The kernels achieve substantial isolated linear-layer speedups and improved real training throughput on RTX 5090 and B200 hardware.
- Fused Re-Quantization Kernel: Global maximum reduction creates a barrier that prevents fusing NVFP4 re-quantization into one kernel pass, doubling memory bandwidth and matrix multiplication work.The reduction must run in a separate kernel, as illustrated for re-quantizing MS-EDEN.
- Post Hoc Range Alignment: Post hoc range alignment uses E8M3 pseudo-scales and FP4 values in the first kernel, then applies EDEN correction and stochastic FP8 scale quantization in the second.This avoids double loads and rotations while retaining unbiased gradient estimation.
- Post Hoc Range Alignment: 20% theoretical bandwidth saving and more than 10x lower latency characterize the second MS-EDEN re-quantization kernel relative to the initial quantization.The second kernel operates only on scales, requiring substantially less memory movement.
- Speedups: More than 4× linear-layer speedup is achieved on RTX 5090 for both large and small sizes, consistently outperforming the Quartet implementation.The kernels cover three backward-pass Quartet II quantization operations and Four Over Six quantization in the forward pass.
- Speedups: Up to 2.5× speedup is achieved on B200 for 22B matrix sizes, while 1B LLM pre-training shows more than 1.8x higher real training throughput over BF16.On B200, actual speedups begin at 3B because smaller sizes are dominated by quantization overhead.
8. Conclusion and Limitations
The paper proposes MS-EDEN, an unbiased quantization scheme for microscaling formats, and builds Quartet II for NVFP4 LLM pre-training. It reports improved model quality, QAT compatibility, and practical CUDA-kernel support, while noting that experiments narrowly target NVFP4 LLM pre-training on one NVIDIA accelerator generation.
- Conclusion: MS-EDEN is a novel unbiased quantization scheme for microscaling formats underlying Quartet II, a computation scheme for NVFP4 LLM pre-training.The method draws on insights from distributed optimization.
- Conclusion: Better MS-EDEN guarantees translate into better model quality, while Quartet II benefits from additional QAT heuristics and supplied CUDA kernels demonstrate practical potential.The conclusion links the scheme’s theoretical guarantees to model quality and implementation support.
- Limitations: The experimental verification focuses narrowly on NVFP4 LLM pre-training, a problem currently supported on only one generation of NVIDIA accelerators.The authors identify applying advanced debiasing techniques to the backward pass as the paper’s main contribution, while noting that lower MSE on Gaussian sources suggests broader generalization.
A. Unbiasedness Verification · B. Llama-Like Hyper-Parameters
Quartet II’s backward-pass gradient estimates are empirically unbiased despite hardware-oriented approximations, while the paper specifies model-specific and shared hyper-parameters for Llama-like experiments.
- A. Unbiasedness Verification: d = 128 enables efficient Blackwell-GPU rotations using the mma.m16n8k16 instruction.This is one of several hardware-compatibility compromises relative to EDEN’s limiting assumptions.
- A. Unbiasedness Verification: Identical rotations are used across rotation groups within each tensor and re-randomized per tensor and micro-batch to reformulate rotation as GEMM.This compromise improves hardware compatibility while preserving the implementation’s practical efficiency.
- A. Unbiasedness Verification: MS-EDEN omits stochastic rounding for underflowing FP8 values, affecting only scales at least ≈32000x smaller than the tensor’s largest scale.The paper characterizes the resulting effect as negligible and also describes per-NVFP4-group correction-factor computation with FP8 shared-exponent merging.
- A. Unbiasedness Verification: Quartet II’s backward-pass gradient estimates are empirically unbiased under the implemented hardware optimizations.Repeated quantized backward passes show the expected error decrease with averaging, consistent with unbiased estimation.
- A. Unbiasedness Verification: NVIDIA and TetraJet-v2 also produce unbiased gradient estimates, whereas Four Over Six is biased when applied to the backward pass.The comparison appears in Figure 9 alongside Quartet II’s verification.
- A. Unbiasedness Verification: The verification uses the pre-trained Llama-3.2-1B model and reports error concentration for attention block 0, the deepest block from the backpropagation perspective.This setup tests that unbiasedness is not caused by adaptation to QAT dynamics.
- B. Llama-Like Hyper-Parameters: Model-specific hyper-parameters for Llama-like models are listed in Table 3.The paper separates these settings from hyper-parameters shared across all experiments.
- B. Llama-Like Hyper-Parameters: Common hyper-parameters across model sizes and quantization setups for Llama-like models are listed in Table 4.These settings complement the model-specific values reported in Table 3.
C. Nanochat Details and Extra Evaluation · D. Kernel Benchmarks · D.1. Linear-Wise Speedups
The evaluation uses fully quantized Nanochat pre-training across 560M-parameter/11B-token and 1.9B-parameter/38B-token runs, while reporting few-shot accuracy with bootstrap trust intervals. Kernel benchmarks measure FP4 linear-layer speedups against BF16 and show that forward-only speedups approach raw matrix-multiplication speedups.
- C. Nanochat Details and Extra Evaluation: Nanochat experiments use speedrun.sh for a 560M-parameter model trained on 11B tokens and run1000.sh for a 1.9B-parameter model trained on 38B tokens.The unquantized speedrun.sh run is the baseline, followed by custom QAT runs for each tested method.
- C. Nanochat Details and Extra Evaluation: Pre-training uses quantization in both forward and backward passes, whereas post-training disables backward-pass quantization.
- C. Nanochat Details and Extra Evaluation: Final normalized pre-training results cover Arc-Challenge, Arc-Easy, PIQA, HellaSwag, and Nanochat’s CORE-Pretrain score.The reported bootstrapped trust intervals use 2 standard deviations relative to three reruns of Quartet II pre-training.
- C. Nanochat Details and Extra Evaluation: Most differences between the evaluated FP4 QAT methods are not statistically significant according to the reported trust intervals.
- D. Kernel Benchmarks: FP4 kernel benchmarks report speedups over BF16 for a single forward pass plus backward pass across transformer-like linear-layer sets.Measurements use batch size 8, sequence length 2048, and tensor shapes corresponding to Llama-like model sizes.
- D.1. Linear-Wise Speedups: Forward-only speedups are much closer to raw matmul speedups because expensive quantization kernels are mainly required during backward.Forward execution needs only four-over-six rounding.
- D.1. Linear-Wise Speedups: The benchmark aggregates latency for characteristic [in dim,out dim] weight shapes representing Llama-like models of different sizes.
D.2. End-to-End Speedups
End-to-end NVFP4 training is substantially faster than BF16 on a single RTX 5090 and across OLMO2 models on an 8xB200 server. The realized speedups remain below the theoretical 4×, partly because many runtime operations are unaffected by the FP4 recipe.
- RTX 5090: The RTX 5090 benchmark uses nanochat with depth 26, corresponding to 1.1B parameters, because the GPU has only 32GB of memory.At this size, Q, K, and V matrix multiplications are fused into one kernel call for both BF16 and NVFP4.
- RTX 5090: 52 ktok/s gives nvfp4 training 185% of the 28 ktok/s BF16 baseline on a 1.1B-parameter RTX 5090 setup.The BF16 baseline corresponds to 92% MFU.
- RTX 5090: About 60% of runtime remains in operations untouched by the FP4 training recipe at the 1.1B model size.This ratio is expected to decrease substantially as model size grows, increasing the usefulness of FP4.
- B200: On 8xB200, end-to-end speedups over the BF1 baseline rise from 1.48 for 3.3B parameters to 1.68 for 11B.Intermediate speedups are 1.58, 1.59, and 1.62 for 5.6B, 7.1B, and 8.8B models, respectively.
- Linear-layer speedups: Figure 10 reports linear-layer computation speedup over BF16, separating pure matmul speed from quantization overhead.Hollow boxes indicate pure matmul speed and visualize the quantization overhead.