[KongchangAI]
· 2 min read· 1,458 words

MXFP4 Quantization in Practice: How PTQ Techniques Complement and Conflict

MXFP4 Quantization in Practice: How PTQ Techniques Complement and Conflict

Research reveals that 4-bit quantization recipes are format-dependent, requiring differentiated tuning for MXFP4 and NVFP4.

A study covering six LLMs and three microscaling formats systematically examined how Hadamard rotation, PTQ algorithms, and scaling selection strategies interact across numerical formats, concluding that effective quantization recipes are format-dependent. MXFP4 benefits significantly from Hadamard rotation and error-correcting PTQ, while NVFP4—due to finer block scaling that already mitigates outliers—gains less from these techniques. The study also proposes the calibration-free Midmax scaling strategy, which improves accuracy in most MXFP4 configurations, and finds that MXFP6 activations with MXFP4 weights recover most 4-bit accuracy loss, reaching or exceeding the BF16 baseline on Llama-3.1-8B. Additionally, adding per-tensor macro scaling to MXFP4 did not improve average accuracy, showing that global rescaling cannot compensate for the limitations of E8M0 block scaling.

The Format Wars in Low-Precision Inference: Diverging Technical Paths of MXFP4 and NVFP4

Under the pressure of LLM inference costs, 4-bit quantization has moved from experimentation to production. Microscaling formats make aggressive low-precision quantization possible with controlled accuracy loss by sharing a single scaling factor across every 16 or 32 elements. But one key question has long lacked a systematic answer: are the interaction patterns between different numerical formats and post-training quantization (PTQ) techniques consistent?

A recent study covering six LLMs and three microscaling formats (MXFP6, MXFP4, NVFP4) delivered a clear conclusion: effective quantization recipes are format-dependent. Both MXFP4 and NVFP4 can support accurate 4-bit inference, but techniques that benefit one may not transfer to the other. This finding has direct implications for technology selection in real-world deployments.

MXFP4 for LLM Inference research overview

Microscaling (MX) formats are a class of open standards promoted by the Open Compute Project. The core idea is to partition a tensor into fixed-size blocks (typically 16 or 32 elements), where each block shares a low-precision scaling factor (scale), and elements within the block are stored in 4-, 6-, or 8-bit fixed-point or floating-point form. Compared with traditional per-tensor or per-channel quantization, MX formats strike a balance between storage overhead and representational precision: the scaling factor itself is encoded in a minimal form such as E8M0 (8-bit exponent, no mantissa), adding almost no extra bit burden.

NVFP4 is a 4-bit floating-point format introduced by NVIDIA in its Blackwell architecture. It also uses block-level scaling, but with finer scaling granularity (typically one block per 16 elements) and higher scaling-factor precision. Its key difference from MXFP4 lies in the representation and selection mechanism of the scaling factor—NVFP4's block scaling captures dynamic-range variations within blocks more precisely, which is the fundamental reason why, as discussed later, "NVFP4 gains less from rotation." Understanding the differences between these two formats in scaling granularity and scaling-factor encoding is the prerequisite for grasping the technical divergence throughout this article.

Hadamard Rotation: Essential for MXFP4, a Nice-to-Have for NVFP4

The study systematically varied three dimensions: Hadamard rotation granularity, PTQ algorithm, and scaling selection strategy. The core differences emerged in rotation techniques.

MXFP4 benefits significantly from rotation. Rotation operations can break up the outlier distribution in weights, making values within blocks more uniform and thereby reducing quantization error. But NVFP4's gain from rotation is notably smaller, because its finer scaling granularity means block scaling already captures more intra-block variation and mitigates the outlier problem itself, so the marginal benefit of rotation naturally diminishes.

This means engineering practice cannot simply copy MXFP4's optimization pipeline onto NVFP4. If you configure a complex rotation workflow for NVFP4 and see little effect, the problem is not the implementation but the format characteristics themselves.

Hadamard rotation (also called randomized Hadamard transform, RHT) is an orthogonal transform that redistributes the values of each element by multiplying weight or activation vectors with a Hadamard matrix without changing the vector norm. Its quantization significance lies in the fact that LLM weights commonly contain a small number of very large-magnitude "outliers," which expand the dynamic range of their block and compress other normal values in the same block to extremely low quantization precision. Hadamard rotation can "spread out" the energy of outliers across all dimensions, making the intra-block value distribution closer to Gaussian and allowing a unified scaling factor to cover the entire block more effectively.

Rotation granularity (per-block, per-channel, or per-tensor) determines the scope over which the transform is applied. Finer granularity yields more targeted scattering but incurs higher computational cost. The study treated rotation granularity as an independent variable for systematic sweeping precisely because it directly determines whether rotation can effectively mitigate the intra-block outlier problem in MXFP4.

Error-Correcting PTQ: A Better Match for MXFP4

