Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scaling
Jack Cook, Junxian Guo, Guangxuan Xiao, Yujun Lin, Song Han
TL;DR
This work tackles divergence and accuracy loss when training or deploying large language models with NVFP4 quantization. It introduces Four Over Six (4/6), an adaptive per-block scaling strategy that evaluates both M=4 and M=6 scales for each block and selects the better representation based on mean-squared-error, implemented efficiently on NVIDIA Blackwell GPUs. Empirical results show 4/6 stabilizes pre-training across transformer and hybrid architectures, and improves post-training quantization performance across multiple PTQ methods, with AWQ+4/6 often yielding the best perplexities and task metrics. The contribution enables more robust training and deployment of NVFP4-quantized LLMs, with publicly available code for broader adoption and further research.
Abstract
As large language models have grown larger, low-precision numerical formats such as NVFP4 have become increasingly popular due to the speed and memory benefits they provide. However, to accelerate computation with NVFP4, all matrix multiplication operands--weights and activations in the forward pass, and weights, activations, and gradients in the backward pass--must be quantized to NVFP4, often leading to divergence during training and performance degradation during inference. To address this issue, in this work we introduce Four Over Six (4/6), a modification to the NVFP4 quantization algorithm that evaluates two potential scale factors for each block of values. Unlike integer formats, floating-point formats such as FP4 have the most quantization error on near-maximal values in each block, which we find to be primarily responsible for downstream performance degradation. We find that for some blocks, scaling to smaller FP4 values makes the distribution of representable values more uniform, improving representation of near-maximal values. Importantly, 4/6 can be implemented efficiently on NVIDIA Blackwell GPUs, making it viable to use while training LLMs with NVFP4. In pre-training experiments with transformer and hybrid model architectures, we find that 4/6 prevents divergence in several cases, bringing training loss significantly closer to BF16 compared to models trained with current state-of-the-art NVFP4 training recipes. We also find that 4/6 can be easily incorporated into many different post-training quantization methods and generally improves downstream accuracy. We hope this inspires future work in training and deploying models with NVFP4. Our code is available at http://github.com/mit-han-lab/fouroversix.
