4-Bit Floating Point (FP4) Explained: How It Works in Practice

4-bit floating point explained: the E2M1 layout and its 0 to 6 range, how MXFP4 and NVFP4 block scaling work, and FP4's accuracy, memory and speed cost.

4-Bit Floating Point (FP4) Explained: How It Works in Practice
Written by TechnoLynx Published on 11 Jul 2026

The 4-bit floating point (FP4) element in MXFP4 and NVFP4 is E2M1: one sign bit, two exponent bits and one mantissa bit, which gives each value one of eight magnitudes from 0 to 6. Block-scaled FP4 formats such as MXFP4 and NVFP4 attach a shared scale factor to each small block of values. FP4 cuts the memory footprint to roughly a quarter of FP16, and Blackwell tensor cores measured 7700.2 TFLOPS in FP4 against 3850.6 in FP8. The accuracy cost is measurable as well: in one Blackwell study, weight-only FP4 (NVFP4 block 16, FP8 activations) raised perplexity by 7.7% to 9.1%.

How a 4-bit floating point number is laid out: E2M1 and its range

The Open Compute Project (OCP) Microscaling Formats specification, version 1.0 (2023), defines E2M1 with an exponent bias of 1, a maximum normal value of ±6.0, a minimum normal value of ±1.0 and a single subnormal magnitude of ±0.5. No bit patterns are reserved for infinity or NaN, subnormals must be supported, and conversion into FP4 must support round-to-nearest, ties-to-even. AMD’s HIP documentation describes the same 1-2-1 layout as its supported FP4 format and calls it a balance between minimal precision and reasonable dynamic range.

Worked example: decoding every E2M1 magnitude

Assume the bias of 1 from the OCP specification. A normal value is 2^(exponent − 1) × (1 + mantissa/2). When the exponent field is zero the value is subnormal: 2^0 × (mantissa/2).

Exponent bits Mantissa bit Calculation Value
00 0 zero 0
00 1 2^0 × 0.5 (subnormal) 0.5
01 0 2^0 × 1.0 1.0
01 1 2^0 × 1.5 1.5
10 0 2^1 × 1.0 2.0
10 1 2^1 × 1.5 3.0
11 0 2^2 × 1.0 4.0
11 1 2^2 × 1.5 6.0

The sign bit mirrors all of these, so the full codebook is ±{0, 0.5, 1, 1.5, 2, 3, 4, 6}. That is seven distinct positive values, and because +0 and −0 are separate encodings, 15 distinct values rather than 16. The spacing is uneven: steps of 0.5 near zero and a step of 2 between 4 and 6. The largest value, 6, is 12 times the smallest non-zero one, 0.5. That narrow range is why block-scaled FP4 formats attach a shared scale to each block.

Is E2M1 the only FP4 layout?

E2M1 is not the only FP4 layout, but it is the element format of both MXFP4 and NVFP4 on Blackwell. E1M2 has uniform, integer-like level spacing, and E3M0 has only power-of-two levels. LLM-FP4 (EMNLP 2023) searched exactly this space, {E3M0, E2M1, E1M2}, when quantising transformers, because floating-point quantisation quality depends heavily on the choice of exponent bits and clipping range.

Layout Bits (S/E/M) Level spacing Where it has a case What the measurements say
E2M1 1/2/1 Dense near zero, coarser at the top The payload of MXFP4 and NVFP4 Reduced the average accuracy drop versus INT4 by 7.34% with about 0.6% system overhead (Student Float study, 2024)
E3M0 1/3/0 Powers of two only, widest range Recommended for gradients, whose magnitudes are heavy-tailed Rated strictly worse than E2M1 on accuracy and accumulator size; for gradients it worked only with Ceil scale rounding
E1M2 1/1/2 Uniform, INT4-like Blocks whose values are more uniform, for example after orthogonal mixing As a per-block alternative to E2M1 in NVFP4 it improved accuracy substantially

The usual argument for it is that gradients follow a lognormal distribution and need range, but an empirical MXFP4 training study on Llama3 7B found that E3M0 significantly degraded training compared with E2M1 under Floor and Even scale rounding. The MixFP4 authors found that adding E3M0 to an E2M1/E1M2 mix brought only marginal gains at block size 16. E3M0 became more favourable at larger block sizes, where each shared scale spans more heterogeneous values.

Mixed-format research (choosing E2M1 or E1M2 per block) also exists, and MixFP4 reports doing it with no extra metadata and modest tensor-core overhead of 3.1% area and 1.5% power. That work is a PyTorch simulation of accuracy, not shipping hardware.

Plain FP4, MXFP4 and NVFP4: same element, different scaling

MXFP4 and NVFP4 both store E2M1 elements. They differ in how many elements share a scale and how precisely that scale is stored.

  Plain FP4 MXFP4 (OCP MX) NVFP4 (NVIDIA)
