NVFP4 and MXFP4 explained: how microscaling makes 4-bit floating point work for LLMs
Four-bit floating point is now a mainstream way to ship large language models, from open checkpoints to GPU kernels. This article explains how NVFP4 and MXFP4 store numbers, quantises a block by hand, compares their error with a simulation, and covers how mixed-precision recipes use them.
- Reading time
- 13 min
- Sections
- 7
- Code examples
- 2
- Tables
- 1
- Sources
- 9
- Published
- 23 Nov 2026
- What changed
- NVIDIA Model Optimizer 0.48.0 is released
- Why it matters
- FP4 changes the economics of serving large open models.
- What to do
- Check hardware support first
Quantisation stores a model's weights, and sometimes its activations and cache, in fewer bits so that it uses less memory and runs faster. For years the practical floor for serving large language models was 8 bits, or 4-bit integers with careful tricks. Four-bit floating point, in the NVFP4 and MXFP4 formats, has changed that. Quantisation toolkits now publish recipes and checkpoints in these formats for large open models, and recent GPUs have hardware support for them.
Four bits allow only 16 distinct codes. The trick that makes them usable is microscaling: small blocks of values share a scale factor, so each block gets its own range. This article explains how the two main formats differ, quantises a block step by step, measures their error in a simulation, and shows how current toolkits mix them with higher precision.
What happened
NVIDIA Model Optimizer 0.48.0 is released (2 November 2026)
NVIDIA's Model Optimizer library, which quantises models for TensorRT-LLM, vLLM and SGLang, released version 0.48.0 on 2 November 2026, according to its changelog, with a 0.49.0 release candidate on PyPI on 16 November. The 0.48.0 notes add a PTQ recipe for Nemotron 3.5 Super VL that uses NVFP4 for routed and shared mixture-of-experts layers, FP8 for attention projections and an FP8 KV cache, while keeping the router, embeddings and encoders in BF16. The notes state that the published NVFP4 checkpoint adds quantization-aware distillation after this step. Upcoming notes describe a fix so that exported NVFP4 weights on an exact E2M1 rounding boundary no longer pack to a neighbouring value, a reminder of how fine the margins are at 4 bits.
LLM Compressor ships mixed MXFP4 and FP8 checkpoints (28 October 2026)
The vLLM project's LLM Compressor library published version 0.15.0 on PyPI on 28 October 2026. Its README lists improvements since v0.14.0, including MXFP6 schemes, MXFP4xFP8 examples and faster observers for E8M0 scale formats. It also lists mixed-precision checkpoints from Red Hat AI that assign MXFP4 or FP8 per layer. For GLM-5.3, routed experts and dense MLPs use MXFP4 while attention, shared experts and the multi-token prediction layer stay in FP8; the README reports an average of about 4.5 bits per parameter, shrinking the checkpoint from about 1,507 GB to about 415 GB, roughly 72 percent smaller.
How a 4-bit float stores a number
The E2M1 grid
Both formats store each element as FP4 in the E2M1 layout: one sign bit, two exponent bits and one mantissa bit. That gives exactly eight magnitudes:
0, 0.5, 1, 1.5, 2, 3, 4, 6
plus their negatives. The spacing is uneven, which is the point of a floating-point format: fine steps near zero, coarse steps at the top. Most weights in a trained network are small, with a few large ones, so this shape fits the data better than the evenly spaced levels of a 4-bit integer.
On its own, a range of −6 to 6 is useless for real weights, which might range from −0.02 to 0.02 in one layer and −3 to 3 in another. That is where scales come in.
Microscaling: one scale per block
Microscaling divides a tensor into small blocks and stores one scale per block. Each value is divided by its block's scale, rounded to the nearest grid point, and stored as 4 bits. To read it back, multiply by the scale. A good everyday analogy is a set of maps at different zoom levels: each block of values gets its own zoom, so small details in one region and large features in another are both visible on a 16-step ruler.
The two formats differ in block size and in how the scale is stored.
| Property | MXFP4 (OCP microscaling) | NVFP4 (NVIDIA) |
|---|---|---|
| Element format | FP4 E2M1 | FP4 E2M1 |
| Block size | 32 elements | 16 elements |
| Block scale format | E8M0: a pure power of two | FP8 E4M3: has a mantissa |
| Extra scale | none | one FP32 scale per tensor |
| Storage per element | 4 + 8/32 = 4.25 bits | 4 + 8/16 = 4.5 bits |
MXFP4 comes from the Open Compute Project's Microscaling (MX) specification, which also defines MXFP8, MXFP6 and MXINT8. Its E8M0 scale is an 8-bit exponent with no mantissa, so every block scale is a power of two. NVFP4 uses smaller blocks and an FP8 E4M3 scale, which can take values between powers of two, plus a second-level FP32 scale for the whole tensor so that the block scales stay within FP8's range. E4M3's largest value is 448, a number that appears throughout quantisation toolkits; Model Optimizer's notes, for example, describe NVFP4 KV-cache scales written as the maximum absolute value divided by 448.
Quantising a block by hand
Take a small block with values 0.1, −0.4, 0.9 and 7.9. The largest magnitude, 7.9, is an outlier.
MXFP4. The shared exponent is chosen from the largest value: X = floor(log₂ 7.9) − 2 = 2 − 2 = 0, where 2 is the largest exponent of E2M1. The scale is 2⁰ = 1. Dividing by 1 and rounding to the grid gives 0, −0.5, 1 and 6. The outlier 7.9 is clamped to 6, an error of 1.9, because a power-of-two scale cannot stretch the grid to fit it exactly.
NVFP4. The ideal scale maps the largest value onto the top of the grid: 7.9 / 6 = 1.317. Rounded to FP8 E4M3, that becomes 1.375. Dividing by 1.375 gives 0.07, −0.29, 0.65 and 5.75, which round to 0, −0.5, 0.5 and 6. Multiplying back gives 0, −0.69, 0.69 and 8.25. The outlier is now within 0.35, but the small values are coarser.
Neither result is perfect: four bits cannot hold everything. The difference is that NVFP4's finer scale wastes less of the grid, and its smaller blocks mean one outlier affects 16 values instead of 32.
Measuring the error
The script below quantises 131,072 values drawn from a normal distribution with both formats and measures the relative root-mean-square error. It is a simplified model: it ignores FP8 subnormals and uses a per-tensor scale of 1.
import numpy as np
GRID = np.array([0, 0.5, 1, 1.5, 2, 3, 4, 6]) # E2M1 magnitudes
def to_e2m1(x):
a = np.minimum(np.abs(x), 6.0)
return np.sign(x) * GRID[np.abs(a[..., None] - GRID).argmin(-1)]
def e4m3(s): # round a scale to FP8 E4M3
e = np.maximum(np.floor(np.log2(s)), -6)
return np.minimum(np.round(s / 2**e * 8) / 8 * 2**e, 448.0)
def nvfp4(b):
s = e4m3(np.abs(b).max() / 6); return to_e2m1(b / s) * s
def mxfp4(b):
s = 2.0 ** (np.floor(np.log2(np.abs(b).max())) - 2); return to_e2m1(b / s) * s
w = np.random.default_rng(0).normal(size=4096 * 32)
nv = np.concatenate([nvfp4(b) for b in w.reshape(-1, 16)])
mx = np.concatenate([mxfp4(b) for b in w.reshape(-1, 32)])
rel = lambda q: np.sqrt(((q - w) ** 2).mean() / (w ** 2).mean())
print(rel(nv), rel(mx)) # about 0.095 and 0.115
On this data NVFP4's relative error is about 9.5 percent and MXFP4's about 11.5 percent. NVFP4 pays 0.25 extra bits per element for that improvement. Real weights have heavier tails than a normal distribution, which tends to favour smaller blocks further, but the size of the gap depends on the model and layer. Research papers on layer-wise and block-wise sensitivity of the two formats are one way to see where the differences concentrate.
How toolkits use FP4 in practice
Not every layer gets 4 bits
The checkpoints described above share a pattern: FP4 for the bulk of the parameters, higher precision for the sensitive parts. In mixture-of-experts models, the routed experts hold most of the weights and tolerate FP4 well, so they go to 4 bits. Attention projections, routers, embeddings, the output head and sometimes the KV cache stay at FP8 or BF16. That is why GLM-5.3's mixed checkpoint averages about 4.5 bits per parameter rather than 4.25.
The memory arithmetic shows why this matters. At 16 bits, 100 billion parameters take 200 GB. At an average of 4.5 bits, they take 100 × 10⁹ × 4.5 ÷ 8 = 56.25 GB, which can fit on far fewer accelerators. Decoding is usually limited by memory bandwidth, so reading a quarter of the bytes per token also speeds up generation, provided the hardware can compute on FP4 directly or dequantise cheaply.
Choosing scales well
Taking the block maximum, as in the hand example, is the simplest scale choice. Toolkits now search for better ones. Model Optimizer's notes describe weight-MSE calibrated NVFP4, which picks scales that minimise mean squared error rather than avoid clipping, and LLM Compressor describes MSE and iMatrix observers with grid search for E8M0 scales. Algorithms such as GPTQ and AWQ adjust the weights themselves to compensate for rounding, and both toolkits support them with FP4 formats.
Training to recover accuracy
When post-training quantisation loses too much accuracy, the next step is to train with quantisation in the loop. Quantisation-aware training (QAT) simulates FP4 rounding in the forward pass. Quantisation-aware distillation (QAD) goes further and trains the quantised model to match the outputs of the full-precision model as a teacher. Model Optimizer's notes say the published NVFP4 Nemotron 3.5 Super VL checkpoint used QAD after the PTQ stage, and LLM Compressor has added a block-wise QAD modifier.
Continue learning
How this article connects
10 pages link to or from it. Drag to turn, click a dot to open it.
- Mixed precision
- vLLM
- GPTQ
- AWQ
- Serving LLMs efficiently: quantization, batching, caching, routing and a
- How open models reach 1M tokens: Kimi K3, GLM-5.3-Flash and MiniMax-M3 c
- FlashAttention explained: tiling, online softmax and why FA4 had to figh
- Meta's Muse family for developers: Ember, Spark Open weights, Glimmer an
What it means in practice
FP4 changes the economics of serving large open models. A model that needed many GPUs in BF16 can run on a fraction of them, and memory-bound decoding gets faster. The cost is a small accuracy loss that must be measured, not assumed, and a dependence on hardware support: NVFP4 is designed for NVIDIA's Blackwell-generation tensor cores, while MXFP4 is an open specification that several vendors support. On hardware without native FP4 compute, weights can still be stored in FP4 and dequantised, saving memory but not compute.
Format choice is mostly a hardware and accuracy question. NVFP4's smaller blocks and finer scales usually give lower error for 0.25 extra bits per element. MXFP4 is slightly smaller and vendor-neutral. Mixed recipes such as MXFP4 experts with FP8 attention, aimed at Hopper GPUs in LLM Compressor's case, show that the practical unit of choice is the layer, not the model.
The quantization simulation shows rounding error at different bit widths, and the numeric precision simulation compares floating-point formats. For older 4-bit integer methods, see the GPTQ and AWQ pages.
What to do now
- Check hardware support first. Confirm whether your GPUs compute natively in NVFP4 or MXFP4, or only store them, because that decides whether you gain speed or only memory.
- Start from a published recipe. Use the toolkit recipes for your model family, which already keep routers, embeddings and other sensitive layers at higher precision.
- Quantise experts and MLPs first. In mixture-of-experts models, put routed experts in FP4 and keep attention and shared layers in FP8 until you have accuracy data.
- Use better scale search. Prefer MSE-based or importance-weighted calibration over simple block maxima, especially for MXFP4's power-of-two scales.
- Evaluate on your own tasks. Compare the quantised model with the original on task benchmarks and real prompts, not only perplexity.
- Budget for QAT or QAD. If accuracy drops more than you can accept, plan a short quantisation-aware distillation run rather than abandoning FP4.
- Treat the KV cache separately. Decide KV-cache precision on its own, since its errors accumulate over long contexts differently from weight errors.
- Re-export after toolkit fixes. Read changelogs; fixes to rounding and scale handling sometimes require re-exporting existing FP4 checkpoints.
Risks and open questions
Accuracy loss is uneven. Average benchmark scores can hide large drops on specific skills, such as long arithmetic or rare languages, that depend on a few sensitive weights.
Tooling is still moving fast. Changelogs include fixes to block-size handling, rounding boundaries and scale export, and some require re-quantising or re-exporting checkpoints.
Portability is limited. An NVFP4 checkpoint needs NVFP4-capable kernels to run at full speed; moving it to other hardware may mean conversion or a speed loss.
Activations are harder than weights. Quantising activations to 4 bits as well (W4A4) saves more compute but introduces more error than weight-only FP4, and needs careful calibration.
Watch next: independent accuracy comparisons of NVFP4 and MXFP4 on the same models, FP4 KV caches for long-context serving, and whether sub-4-bit formats join FP4 in mainstream recipes.
Frequently asked questions
What is the difference between NVFP4 and MXFP4?
Both store values as 4-bit E2M1 floats with a shared scale per block. MXFP4 uses blocks of 32 with a power-of-two scale, about 4.25 bits per value; NVFP4 uses blocks of 16 with an FP8 scale plus a per-tensor scale, about 4.5 bits per value, and usually lower error.
Why not just use 4-bit integers?
Four-bit integers have evenly spaced levels, while E2M1 has fine steps near zero and coarse steps at the top, which better matches typical weight distributions. INT4 methods with group scales remain widely used, and toolkits offer both.
Does FP4 make inference faster or just smaller?
Always smaller. It is also faster when the hardware has native FP4 tensor cores, and in memory-bound decoding even dequantising to a higher precision can help, because fewer bytes are read per token.
Which layers should stay in higher precision?
Typically routers, embeddings, the output head and often attention projections, as in the published recipes described above. Routed experts and dense MLPs usually tolerate FP4 best.
What is quantisation-aware distillation?
It fine-tunes the quantised model to match the outputs of the original full-precision model, which acts as a teacher. It is used when post-training quantisation alone loses too much accuracy.
Summary
FP4 formats store each value in 4 bits on the E2M1 grid of 0, 0.5, 1, 1.5, 2, 3, 4 and 6, and rely on microscaling to give each small block its own range. MXFP4 uses blocks of 32 with power-of-two scales for 4.25 bits per value; NVFP4 uses blocks of 16 with FP8 scales and a per-tensor scale for 4.5 bits, and in a simple simulation shows lower error. Current toolkits apply FP4 where it is safe, mainly to experts and MLPs, keep sensitive layers in FP8 or BF16, search for better scales, and use quantisation-aware distillation when needed. The result can shrink large checkpoints by around 70 percent. Measure accuracy on your own tasks and check hardware support before committing. For more, see the mixed precision and vLLM pages and the serving and cost topic.
Sources
- Web Open Compute Project: OCP Microscaling Formats (MX) v1.0 Specification
- Paper arXiv: Microscaling Data Formats for Deep Learning
- Docs NVIDIA Technical Blog: Introducing NVFP4 for Efficient and Accurate Low-Precision Inference
- Code GitHub: NVIDIA Model Optimizer changelog
- Code GitHub: LLM Compressor README
- Code PyPI: nvidia-modelopt release history
- Code PyPI: llmcompressor release history
- Paper arXiv: Diagnosing FP4 inference: a layer-wise and block-wise sensitivity analysis of NVFP4 and MXFP4
- Paper arXiv: Quantization-Aware Distillation for NVFP4 Inference Accuracy Recovery
Cite this article
Kelahmet, Ö. C. (2026, November 23). NVFP4 and MXFP4 explained: how microscaling makes 4-bit floating point work for LLMs. Özer Cem KELAHMET. https://www.ozercemkelahmet.com/articles/nvfp4-mxfp4-microscaling-4-bit-formats
BibTeX
@online{kelahmet2026nvfp4,
author = {Kelahmet, {\"O}zer Cem},
title = {{NVFP4 and MXFP4 explained: how microscaling makes 4-bit floating point work for LLMs}},
year = {2026},
month = {nov},
url = {https://www.ozercemkelahmet.com/articles/nvfp4-mxfp4-microscaling-4-bit-formats}
}Version historyfirst version
- Published
Factual corrections are listed here with what changed. Wording and formatting edits are not listed.