Optimization✓ Mathematical
◆ The PatternFP32 → INT8 — trading precision for speed
Quantization reduces weight precision from 32-bit floats to 16-bit or 8-bit integers. Post-training quantization (PTQ) is the quick path — just convert. Quantization-aware training (QAT) simulates low precision during training for better accuracy at INT8.
Memory ∝ bits × parameters
INT8 uses 4× less memory than FP32, enabling larger batch sizes and faster inference.
// Interactive — precision vs accuracy vs speed
| Method | Accuracy Impact | Speed Gain |
|---|---|---|
| FP16 (half precision) | Negligible | ~2× |
| PTQ INT8 | 0.5–2% drop | ~3× |
| QAT INT8 | <0.5% drop | ~3× |
| INT4 (experimental) | Variable | ~5× |
Pattern bridge: Quantization trades precision for speed — the same tradeoff as sampling temperature in LLMs (precision vs diversity) or timeframe compression in charts (detail vs overview).