Open Agent School · Public worked example

Quantization: meaning and example

Welcome! Take one idea with you today.

Quantization represents numerical values using a smaller set of levels, often reducing the bits used for model weights or activations. Values are scaled, rounded, and sometimes clipped to fit a representable range. A reconstructed value is an approximation, not generally the original number.

Picture it: A warehouse wants a local model to fit on a constrained device. You compare two precision settings on invented weights, then plan real measurements for item extraction, latency, and peak memory. Rare item codes matter more than a small average numerical error suggests.

What is easy to mix up?

Numerical error and task quality measure different things. Sensitivity varies by layer, input, and task; evaluate the actual outputs, especially important rare cases.

Teaching example by Open Agent School. Source: Jacob et al. - Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference.