What Is Model Distillation and Why Does It Matter?
.png)
The most capable language models are often huge, which makes them expensive and slow to run. For many production uses that cost is hard to justify, especially when a smaller model would be good enough if only it were a little smarter. Model distillation is the technique that closes that gap by teaching a small model to behave like a large one.
The idea is to treat a large, well-trained model as a teacher and use it to train a smaller student. Rather than learning only from the original dataset, the student learns from the teacher's behavior, absorbing patterns that would be hard to pick up from raw labels alone. The result is a compact model that punches well above its size.
This guide explains what model distillation is, how it works, how it compares to other compression methods, and when it is the right tool.
What is model distillation?
Model distillation is a training method in which a smaller student model is trained to reproduce the outputs of a larger teacher model. Instead of learning only from the hard labels in a dataset, the student also learns from the teacher's full output distribution, the soft probabilities the teacher assigns across possible answers, which carry richer information about how the teacher generalizes.

Think of it like an apprentice learning from a master. The apprentice could study the raw material alone, but learning by watching an expert work, seeing not just the final answer but the relative confidence behind each choice, transfers skill much faster. The student model picks up the teacher's judgment, compressed into a smaller form.
The key idea is that the teacher's soft outputs are a far richer training signal than plain labels. They tell the student which answers are close to correct and which are clearly wrong, letting a small model learn nuanced behavior it could not easily discover on its own.
How does model distillation work?
The process runs the teacher over training data and uses its outputs to supervise the student.

- Train the teacher. Start with a large, high-quality model, or use an existing one.
- Generate targets. Run the teacher over input data to produce soft outputs or generated responses.
- Train the student. Train the smaller model to match the teacher's outputs on that data.
- Combine signals. Often blend the teacher's outputs with the true labels to keep accuracy grounded.
- Evaluate and deploy. Check that the student keeps enough quality, then serve it in place of the teacher.
For language models, distillation often takes the form of generating a large set of teacher responses and fine-tuning the student on them. This transfers much of the teacher's capability on the tasks that matter, producing a model that is far cheaper to run while staying close in quality.
Distillation vs. other compression methods

Distillation is one of several ways to make models smaller. Quantization reduces the numerical precision of a model's weights, shrinking it without changing its structure. Pruning removes weights or whole components that contribute little. Distillation is different: it trains a new, smaller model from scratch to imitate a larger one, so the student can have an entirely different architecture.
These methods are complementary. A model can be distilled into a smaller student and then quantized for further savings. Distillation tends to preserve quality best when a large size reduction is needed, because the student is trained specifically to reproduce the teacher's behavior rather than mechanically compressed.
Why does model distillation matter?
- Lower cost. Smaller students use less compute and memory to serve.
- Faster inference. Compact models generate responses with lower latency.
- Edge deployment. Distilled models can run on constrained or on-device hardware.
- Capability transfer. A small model inherits much of a large model's skill.
- Scalability. Cheaper models make high-volume applications economically viable.
What are the tradeoffs?
- Quality gap. The student rarely matches the teacher exactly, especially on edge cases.
- Training effort. Distillation requires running the teacher and training the student.
- Task scope. A student tuned to the teacher's behavior on some tasks may not generalize to others.
- Teacher dependence. The student can only be as good as the teacher it learns from.
When should you use distillation?
Reach for distillation when you have a capable model that is too expensive or slow to serve at the scale you need, and a smaller model alone falls short on quality. It is especially valuable for high-traffic production applications where inference cost dominates and latency matters.
If a small model already meets your quality bar, distillation is unnecessary. And if you need the absolute best quality regardless of cost, the full teacher may be the right choice. Distillation shines in the common middle ground, where you want most of a large model's quality at a small model's cost.
Best practices for model distillation
- Use a strong, well-aligned teacher, since the student inherits its behavior.
- Distill on data that matches your production tasks and distribution.
- Blend teacher outputs with ground-truth labels to keep the student grounded.
- Evaluate the student on real tasks, not just aggregate benchmarks.
- Consider combining distillation with quantization for extra savings.
- Re-distill when the teacher is updated to keep the student current.
Conclusion
Model distillation transfers the knowledge of a large teacher model into a smaller student, which learns by matching the teacher's outputs. The result is a compact model that keeps much of the teacher's quality while being cheaper and faster to serve. It is one of the most effective ways to deploy capable models under real-world cost and latency constraints.
TrueFoundry helps teams fine-tune, distill, and serve models efficiently on their own infrastructure, so a distilled student can go from training to production in one place. When cost and speed matter as much as quality, distillation is a core technique for getting there.

Gouvernez, déployez et suivez l'IA dans votre propre infrastructure
Frequently Asked Questions
What is model distillation in simple terms?
It means training a small model to mimic a larger one. The larger model becomes the teacher, while the small model is the student that learns from it, retaining much of the quality while saving money and time.
How is distillation different from quantization?
Quantization reduces the numerical precision of an already-built model's weights to shrink it. Distillation involves training a new, smaller model to mimic a larger one. They can be combined: start by distilling the model, then quantize the student for further savings.
Does a distilled model match the teacher's quality?
Generally similar, but not quite. A good student retains the bulk of the teacher's ability on the tasks it was distilled for, while remaining significantly more compact. The difference generally arises on exceptional cases the student has trouble with.
What are soft targets in distillation?
These are the teacher's full probability distribution over possible answers, not just the single correct label. They help the student realize what is a good guess and what is a bad one, a more informative signal that allows the model to learn more subtle behavior.
When should I distill a model instead of using a small one directly?
In cases where the small model falls short of the required level of quality while using the large model would be too expensive or slow, distillation helps transfer the capabilities of the large model into the small one, enabling the attainment of most of the quality at a much lower serving cost.

GenAI infra- simple, plus rapide et moins cher
Les meilleures équipes lui font confiance pour faire évoluer GenAI















