Model Distillation
What is Model Distillation?
Model distillation is a technique for training a smaller, cheaper AI model to reproduce the behavior of a larger model on specific tasks, by learning from the larger model's outputs.
Updated November 2026 · 2 min read
Model distillation is a way to cut AI costs by having a compact model learn to imitate a large, expensive one, so a business gets similar answers on its specific tasks for a fraction of the compute. The large model, called the teacher, generates outputs for many examples. The small model, called the student, is trained to reproduce those outputs. The result is a model that is much cheaper and faster to run, while performing close to the teacher on the tasks it was trained for.
The technique was popularized and named in a 2015 paper by Geoffrey Hinton, Oriol Vinyals and Jeff Dean, "Distilling the Knowledge in a Neural Network," which showed that a student could learn more from a teacher's full probability outputs than from correct answers alone. Distillation is now widely used by model developers to create smaller versions of their models, and by organizations to build cheap, specialized models for high-volume tasks.
How it works in practice
- Choose the task, such as classifying support tickets or extracting invoice data.
- Collect inputs: a large, representative set of real examples.
- Generate teacher outputs: run the large model on each input, often at batch rates.
- Check quality: review a sample of teacher outputs and remove errors.
- Train the student on the input-output pairs, using fine-tuning.
- Evaluate the student against a held-out test set and the teacher.
- Deploy, often with a fallback to the teacher for cases the student handles poorly.
When is distillation worth it?
Distillation has an upfront cost, mainly generating teacher outputs and training, and an ongoing saving on every request. It pays off when volume is high and the task is narrow and stable. For a few thousand requests a month, it is rarely worth the effort. For millions, it can cut inference costs by an order of magnitude.
An example
Consider a hypothetical e-commerce company that uses a large model to write short product attribute tags for 2 million new listings a month. It distills the task into a small model: it runs the large model on 50,000 historical listings, has staff check a sample of 1,000 and correct the error patterns they find, trains the small model on the cleaned outputs and tests on 5,000 held-out listings. The student matches the teacher on 96% of tags and runs at about a twentieth of the cost per listing. Listings where the student's confidence is low, about 4%, are sent to the large model.
Limits and considerations
- The student is narrower. It performs well on the distilled task, not in general.
- It inherits the teacher's errors.
- Terms of service: some model providers prohibit using their outputs to train competing models. Check before distilling from a commercial API.
- Drift: if the task changes, the student needs retraining.
Distillation is a key technique for building small language models and a strong lever in inference optimization.
Frequently asked questions
How does model distillation work in practice?
Pick a narrow task and collect many real inputs. Run the large teacher model on them, often at batch rates, review a sample and remove errors, then fine-tune the small student model on the input-output pairs. Test the student against held-out data and the teacher, and deploy it with a fallback to the teacher for difficult cases.
When is model distillation worth the effort?
Model distillation pays off when volume is high and the task is narrow and stable. It has an upfront cost for generating teacher outputs and training, then saves money on every request. For a few thousand requests a month it is rarely worth it. At millions of requests, it can cut inference costs by an order of magnitude.
Can you distill a model from a commercial AI provider's outputs?
Check the provider's terms first. Some model providers prohibit using their outputs to train competing models, so model distillation from a commercial API may break its terms of service. Review the terms that apply to any teacher model before generating training data, and remember that the student will inherit the teacher's errors as well as its strengths.
Related terms
Batch Inference
Processing many requests together, without waiting, at a much lower price.
Fine-Tuning
Further training an existing model on task-specific data to improve it.
Small Language Models
Compact models that cost far less to run and suit narrower tasks.
Inference Optimization
Making models faster and cheaper to run without losing too much quality.