Model Quantization Trade-offs
Compare FP32, FP16, INT8, and INT4 deployment choices for edge inference.
Model Quantization Trade-offs
Move a trained model from FP32 into lower precision formats and watch the deployment trade-off change. Smaller weights usually reduce memory traffic, but accuracy and speed only improve when calibration data, task tolerance, and hardware kernels line up.
Weights and activations must share scale factors, so outliers can compress useful signal into fewer integer codes.
A million FP32 weights are about 4 MB before framework metadata; a million INT8 weights are about 1 MB plus scales.
Post-training quantization needs activation examples that cover the real sensor distribution, including rare but valid inputs.
INT8 and INT4 speedups depend on kernels, memory layout, accelerator support, and dequantization overhead.
INT8 deployment candidate
INT8 usually gives the first practical edge deployment target: about four times smaller than FP32 weights, with accuracy risk controlled by calibration and validation.
4.0x smaller than FP32.
2.6x faster in this target model.
Estimated loss is 0.8 points.
Per inference teaching estimate.
The model weights fit flash and the estimated activation arena fits RAM.
Post-training INT8 is plausible, but rare sensor inputs should be represented in calibration data.
The latency estimate uses a speedup because the target has a matching integer path.
Format Comparison
The table is computed from the same model settings above. Treat latency and energy as planning estimates until the real runtime, compiler, memory layout, and accelerator path are measured.
| Format | Weight size | Latency | Accuracy estimate | Best interpretation |
|---|---|---|---|---|
| FP32 | 1.12 MB | 48 ms | 95.0% | Reference accuracy and largest memory footprint. |
| FP16 | 0.56 MB | 34 ms | 94.9% | Good when FP16 kernels are native and accuracy must stay close. |
| INT8 | 0.28 MB | 18 ms | 94.2% | Common edge deployment target after calibration and validation. |
| INT4 | 0.14 MB | 15 ms | 92.1% | Useful for extreme memory pressure when the model tolerates it. |
Technical Accuracy Notes
- Quantization can reduce weight memory almost in proportion to bit width, but scales, zero points, alignment, and framework metadata add overhead.
- Lower precision can reduce latency by moving less data and using vectorized integer math, but only when kernels or accelerators actually support that format.
- Post-training quantization is sensitive to calibration coverage. Outliers and shifted sensor distributions can increase error even when average validation accuracy looks acceptable.
- Quantization-aware training often helps INT4 and sensitive tasks, but it adds training cost and still requires validation on target data.
Formula Trace
The numbers are planning estimates for comparing choices, not hardware benchmarks.
Measure the quantized model on a held-out set that includes low light, noise, rare classes, or other field conditions.
Budget both flash for weights and RAM for activations, temporary buffers, runtime arena, and input windows.
Do not quote an INT8 or INT4 speedup without naming the target hardware path; packed integers can be smaller but slower on the wrong runtime.
Related Learning
Use these next when quantization interacts with edge placement, latency budgets, and sensor signal quality.