I wrote this as the opening of How much precision does intelligence need?, my article on LLM quantization, but it made that one way too long. You don’t need it to follow the other article. But if you ever wondered what FP16, BF16 or FP4 actually mean, this is the short version.
Sign, significand, exponent
You might remember Avogadro’s constant from chemistry class:
The sign tells us whether the value is positive or negative. The is the significand, it carries the digits. The is the exponent, it sets the scale.
Binary floating-point works the same way, just with 0s and 1s and powers of 2 instead of powers of 10. So a binary number looks like , where is the significand and is the exponent.
The bits that store the number are split into a , an and a . The fraction holds the bits after the leading 1 of the significand, so for it stores 101. The leading 1 is known in advance, so it does not need to be stored.
Ignoring some details of how the exponent is encoded (there’s a bit of bias trickery involved), we can think of the value as:
Where the bits go
There are many ways to split those bits. FP32 and FP16 are defined by IEEE 754. BF16 follows the same broad design, while the FP8 and FP4 encodings below come from the Open Compute Project’s FP8 and Microscaling specifications.
More exponent bits give us a wider range, from very small to very large numbers. More fraction bits give us more precision. Every format makes its own split:
| Format | Sign | Exponent | Fraction | Notes |
|---|---|---|---|---|
| FP32 | 1 | 8 | 23 | wide range & high precision |
| FP16 | 1 | 5 | 10 | less range but more precision than BF16 |
| BF16 | 1 | 8 | 7 | FP32’s exponent range, lower precision |
| FP8 | 1 | 4 | 3 | You should get the gist by now+precision -range |
| FP8 E5M2 | 1 | 5 | 2 | more range, less precision |
| FP4 E2M1 | 1 | 2 | 1 | not much headroom here! |
Exponent bits buy range. Fraction bits buy precision.
FP16 (Half Precision) and BF16 (Brain Floating Point) show this really well. Both use 16 bits, but FP16 gives more of them to the fraction, while BF16 keeps the same eight-bit exponent as FP32. Avogadro’s number wasn’t chosen by accident! It is so large that the difference becomes easy to see:
BF16 has enough range for Avogadro’s number and FP16 does not. But for values that fit in both, FP16 is the more precise one.
Sixteen possible patterns
Once we get down to 4 bits, there are not many options left. Four bits give us patterns (from 0000 to 1111) and that’s it. What those 16 patterns mean depends on the format. With INT4 they are evenly spaced integers, with FP4 they follow a floating-point layout.
Probably easier to see than to explain:
- INT4 uses a uniform grid (−8 to 7) with a constant step size of 1.
- FP4 E2M1 uses uneven spacing, keeping values close together near zero (0.5 apart) while taking larger jumps for bigger numbers (like 4 straight to 6).
The spacing between these points matters because it decides how closely we can approximate the values in between. INT4 keeps the gap fixed at 1. FP4 has small gaps near zero and bigger ones as the values grow, so it is more precise for small values and can still reach larger ones with the same four bits. E2M1 also spends two patterns on and , so its 16 codes only give 15 distinct values.
FP4 in real models
Four bits on their own don’t get you very far, since E2M1 tops out at 6. So the formats that use it store the values in groups and give every group a shared scale. I explain why that works in the quantization article. Here I only want to show what it costs.
MXFP4 and NVFP4 are two good examples. Both use the E2M1 values from above, but they make different choices about the groups and scales around them.
MXFP4 groups 32 values together and stores an 8-bit E8M0 scale for each group. E8M0 uses all eight bits for the exponent, so the scale can only be a power of two:
NVFP4 uses smaller groups of 16 and an 8-bit E4M3 scale:
That extra quarter of a bit buys two things:
- a scale for every 16 values instead of every 32
- a scale that can sit between powers of two, not just on them
NVFP4 also adds a second FP32 scale shared across the whole tensor, but spread over that many weights it costs almost nothing per value.
So a “4-bit” format is not exactly 4 bits per weight, because the scales take space too. The same thing happens in llama.cpp’s GGUF formats, and that is what the other article is about.