What is quantisation error?
Quantisation error is the difference between a value and its low-bit quantised representation; these small differences in weights and activations accumulate across layers and can change a model's output and performance.
This cost of quantisation has two parts: rounding error from rounding in-range values to the nearest level and clipping error from pulling out-of-range values to the limit. Widening the range reduces clipping but increases rounding; good quantisation balances them.
- Topic
- Machine learning, models and training
- Also known as
- Quantization error, quantisation noise
How quantisation error works
- A tensor's value range is chosen and divided into a limited number of levels; fewer bits mean sparser levels.
- Each value rounds to the nearest level; out-of-range values are clipped to the limit.
- Error is measured in layer outputs, model metrics such as perplexity and task performance.
- Methods such as per-group scales, separate outlier handling and quantisation-aware training reduce it.
In more detail
Step size, rounding bound and calibration
In uniform quantisation the step size is the range width divided by one less than the number of levels; rounding error inside the range is at most half a step and, for small steps, behaves like uniform noise with a variance of one twelfth of the squared step size. Minimising total error means balancing rounding against clipping, often with percentile thresholds or KL divergence calibration instead of raw minimum and maximum values.
Symmetric and asymmetric quantisation, zero point and group size
Symmetric quantisation maps zero to zero using a single scale factor, simplifying hardware integer arithmetic, whereas asymmetric quantisation adds a zero-point offset to fit skewed distributions such as post-ReLU activations. In addition, block-wise or group-wise scaling (such as group size 64 or 128) isolates local ranges at the cost of small metadata overhead per group.
Why quantisation error matters for on-premises AI
Quantisation error is the quality price of running models on smaller hardware in-house and must be measured per model and task. A technical guide to quantisation notes the noise it adds can degrade accuracy, post-training quantisation usually suffices at 8 bits and quantisation-aware training gives competitive results at lower bit widths; for large language models, 4-bit weight-only quantisation often works well without retraining. Even when average metrics drop slightly, error can be more marked on numerical calculation, long context or Turkish.
An insurer finds its 4-bit quantised model close to the original on general metrics but sees the gap widen on questions involving premium calculation; it decides to use the 8-bit version for that task.
Common questions
How is quantisation error measured?
By differences in layer outputs, model metrics such as perplexity and, above all, the performance gap on the organisation's own task set.
How is quantisation error reduced?
With finer group scaling, separate outlier handling, representative calibration and, if needed, quantisation-aware training.
Related terms
- Quantisation
- Numerical precision
- Calibration dataset
- Activation quantisation
- Quantisation-aware training
- Static quantisation
Sources
- Nagel et al., A White Paper on Neural Network Quantization, 2021
- Jacob et al., Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference, 2018
In the glossary: Glossary, M to Q