Quantization: PTQ vs. QAT, labels vs. KD, big vs. small
How few bits per weight survive? Does a per-group scale rescue low bits, does quantization-aware training rescue more, and do small models tolerate it worse?
Methods: Post-training quantization, Quantization-aware training, Quantizing a detector

This figure did not load: the file is missing or the connection dropped. Reload the page to try again; the table below has the same numbers.

This figure did not load: the file is missing or the connection dropped. Reload the page to try again; the table below has the same numbers.
Table
Mean over the seeds; ± is the standard deviation where more than one seed ran. The experiment took 237 s.
| Model | Bits / weight | Method | Test accuracy (20-way) | Target-class AP ('bird') | Test NLL | KL(Bayes || model) | Parameters (nonzero) | Storage (kbit) |
|---|---|---|---|---|---|---|---|---|
| teacher 3x256 | 32 | fp32 | 0.914 | 0.989 | 0.384 | 0.309 | 140,052 | 4481.7 |
| teacher 3x256 | 8 | PTQ per-tensor | 0.914 | 0.988 | 0.384 | 0.309 | 137,902 | 1139.4 |
| teacher 3x256 | 8 | PTQ group-16 | 0.914 | 0.989 | 0.384 | 0.309 | 139,129 | 1278.6 |
| teacher 3x256 | 6 | PTQ per-tensor | 0.914 | 0.988 | 0.386 | 0.310 | 131,540 | 860.9 |
| teacher 3x256 | 6 | PTQ group-16 | 0.913 | 0.988 | 0.385 | 0.310 | 136,208 | 1000.1 |
| teacher 3x256 | 4 | PTQ per-tensor | 0.900 | 0.985 | 0.466 | 0.391 | 102,817 | 582.3 |
| teacher 3x256 | 4 | PTQ group-16 | 0.913 | 0.989 | 0.400 | 0.325 | 123,497 | 721.5 |
| teacher 3x256 | 4 | QAT group-16 + labels | 0.918 ± 0.001 | 0.990 ± 0.000 | 0.393 ± 0.002 | 0.323 ± 0.004 | 123,502.5 ± 12.5 | 721.5 |
| teacher 3x256 | 4 | QAT group-16 + KD | 0.920 ± 0.000 | 0.989 ± 0.000 | 0.299 ± 0.002 | 0.222 ± 0.001 | 123,482 ± 15 | 721.5 |
| teacher 3x256 | 3 | PTQ per-tensor | 0.777 | 0.961 | 1.225 | 1.153 | 60,345 | 443.1 |
| teacher 3x256 | 3 | PTQ group-16 | 0.897 | 0.987 | 0.470 | 0.402 | 102,398 | 582.3 |
| teacher 3x256 | 3 | QAT group-16 + labels | 0.916 ± 0.001 | 0.990 ± 0.001 | 0.388 ± 0.003 | 0.315 ± 0.003 | 102,133.5 ± 10.5 | 582.3 |
| teacher 3x256 | 3 | QAT group-16 + KD | 0.919 ± 0.001 | 0.988 ± 0.000 | 0.301 ± 0.002 | 0.221 ± 0.002 | 102,223 | 582.3 |
| teacher 3x256 | 2 | PTQ per-tensor | 0.071 | 0.101 | 3.021 | 2.937 | 3,616 | 303.8 |
| teacher 3x256 | 2 | PTQ group-16 | 0.610 | 0.903 | 2.450 | 2.381 | 44,584 | 443.0 |
| teacher 3x256 | 2 | QAT group-16 + labels | 0.909 ± 0.001 | 0.989 ± 0.000 | 0.367 ± 0.007 | 0.296 ± 0.003 | 44,599.5 ± 26.5 | 443.0 |
| teacher 3x256 | 2 | QAT group-16 + KD | 0.917 ± 0.001 | 0.988 ± 0.001 | 0.282 ± 0.006 | 0.203 ± 0.004 | 45,035.5 ± 73.5 | 443.0 |
| teacher 3x256 | 1 | PTQ per-tensor | 0.401 | 0.693 | 1.950 | 1.870 | 140,052 | 164.5 |
| teacher 3x256 | 1 | PTQ group-16 | 0.436 | 0.693 | 1.816 | 1.736 | 140,052 | 303.7 |
| teacher 3x256 | 1 | QAT group-16 + labels | 0.918 ± 0.001 | 0.992 ± 0.000 | 0.298 ± 0.005 | 0.221 ± 0.005 | 140,052 | 303.7 |
| teacher 3x256 | 1 | QAT group-16 + KD | 0.919 ± 0.000 | 0.992 ± 0.001 | 0.265 ± 0.003 | 0.187 ± 0.000 | 140,052 | 303.7 |
| student 2x32 (KD-trained) | 32 | fp32 | 0.828 | 0.953 | 0.526 | 0.450 | 2,132 | 68.2 |
| student 2x32 (KD-trained) | 8 | PTQ per-tensor | 0.828 | 0.953 | 0.528 | 0.452 | 2,112 | 19.1 |
| student 2x32 (KD-trained) | 8 | PTQ group-16 | 0.828 | 0.953 | 0.527 | 0.450 | 2,118 | 21.1 |
| student 2x32 (KD-trained) | 6 | PTQ per-tensor | 0.824 | 0.952 | 0.541 | 0.465 | 2,037 | 15.0 |
| student 2x32 (KD-trained) | 6 | PTQ group-16 | 0.828 | 0.953 | 0.530 | 0.454 | 2,074 | 17.0 |
| student 2x32 (KD-trained) | 4 | PTQ per-tensor | 0.723 | 0.893 | 0.855 | 0.776 | 1,725 | 10.9 |
| student 2x32 (KD-trained) | 4 | PTQ group-16 | 0.794 | 0.938 | 0.622 | 0.543 | 1,891 | 12.9 |
| student 2x32 (KD-trained) | 4 | QAT group-16 + labels | 0.833 ± 0.001 | 0.963 ± 0.001 | 0.513 ± 0.004 | 0.438 ± 0.004 | 1,909.5 ± 8.500 | 12.9 |
| student 2x32 (KD-trained) | 4 | QAT group-16 + KD | 0.836 ± 0.000 | 0.957 ± 0.001 | 0.503 ± 0.003 | 0.426 ± 0.003 | 1,895 ± 2.000 | 12.9 |
| student 2x32 (KD-trained) | 3 | PTQ per-tensor | 0.485 | 0.821 | 2.193 | 2.114 | 1,267 | 8.880 |
| student 2x32 (KD-trained) | 3 | PTQ group-16 | 0.640 | 0.915 | 1.174 | 1.097 | 1,570 | 10.9 |
| student 2x32 (KD-trained) | 3 | QAT group-16 + labels | 0.791 ± 0.002 | 0.946 ± 0.005 | 0.636 ± 0.004 | 0.558 ± 0.003 | 1,591 ± 6.000 | 10.9 |
| student 2x32 (KD-trained) | 3 | QAT group-16 + KD | 0.791 ± 0.005 | 0.942 ± 0.003 | 0.637 ± 0.007 | 0.556 ± 0.006 | 1,590 ± 3.000 | 10.9 |
| student 2x32 (KD-trained) | 2 | PTQ per-tensor | 0.069 | 0.043 | 9.212 | 9.127 | 285 | 6.832 |
| student 2x32 (KD-trained) | 2 | PTQ group-16 | 0.168 | 0.299 | 8.562 | 8.489 | 772 | 8.832 |
| student 2x32 (KD-trained) | 2 | QAT group-16 + labels | 0.479 ± 0.005 | 0.759 ± 0.031 | 1.663 ± 0.055 | 1.577 ± 0.057 | 805 ± 18 | 8.832 |
| student 2x32 (KD-trained) | 2 | QAT group-16 + KD | 0.488 ± 0.001 | 0.702 ± 0.020 | 1.663 ± 0.014 | 1.579 ± 0.016 | 780.5 ± 4.500 | 8.832 |
| student 2x32 (KD-trained) | 1 | PTQ per-tensor | 0.152 | 0.537 | 4.697 | 4.615 | 2,132 | 4.784 |
| student 2x32 (KD-trained) | 1 | PTQ group-16 | 0.168 | 0.444 | 4.274 | 4.195 | 2,132 | 6.784 |
| student 2x32 (KD-trained) | 1 | QAT group-16 + labels | 0.538 ± 0.004 | 0.709 ± 0.011 | 1.400 ± 0.008 | 1.315 ± 0.008 | 2,132 | 6.784 |
| student 2x32 (KD-trained) | 1 | QAT group-16 + KD | 0.529 ± 0.019 | 0.699 ± 0.043 | 1.427 ± 0.052 | 1.348 ± 0.051 | 2,132 | 6.784 |
Reference points
- Teacher (the large model)
- The full-size network trained on the labeled data; the smaller models here are measured against it. Test accuracy (20-way) 0.914, target-class AP ('bird') 0.989, test NLL 0.384, KL(Bayes || model) 0.309, parameters (nonzero) 140,052.
- Bayes-optimal (the best any model can do on this problem)
- Predictions from the exact class probabilities, which the lab can compute because it generated the data. Test accuracy (20-way) 0.973, target-class AP ('bird') 0.999, test NLL 0.079.
Birds in this experiment
The table's 41 smaller models hatch 6 kinds of bird. Each kind is drawn once, for one model: the smallest if the bird is healthy or bones, the one that keeps the most if it's starving.
- Common Swift, healthyModel: teacher 3x256; bits / weight: 4; method: PTQ group-166.2× smaller, keeps 99.9% of the teacher's accuracyBest of 7 models
- Barn Swallow, healthyModel: teacher 3x256; bits / weight: 2; method: QAT group-16 + labels10.1× smaller, keeps 99.5% of the teacher's accuracyBest of 6 models
- Barn Swallow, starvingModel: teacher 3x256; bits / weight: 3; method: PTQ per-tensor10.1× smaller, keeps 85.0% of the teacher's accuracyBest of 2 models
- Ruby-throated Hummingbird, healthyModel: teacher 3x256; bits / weight: 1; method: QAT group-16 + labels14.7× smaller, scores 100.4% of the teacher's accuracyBest of 2 models
- Ruby-throated Hummingbird, starvingModel: student 2x32 (KD-trained); bits / weight: 4; method: QAT group-16 + KD346.6× smaller, keeps 91.5% of the teacher's accuracyBest of 12 models
- Ruby-throated Hummingbird, skeletonModel: student 2x32 (KD-trained); bits / weight: 1; method: PTQ per-tensor936.8× smaller, keeps 16.7% of the teacher's accuracyBest of 12 models
Measured against this experiment's teacher: 140,052 parameters, 4481.7 kbit, accuracy 0.914. Storage is the table's own column. Species follows how many times smaller a model is. A bird stays healthy while its model keeps at least 95% of the reference's score, and turns to bones at 60% or less.
These are the lab's recorded results, so they aren't added to anyone's life list. Birds you hatch yourself, in the Coop or from a Field Guide run, are saved to your life list.