Element E2M1 E2M1 E2M1
Scale Software scaling factor One shared power-of-two scale per 32 values One FP8 E4M3 scale per 16 values, plus an FP32 per-tensor scale
Scale encoding Not fixed by the format E8M0 (exponent only) E4M3 block scale, FP32 tensor scale
Bits per value 4 plus a software scale 4.25 4.5
Memory vs 16-bit : About 3.76× smaller than BF16 About 3.5× smaller than FP16, about 1.8× smaller than FP8 (NVIDIA figure)

The bits-per-value figures come from the MR-GPTQ study (2025): 4.25 for MXFP4 and 4.5 for NVFP4. These are simple to check: an 8-bit scale shared across 32 elements adds 8/32 = 0.25 bits, and across 16 elements it adds 0.5 bits. MXFP4’s 3.76× reduction against BF16 is 16 / 4.25. NVIDIA states NVFP4 as roughly 3.5× smaller than FP16 and 1.8× smaller than FP8.

So NVFP4 pays a quarter of a bit per value more than MXFP4 in return for 16-element blocks and an E4M3 scale.

Why does FP4 need block scaling and calibration to stay usable?

With only a 12:1 ratio between its largest and smallest non-zero magnitude, FP4 needs a scale to expand its effective range. A per-block scale maps each group of values into the FP4 representable range first. Even FP8, which has far more range, needs scaling factors before casting, and some networks need a separate scale per tensor because one FP8 range cannot cover the important values of every tensor (Micikevicius et al., 2022). Transformer activations show high variance between channels and low variance within them, and outlier channels can be orders of magnitude larger than the rest. That makes a single scale per tensor or per token insufficient (LLM-FP4, 2023).

Block size works against you in a specific way. As a group grows, its maximum value pulls further away from typical values, and more small values fall into FP4’s dead zone around zero and round to nothing. Smaller blocks track local variation better but cost more storage and compute. Even at block size 16, the differences between formats persisted in the Student Float study.

Power-of-two scales versus E4M3 scales

MXFP4’s E8M0 scale can only be a power of two, so a block’s largest value cannot be scaled to fit FP4’s maximum of 6 exactly. It either overflows and saturates, or it lands on a smaller FP4 value and wastes part of the codebook. The rounding choice for the scale decides which error you get. Floor-based scaling causes overflow clamping, which degrades training accuracy. Ceil avoids the clamping but pushes more small values to zero. NVFP4’s E4M3 block scale lands the block maximum much closer to 6. NVIDIA’s pretraining report adds that with two-level scaling, at least 6.25% of each 16-value block (its maximum) is encoded at near-FP8 precision.

The MR-GPTQ authors proved and measured that Hadamard rotations improve MXFP4 accuracy but slightly hurt NVFP4 when combined with plain round-to-nearest.

Calibration and scale optimisation

LLM-FP4 used 128 calibration samples and stayed competitive with as few as 32. In the FOCUS ablation, simply learning scales instead of rounding to nearest cut MXFP4 WikiText2 perplexity from 18.60 to 12.96. With the full method, Qwen3-8B reached 9.76 under MXFP4 and 9.47 under NVFP4, against an FP16 baseline of 9.73. The deployed model stays in standard MXFP4 or NVFP4 format with no inference overhead.

Rounding

The OCP specification requires round-to-nearest, ties-to-even (RTNE) to be available when converting to FP4. RTNE keeps quantisation error centred on zero, whereas naive truncation adds systematic bias. For training, two studies use round-to-nearest for weights and activations and stochastic rounding for gradients. NVIDIA found that applying stochastic rounding to activations or weights caused divergence.

How does FP4 compare with FP8 and FP16 for memory and throughput?

On memory, FP4 weights take about a quarter of the space of FP16 and about half the space of FP8, before 0.25 to 0.5 bits of scale overhead per value. Throughput needs more care: on B200, FP4 reached up to 3.6× FP16 layer-wise but 2.2× end-to-end.

Measure FP16 / BF16 FP8 FP4 Source
Dense tensor-core throughput, Blackwell microbenchmark : 3850.6 TFLOPS 7700.2 TFLOPS Blackwell microbenchmark study, 2025
Vendor math-rate ratio vs FP8 : 1× 2× on GB200, 3× on GB300 NVIDIA, 2025
Peak throughput vs FP16, AMD MI355 1× : Up to 4× (FP4 and FP6) AMD ROCm blog
7B LLM inference 1× : 2.50× vs FP16 Blackwell microbenchmark study
End-to-end vs FP16, B200 / RTX 5090 1× : Up to 2.2× / 4× (layer-wise up to 3.6× / 6×) MR-GPTQ study, 2025

An FP4 mixture-of-experts kernel comparison on Blackwell measured SGLang’s FP4 path at 3.54× BF16 at batch size 4096. At batch size 1, though, vLLM’s FP4 path ran at 0.86× BF16, slower than not quantising at all, because quantisation overhead dominated at low occupancy. Interactive inference such as chat, code completion and agents runs at batch sizes 1 to 16.

Before trusting any FP4-versus-FP8 ratio for a serving decision, we would want to know the batch size, sequence length and kernel it was measured with. LynxBenchAI measures throughput, latency and memory across accelerators, backends and precisions.

What is the accuracy trade-off when running a model in FP4?

