DistilBERT: Distilling BERT into a Model 40% Smaller and 60% Faster
NeurIPS 2019 EMC² Workshop · arXiv 1910.01108
An engineering dissection of DistilBERT — a general-purpose language model distilled from BERT during pre-training that is 40% smaller, 60% faster, and retains 97% of BERT's GLUE performance. Covers knowledge distillation and soft targets, the softmax-temperature that exposes the teacher's dark knowledge, the triple loss (distillation + masked-LM + cosine embedding), why the student halves layers rather than hidden width, initializing the student from every other teacher layer, the training recipe (large batches, dynamic masking, no NSP), and the ablation showing initialization matters most.
- Distills during pre-training, not per task: one general-purpose student that fine-tunes on any downstream task — 40% fewer parameters (66M vs 110M), 60% faster, 97% of BERT's GLUE score retained
- A triple loss combines the distillation soft-target cross-entropy, the masked-LM loss, and a cosine-embedding loss that aligns the student's hidden-state directions with the teacher's
- The softmax-temperature is the key to distillation: heating the logits exposes the teacher's 'dark knowledge' — the informative near-zero probabilities a one-hot label throws away
- The ablation is the lesson: initializing the student from every other teacher layer matters more than any single loss term (-3.69 GLUE if random), while dropping the masked-LM loss barely hurts (-0.31)