Compression / Optimization
verifiedQuantization-Aware Training
Rather than quantise a finished model and hope, train with the rounding in the loop so the model learns weights that survive it. It costs a training run and reaches lower bit widths than post-training methods can — which matters below four bits, where simply rounding a trained model stops working.
Rounding has zero gradient almost everywhere, so training uses a straight-through estimator: quantise on the forward pass, pretend the operation was the identity on the backward one. That is an approximation nobody defends as exact, and it works, which is worth being uncomfortable about. The practical rule is that QAT is worth its cost only when the target precision is below what post-training quantisation already reaches.
Forward with ŵ = round(w/s)·s, backward with ∂ŵ/∂w ≈ 1 inside the representable range and 0 outside it. The estimator is biased, and the bias is what the model adapts to — training does not remove the rounding error, it finds weights where the error costs less.
Loss over 2000 training steps, starting near 7.2. It falls to about 1.94, with 92% of the total improvement arriving in the first half. A second line shows held-out, ending higher at about 2.14.
Loss in full precision against loss once the rounding is applied. Drag the quantisation severity up to watch the two separate — training with the gap in the loop is what pulls the second curve back down.
Reviewed by opendroid · 2026-08-18
- arXiv:2103.13630 — A Survey of Quantization Methods for Efficient Neural Network Inference