Skip to content
AI & Machine Learning

Model Distillation

Definition

Model distillation trains a smaller student model to imitate a larger teacher model's outputs, producing a model that is cheaper and faster to run while keeping much of the teacher's quality.

Diagram

How model distillation worksA large teacher model answers many examples. Its answers, including how confident it was in each option, become training data for a much smaller student model, which learns to give similar answers at a fraction of the size and cost.Teacherlarge, slow, costlyTEACHER’S ANSWERSshoes82%boots14%bags4%train onStudentsmall, fastThe student learns from the teacher’s full answer, including how sure it was, not just the top label.
Distillation works best for a narrow task, where a small model can match the big one closely. Check the student on the hard and rare cases, which is usually where it falls behind, and keep a route to the teacher for those.

Case study

Worked example