PigeonColumba compressa

Weight sharing (k-means codebooks) vs. uniform bits

Deep-Compression style: each layer keeps only k distinct values. At the same bits/weight, does a learned, non-uniform codebook beat uniform rounding?

Methods: Weight sharing (k-means codebooks)

Line chart of test accuracy (20-way) against bits / weight, 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, one line per configuration. Titled “student”. The numbers are in the table below.
Test accuracy (20-way) against bits / weight: student

Note: Both schemes store b bits per weight: k-means has k = 2^b levels per layer, symmetric uniform has 2^b - 1 (1 bit = sign x mean|w|, i.e. 2 levels).

Table

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

ModelBits / weightMethodTest accuracy (20-way)Target-class AP ('bird')Test NLLKL(Bayes || model)Parameters (nonzero)
teacher 3x2561uniform (per-tensor)0.4010.6931.9501.870140,052
teacher 3x2561k-means codebook0.4000.7131.8411.758140,052
teacher 3x2561k-means + KD + re-snap0.4430.7311.7511.670140,052
teacher 3x2562uniform (per-tensor)0.0710.1013.0212.9373,616
teacher 3x2562k-means codebook0.8490.9790.5310.457140,052
teacher 3x2562k-means + KD + re-snap0.8830.9840.3610.281140,052
teacher 3x2563uniform (per-tensor)0.7770.9611.2251.15360,345
teacher 3x2563k-means codebook0.9040.9830.4040.330140,052
teacher 3x2563k-means + KD + re-snap0.9180.9880.2780.199140,052
teacher 3x2564uniform (per-tensor)0.9000.9850.4660.391102,817
teacher 3x2564k-means codebook0.9090.9870.4010.328140,052
teacher 3x2564k-means + KD + re-snap0.9210.9880.2780.200140,052
teacher 3x2565uniform (per-tensor)0.9130.9880.3900.317122,323
teacher 3x2565k-means codebook0.9130.9880.3910.316140,052
teacher 3x2565k-means + KD + re-snap0.9200.9900.2880.208140,052
student 2x321uniform (per-tensor)0.1520.5374.6974.6152,132
student 2x321k-means codebook0.1870.2894.4204.3402,132
student 2x321k-means + KD + re-snap0.1980.2744.2844.2042,132
student 2x322uniform (per-tensor)0.0690.0439.2129.127285
student 2x322k-means codebook0.4560.7142.3502.2732,132
student 2x322k-means + KD + re-snap0.4640.7352.3312.2542,132
student 2x323uniform (per-tensor)0.4850.8212.1932.1141,267
student 2x323k-means codebook0.6450.8461.1511.0712,132
student 2x323k-means + KD + re-snap0.6680.8611.0921.0132,132
student 2x324uniform (per-tensor)0.7230.8930.8550.7761,725
student 2x324k-means codebook0.7840.9480.6510.5732,132
student 2x324k-means + KD + re-snap0.7840.9480.6520.5752,132
student 2x325uniform (per-tensor)0.8130.9490.5680.4941,950
student 2x325k-means codebook0.8150.9510.5600.4822,132
student 2x325k-means + KD + re-snap0.8270.9560.5270.4492,132

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.