Number formats
A model's weights are numbers, and you choose how many bytes each one gets.
Precision and formats
FP32 uses 4 bytes per number. BF16 and FP16 use 2, FP8 and INT8 use 1, and INT4 uses half a byte. Storing weights in fewer bytes than before is called quantization. A 7B model is about 14 GB in BF16, 7 GB in INT8, and 3.5 GB in INT4.
Smaller is often faster
Each decode step reads every weight from HBM, and decode is memory-bound. Half the bytes means half the data to read, so each step can finish sooner. Smaller weights also free GPU memory for the KV cache, so more users fit at once.
The quality risk
Fewer bytes means rounding, and small rounding errors add up across layers. 8-bit is often close to the original; 4-bit takes more risk. How much quality you lose depends on the model, the method, and the task. Test the tasks your users really run, not just a quick chat.
Weights only, or activations too
Weight-only quantization stores weights in few bits and turns them back into BF16 for the math. It cuts memory and reading, which helps decode most. Activations are the numbers flowing between layers. Quantizing them too, like FP8 for both, lets the GPU do the math in 8-bit, which also speeds up compute-bound prefill.
Kernel and hardware support
A kernel is a small program the GPU runs on many threads at once. Each format needs fast kernels for your GPU. Newer GPUs like the H100 have FP8 math hardware; older ones like the A100 don't. A format with no fast kernel can run slower than plain BF16.
Remember
- Bytes per weight: FP32 4, BF16 2, FP8 or INT8 1, INT4 half.
- Fewer bytes: less memory, less to read per decode step.
- Lower precision can cost quality; test your own tasks.
- Weight-only helps decode; FP8 math also helps prefill.
- No fast kernel, no speedup.