What is AI 4-bit floating point (FP4)?

FP4 (4-bit floating point) is a floating point format representing a number in 4 bits. Its common E2M1 encoding has 1 sign, 2 exponent and 1 mantissa bit, no codes for infinity or NaN and a largest value of 6.

Unlike 4-bit integer, with its evenly spaced integers, FP4 places values densely near zero. With only 16 codes, FP4 is usually paired with block scaling; in MXFP4, from the open MX standard, 32 values share one 8-bit scale.

Topic
Infrastructure and runtime
Also known as
E2M1, MXFP4
Origin
2023, Open Compute Project MX standard

How AI 4-bit floating point (FP4) works

  1. Values to be quantised are split into blocks of 32.
  2. An 8-bit shared scale is computed for each block.
  3. Values are divided by the scale and rounded to the nearest FP4 value; out-of-range values are clamped to the largest magnitude.
  4. In matrix multiplication results are recovered with the shared scale and accumulated at higher precision.

In more detail

Values E2M1 can represent

In the E2M1 encoding the exponent bias is 1; the smallest normal value is 1, the subnormal value is 0.5 and the largest value is 6. With the sign bit the format represents zero plus 0.5, 1, 1.5, 2, 3, 4 and 6 in positive and negative form. With so few values, the block scale is the main factor deciding accuracy.

Commonly confused terms

TermHow it differs
FP8FP8 uses 8 bits per value and mostly gives adequate accuracy with per-tensor scaling. FP4 halves memory again but its narrow range calls for fine-grained scaling such as 32-value blocks.

Why AI 4-bit floating point (FP4) matters for on-premises AI

A 2023 study of the MX standard finds one per-tensor scale insufficient below 8 bits and trains large Transformer models with 4-bit MX weights at a minor accuracy cost. Another used post-training quantisation to bring a 13-billion-parameter model's weights and activations to 4-bit floating point, 5.8 points below full precision. Example calculation: a 32-value MXFP4 block takes 8 + 32 × 4 = 136 bits (4.25 bits per value).

ON-PREMISES EXAMPLE

Before moving its in-house language model to MXFP4 to save GPU memory, a bank's platform team compares it with the 16-bit version on its own Turkish evaluation set and stays at 8 bits if the gap exceeds tolerance.

Common questions

Which is better, FP4 or INT4?

It depends on the task and the value distribution. A 2023 study reports that floating point quantisation handles long-tailed or bell-shaped distributions better than integers; it should still be tested on the organisation's own tasks.

Does FP4 speed things up on every piece of hardware?

No. Speed-ups need hardware supporting 4-bit matrix operations; elsewhere the gain is mostly limited to memory.

Sources

In the glossary: Glossary, A to D

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.