PigeonColumba compressa

Distilling from the true posterior

If the teacher's soft labels were perfect (the exact Bayes posterior), how much better would students get? This bounds what any teacher can give.

Methods: The perfect teacher

Line chart of test accuracy (20-way) against hidden width (log scale), one line per method, with a dashed reference line for the teacher and the Bayes-optimal classifier. Titled “Distilling from the true posterior”. The numbers are in the table below.
Test accuracy (20-way) against hidden width
Line chart of KL(Bayes || model) against hidden width (log scale), one line per method. Titled “Distilling from the true posterior”. The numbers are in the table below.
KL(Bayes || model) against hidden width

Table

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

Hidden widthMethodTest accuracy (20-way)Target-class AP ('bird')Agreement with teacherTest NLLKL(Bayes || model)Parameters (nonzero)
8labels only (scratch)0.443 ± 0.0150.691 ± 0.0300.450 ± 0.0161.634 ± 0.0271.550 ± 0.027356
8KD from trained teacher0.456 ± 0.0150.740 ± 0.0330.464 ± 0.0181.603 ± 0.0281.519 ± 0.029356
8KD from Bayes posterior0.458 ± 0.0140.739 ± 0.0320.465 ± 0.0151.601 ± 0.0271.517 ± 0.029356
8Bayes-argmax labels on all 28k inputs0.456 ± 0.0130.738 ± 0.0310.464 ± 0.0151.603 ± 0.0261.519 ± 0.027356
16labels only (scratch)0.664 ± 0.0090.843 ± 0.0050.674 ± 0.0101.018 ± 0.0270.936 ± 0.028820
16KD from trained teacher0.671 ± 0.0080.862 ± 0.0020.684 ± 0.0060.991 ± 0.0230.909 ± 0.023820
16KD from Bayes posterior0.677 ± 0.0070.863 ± 0.0080.685 ± 0.0040.977 ± 0.0260.894 ± 0.026820
16Bayes-argmax labels on all 28k inputs0.673 ± 0.0070.856 ± 0.0080.681 ± 0.0070.985 ± 0.0320.903 ± 0.031820
32labels only (scratch)0.817 ± 0.0010.952 ± 0.0050.831 ± 0.0030.554 ± 0.0080.476 ± 0.0082,132
32KD from trained teacher0.832 ± 0.0050.954 ± 0.0050.845 ± 0.0050.511 ± 0.0130.433 ± 0.0152,132
32KD from Bayes posterior0.840 ± 0.0030.959 ± 0.0050.845 ± 0.0030.488 ± 0.0070.409 ± 0.0092,132
32Bayes-argmax labels on all 28k inputs0.838 ± 0.0020.959 ± 0.0060.842 ± 0.0030.495 ± 0.0080.417 ± 0.0102,132
64labels only (scratch)0.882 ± 0.0010.980 ± 0.0020.901 ± 0.0020.363 ± 0.0030.286 ± 0.0016,292
64KD from trained teacher0.896 ± 0.0010.983 ± 0.0020.916 ± 0.0010.316 ± 0.0030.238 ± 0.0026,292
64KD from Bayes posterior0.909 ± 0.0030.988 ± 0.0020.910 ± 0.0000.272 ± 0.0030.194 ± 0.0026,292
64Bayes-argmax labels on all 28k inputs0.908 ± 0.0020.988 ± 0.0020.907 ± 0.0010.282 ± 0.0040.206 ± 0.0036,292
128labels only (scratch)0.904 ± 0.0020.988 ± 0.0010.932 ± 0.0010.328 ± 0.0080.255 ± 0.01020,756
128KD from trained teacher0.916 ± 0.0000.989 ± 0.0000.947 ± 0.0010.267 ± 0.0020.190 ± 0.00120,756
128KD from Bayes posterior0.938 ± 0.0010.995 ± 0.0000.931 ± 0.0020.188 ± 0.0010.110 ± 0.00120,756
128Bayes-argmax labels on all 28k inputs0.933 ± 0.0000.995 ± 0.0000.929 ± 0.0020.206 ± 0.0020.131 ± 0.00220,756

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 20 smaller models hatch 4 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 32 bits a parameter, the lab's rule for a dense fp32 net, which every model drawn here is. 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.