PigeonColumba compressa

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

Line chart of test accuracy (20-way) against bits / weight (log scale), one line per configuration. Titled “teacher”. The numbers are in the table below.
Test accuracy (20-way) against bits / weight: teacher
Line chart of test accuracy (20-way) against bits / weight (log scale), one line per configuration. Titled “small student”. The numbers are in the table below.
Test accuracy (20-way) against bits / weight: small student

Table

Mean over the seeds; ± is the standard deviation where more than one seed ran. The experiment took 237 s.

ModelBits / weightMethodTest accuracy (20-way)Target-class AP ('bird')Test NLLKL(Bayes || model)Parameters (nonzero)Storage (kbit)
teacher 3x25632fp320.9140.9890.3840.309140,0524481.7
teacher 3x2568PTQ per-tensor0.9140.9880.3840.309137,9021139.4
teacher 3x2568PTQ group-160.9140.9890.3840.309139,1291278.6
teacher 3x2566PTQ per-tensor0.9140.9880.3860.310131,540860.9
teacher 3x2566PTQ group-160.9130.9880.3850.310136,2081000.1
teacher 3x2564PTQ per-tensor0.9000.9850.4660.391102,817582.3
teacher 3x2564PTQ group-160.9130.9890.4000.325123,497721.5
teacher 3x2564QAT group-16 + labels0.918 ± 0.0010.990 ± 0.0000.393 ± 0.0020.323 ± 0.004123,502.5 ± 12.5721.5
teacher 3x2564QAT group-16 + KD0.920 ± 0.0000.989 ± 0.0000.299 ± 0.0020.222 ± 0.001123,482 ± 15721.5
teacher 3x2563PTQ per-tensor0.7770.9611.2251.15360,345443.1
teacher 3x2563PTQ group-160.8970.9870.4700.402102,398582.3
teacher 3x2563QAT group-16 + labels0.916 ± 0.0010.990 ± 0.0010.388 ± 0.0030.315 ± 0.003102,133.5 ± 10.5582.3
teacher 3x2563QAT group-16 + KD0.919 ± 0.0010.988 ± 0.0000.301 ± 0.0020.221 ± 0.002102,223582.3
teacher 3x2562PTQ per-tensor0.0710.1013.0212.9373,616303.8
teacher 3x2562PTQ group-160.6100.9032.4502.38144,584443.0
teacher 3x2562QAT group-16 + labels0.909 ± 0.0010.989 ± 0.0000.367 ± 0.0070.296 ± 0.00344,599.5 ± 26.5443.0
teacher 3x2562QAT group-16 + KD0.917 ± 0.0010.988 ± 0.0010.282 ± 0.0060.203 ± 0.00445,035.5 ± 73.5443.0
teacher 3x2561PTQ per-tensor0.4010.6931.9501.870140,052164.5
teacher 3x2561PTQ group-160.4360.6931.8161.736140,052303.7
teacher 3x2561QAT group-16 + labels0.918 ± 0.0010.992 ± 0.0000.298 ± 0.0050.221 ± 0.005140,052303.7
teacher 3x2561QAT group-16 + KD0.919 ± 0.0000.992 ± 0.0010.265 ± 0.0030.187 ± 0.000140,052303.7
student 2x32 (KD-trained)32fp320.8280.9530.5260.4502,13268.2
student 2x32 (KD-trained)8PTQ per-tensor0.8280.9530.5280.4522,11219.1
student 2x32 (KD-trained)8PTQ group-160.8280.9530.5270.4502,11821.1
student 2x32 (KD-trained)6PTQ per-tensor0.8240.9520.5410.4652,03715.0
student 2x32 (KD-trained)6PTQ group-160.8280.9530.5300.4542,07417.0
student 2x32 (KD-trained)4PTQ per-tensor0.7230.8930.8550.7761,72510.9
student 2x32 (KD-trained)4PTQ group-160.7940.9380.6220.5431,89112.9
student 2x32 (KD-trained)4QAT group-16 + labels0.833 ± 0.0010.963 ± 0.0010.513 ± 0.0040.438 ± 0.0041,909.5 ± 8.50012.9
student 2x32 (KD-trained)4QAT group-16 + KD0.836 ± 0.0000.957 ± 0.0010.503 ± 0.0030.426 ± 0.0031,895 ± 2.00012.9
student 2x32 (KD-trained)3PTQ per-tensor0.4850.8212.1932.1141,2678.880
student 2x32 (KD-trained)3PTQ group-160.6400.9151.1741.0971,57010.9
student 2x32 (KD-trained)3QAT group-16 + labels0.791 ± 0.0020.946 ± 0.0050.636 ± 0.0040.558 ± 0.0031,591 ± 6.00010.9
student 2x32 (KD-trained)3QAT group-16 + KD0.791 ± 0.0050.942 ± 0.0030.637 ± 0.0070.556 ± 0.0061,590 ± 3.00010.9
student 2x32 (KD-trained)2PTQ per-tensor0.0690.0439.2129.1272856.832
student 2x32 (KD-trained)2PTQ group-160.1680.2998.5628.4897728.832
student 2x32 (KD-trained)2QAT group-16 + labels0.479 ± 0.0050.759 ± 0.0311.663 ± 0.0551.577 ± 0.057805 ± 188.832
student 2x32 (KD-trained)2QAT group-16 + KD0.488 ± 0.0010.702 ± 0.0201.663 ± 0.0141.579 ± 0.016780.5 ± 4.5008.832
student 2x32 (KD-trained)1PTQ per-tensor0.1520.5374.6974.6152,1324.784
student 2x32 (KD-trained)1PTQ group-160.1680.4444.2744.1952,1326.784
student 2x32 (KD-trained)1QAT group-16 + labels0.538 ± 0.0040.709 ± 0.0111.400 ± 0.0081.315 ± 0.0082,1326.784
student 2x32 (KD-trained)1QAT group-16 + KD0.529 ± 0.0190.699 ± 0.0431.427 ± 0.0521.348 ± 0.0512,1326.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.

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.