The choice of PTQ algorithm also shows format divergence. MXFP4 benefits more from error-correcting PTQ, which complements the role of rotation: rotation handles outliers at the distribution level, while error correction compensates for residuals after quantization.

NVFP4 is less sensitive in this respect, consistent with the error buffer already provided by its fine-grained scaling. The study does not deny the value of error correction for NVFP4, but explicitly states that its gain magnitude is smaller than in the MXFP4 scenario.

One noteworthy detail: the research team additionally tested the effect of adding per-tensor macro scaling to MXFP4 (which is a built-in mechanism of NVFP4). The results showed no improvement in average accuracy. This suggests that global rescaling cannot replace the fineness of block-level scaling, and the limitations of E8M0 block scaling cannot be remedied by adding a layer of macro scaling.

Error-correcting PTQ (such as GPTQ and its variants) works as follows: when quantizing weights layer by layer, it uses second-order information (Hessian approximation) to estimate the impact of each weight's quantization error on the layer output, and proportionally compensates the unquantized residual onto weights not yet quantized, thereby minimizing the overall output deviation caused by quantization. This class of methods is essentially an iterative "quantize–compensate" process and is relatively sensitive to non-uniformity in intra-block value distributions.

When large outliers exist within a block, the residuals that error correction needs to compensate are larger and more concentrated, limiting compensation effectiveness. After Hadamard rotation first scatters the outliers, the residual distribution faced by error correction becomes more uniform, and compensation efficiency improves accordingly. This explains why MXFP4 benefits significantly from the combination of rotation and error-correcting PTQ—the two complement each other in terms of error sources. For NVFP4, because block scaling has already mitigated outliers, the marginal room for error correction naturally narrows.

Midmax: A Calibration-Free Scaling Selection Strategy

On the scaling selection dimension, the study proposed Midmax—a scaling selection strategy that requires no calibration data. It addresses the truncation error problem in power-of-two block scaling by selecting a better scaling point over the intra-block value distribution to reduce truncation loss.

Under most MXFP4 configurations, Midmax brought accuracy improvements. Its calibration-free nature makes it attractive for real-world deployment: no additional calibration dataset is needed, reducing pipeline complexity and data dependence. But the study also honestly presents the boundary—the improvements cover "most" rather than all configurations, indicating that scaling selection is not a universal key and must be validated against specific models and formats.

Power-of-two block scaling (such as the E8M0 scaling factor in MX formats) means that the scaling factor for each block can only take integer powers of two. When the maximum absolute value within a block falls exactly between two adjacent powers, choosing the smaller power causes some values to overflow (requiring truncation), while choosing the larger power coarsens the quantization resolution of all values—this is the source of "truncation error."

The Midmax strategy does not rely on calibration data; instead, it directly analyzes the distribution of values within each block (such as the ratio between the maximum and second-largest values) and selects, between two adjacent power-of-two scaling points, the one that yields smaller overall quantization error. In contrast, the traditional max-based strategy always chooses the power that can accommodate the maximum value, which is often conservative. Midmax's calibration-free nature allows it to be embedded directly into the inference pipeline without additional data traversal, which is the source of its engineering appeal.

MXFP6 Activations + MXFP4 Weights: A Pragmatic Path Close to BF16

One of the most practically valuable findings in the study is a mixed-format configuration: MXFP6 activations with MXFP4 weights can recover most of the accuracy lost to 4-bit quantization. On Llama-3.1-8B, this configuration reached or exceeded the team's internal BF16 baseline.

The practical implication is clear: if pure 4-bit weights + 4-bit activations still fall short on accuracy, there is no need to fall back directly to BF16—MXFP6 activations are an intermediate option with limited cost increase but clear accuracy returns. Activation dynamic ranges are typically wider than those of weights, and retaining 6-bit activation precision lands right at the inflection point of the benefit curve.

Three Takeaways for Quantization Engineering

Taken together, this study provides actionable criteria for low-precision inference deployment. Format selection is not an isolated decision; it must be jointly tuned with rotation, PTQ algorithm, and scaling strategy. MXFP4 suits a complete pipeline combining rotation and error-correcting PTQ; for NVFP4, optimization effort can focus more on the scaling strategy itself rather than on rotation. Mixed-precision configurations (MXFP6 activations + MXFP4 weights) offer a compromise for scenarios pursuing BF16-level accuracy. Calibration-free strategies such as Midmax lower the deployment barrier for MXFP4, although their benefits must be validated configuration by configuration.

The "format dependence" of quantization recipes reminds engineering teams: best practices circulating in the community are often tied to specific formats, and small-scale ablation validation should be performed before cross-format migration rather than assuming the technology stack can be transplanted by default.

#MXFP4 quantization#NVFP4#post-training quantization#Hadamard rotation#microscaling formats#LLM low-precision inference#Midmax scaling strategy
Share:

Related articles