FP4 inference costs more accuracy than FP8, and recovery varies with model size and format. In the Blackwell microbenchmark study, FP8 (E4M3, per-tensor) raised perplexity by 1.9% to 2.4% across models, while FP4 (E2M1 weight-only, NVFP4 block 16, FP8 activations) raised it by 7.7% to 9.1%. The same authors stress that their 8.2% average hides variation between layers: some layers tolerate FP4 and others need FP8.

The MR-GPTQ authors found NVFP4 most accurate, INT4 second with higher variance, and MXFP4 “a distant third” regardless of method, though MR-GPTQ helped it. Large models recovered up to 98% to 99% of FP16 accuracy in either format, but models under 8B parameters and Llama-family models recovered less. AMD reports the same pattern for MXFP4: nearly lossless on very large models with advanced PTQ, more noticeable degradation on smaller ones, and over 99.5% accuracy retained on DeepSeek-R1-0528 reasoning tasks. NVIDIA reports 1% or less degradation for DeepSeek-R1-0528 quantised from FP8 to NVFP4, which is a vendor figure on a very large model and does not tell you what a 7B model will do.

On quantisation-aware training (QAT) versus PTQ, the MR-GPTQ authors measured that QAT added very little for NVFP4, while for MXFP4 it consistently narrowed the gap to full precision. Whether the remaining gap is acceptable is a product question: it depends on what your evaluation measures and how much a quality drop costs you. That judgement is covered more fully in our look at when the cost savings of lower precision are worth the risk.

NVIDIA trained a 12B model on 10 trillion tokens in NVFP4 and reached 62.58% MMLU-pro against 62.62% for FP8. Getting there took several measures together: 16% of linear layers left in BF16, Hadamard transforms, 2D weight scaling and stochastic rounding. In the same report, MXFP4 needed 36% more tokens to match NVFP4’s loss. An MXFP4 E2M1 configuration in an emulated Llama3 7B study diverged after about 40 million tokens.

When native FP4 tensor-core support matters, and when emulation is enough

NVIDIA states that native FP4 tensor cores deliver 2× (GB200) to 3× (GB300) the math throughput of FP8. Without them, a software-emulated MXFP4 training recipe on Hopper GPUs still gained FP4-level activation and communication efficiency. Blackwell’s fifth-generation tensor cores execute FP4 and FP6 natively. In AMD’s lineup, HIP documentation lists native E2M1 acceleration only on CDNA4, not on CDNA1 to CDNA3 or any RDNA generation.

Emulation works differently. The approach is fake quantisation: values are quantised and cast back to BF16 before an ordinary BF16 GEMM. That enables numerical studies of accuracy on existing hardware. That Hopper recipe quantises activations to MXFP4 before dispatch and caches them in MXFP4. On a 671B mixture-of-experts model it cut peak activation memory by 14.8% (11.8 GB) and raised throughput by 12.5%, from 1157 to 1302 tokens per GPU per second. The throughput gain came from fitting a cheaper recomputation strategy into the memory freed up, not from faster arithmetic. The authors also had to remap MXFP4’s power-of-two block scales onto Hopper’s FP8 pipeline, avoid FP8↔BF16↔FP4 conversions, and keep the backward pass in FP8, because FP4 dequantisation overhead there cost more than it saved.

The Blackwell MoE comparison describes a fast FP4 kernel design using warp specialisation for FP4 load and dequantise, TMA bulk loads with strict 128-byte alignment, and native NVFP4 instructions instead of software emulation. On the same GPU, SGLang’s FP4 layer ran 1.78× faster than vLLM’s at batch size 1.

Before you commit a model to FP4

These checks follow from the evidence above and are meant to be run in order:

  1. Confirm the target device has native FP4 tensor cores (Blackwell, CDNA4). If it does not, count only the memory and bandwidth savings.
  2. Choose NVFP4 over MXFP4 where both are available and accuracy is tight. Choose MXFP4 where the smaller scale overhead or OCP portability matters more.
  3. Calibrate scales rather than relying on round-to-nearest defaults, and treat Hadamard rotation as format-dependent.
  4. Evaluate per layer, and expect some layers (often the final ones) to stay in FP8 or BF16.
  5. Measure throughput at your real batch size, because FP4 can be slower than BF16 at batch size 1.

For other topics in this set, see the AI in guides and how-to hub.

FAQ

Does quantisation reduce inference time?

Not always. SGLang’s FP4 kernels on Blackwell measured 3.54× faster than BF16 at large batch, yet vLLM’s FP4 path ran at 0.86× BF16 at batch size 1, because quantisation overhead dominated.

What is the difference between PTQ and QAT?

Post-training quantisation (PTQ) calibrates a model that has already been trained. For FP4, QAT gave very limited benefit for NVFP4 but consistently narrowed the accuracy gap for MXFP4.

Is a float 4 bytes or 8 bytes?

A standard single-precision float (FP32) is 4 bytes, and a double (FP64) is 8 bytes. An FP4 value is half a byte, so two are packed into one byte.

Back See Blogs
arrow icon