Four bits provide 16 possible bit patterns. How those patterns represent numbers depends on the format. Quantization stores values using a smaller set of available numbers, usually with additional scaling information. A value between two available numbers must be rounded.1
Think of a ruler with only a few marks: the stored result lands on a mark, and the distance from the original value is the rounding error. This lesson compares two different arrangements of those marks.
INT4 & NVFP4: same bit count, different numbers
Move a number and see what gets lost when it is stored.
AI-assisted learning visualization · simplified worked example
Four bits give 16 bit patterns. What matters is the number each pattern represents: an integer for INT4 or a tiny floating-point number for FP4.
INT4: evenly spaced integer steps
Signed INT4 can represent the integers from −8 through 7. In the symmetric example used here, a positive scale multiplies those integers. With a scale of 0.5, integer 3 reconstructs the value 1.5. The reconstructed numbers are still evenly spaced.1
INT4 alone does not specify a complete quantization method. Implementations choose scales, group sizes and sometimes zero points, which shift the integer range. The diagram uses an explicitly simplified symmetric example; it does not represent every INT4 model file.
NVFP4: floating-point steps plus shared scales
NVFP4 uses a four-bit E2M1 value: one sign bit, two exponent bits and one fraction bit. Its unscaled magnitudes are 0, 0.5, 1, 1.5, 2, 3, 4 and 6. Negative values use the sign bit. There are 16 patterns but 15 distinct numerical values because positive and negative zero represent the same number.23
The marks are closer together near zero and farther apart for larger magnitudes. The common NVFP4 layout also supplies an FP8 scale shared by 16 values and an FP32 scale for the tensor, the array containing those blocks. Reconstruction multiplies the small E2M1 value by both scales.2
Watch the rounding, then the scale
Follow the input value to its reconstructed value on each number line. The displayed error is a difference between two numbers, not a prediction of a model's answer quality. A value may land closer to an INT4 mark or an FP4 mark depending on the input and scales.
Scaling stretches or shrinks the number line. For example, an E2M1 value of 1.5 with block scale 2 and tensor scale 0.5 reconstructs 1.5. These deliberately simple values illustrate the multiplication; they are not a calibration recipe or a benchmark.
What “4-bit” leaves out
Shared scales need storage too. For the illustrated NVFP4 layout, 16 four-bit values plus one eight-bit block scale occupy 72 bits: 4.5 bits per value, before the tensor scale and layout overhead. This is arithmetic for that layout, not a whole-model memory estimate. INT4 schemes also carry metadata.21
Neither format guarantees better model quality or faster execution. Calibration, the model, supported kernels and hardware matter. Quantizing model weights also does not automatically change the KV cache's storage format.
Continue with the quantization guide, revisit the KV-cache lesson, or return to the visual learning path.
Sources
Footnotes
-
NVIDIA TensorRT, Quantization schemes. ↩ ↩2 ↩3
-
NVIDIA, Introducing NVFP4 for Efficient and Accurate Low-Precision Inference. ↩ ↩2 ↩3
-
Open Compute Project, Microscaling Formats specification, FP4 encoding. ↩