Small but Mighty: The Art of Model Distillation
A frontier model is extraordinary and impractical at the same time: too large, too slow, and too expensive to run everywhere you actually want intelligence to live. So researchers borrowed an old idea from teaching. If you cannot deploy the expert into every room, train a smaller, faster model to imitate it. The technique is called knowledge distillation, and it is quietly behind a huge share of the AI running on phones, in products, and inside cost-conscious systems today.
What is model distillation?
Model distillation is a method for transferring the capability of a large, powerful model into a much smaller one. The large model is called the teacher, and the small one is the student. Instead of training the student from scratch on raw data alone, you train it to reproduce the teacher’s behavior, so it inherits a surprising amount of the teacher’s skill in a fraction of the footprint.
The payoff is practical: a distilled model can be ten or a hundred times smaller than its teacher while keeping most of the useful quality. That is the difference between a model that only runs in a data center and one that fits on a phone or responds cheaply at massive scale.
Learning from the teacher, not just the textbook
The clever part is what the student learns from. If you only trained it on final answers, right or wrong, you would throw away most of what the teacher knows. Distillation instead lets the student learn from the teacher’s full, nuanced judgment: not just the chosen answer, but how confident the teacher was across all the alternatives it considered.
Those richer signals are often called soft labels. A hard label says the answer is cat. A soft label says the teacher thought it was most likely cat, slightly possibly dog, and almost certainly not car. That shading carries real information about how the teacher reasons, and it is why a well-distilled student can punch far above its size.
You cannot ship the professor to every classroom. So you train a brilliant student to carry the lesson.
How distillation works, step by step
The exact recipes vary, but the core loop is consistent across most distillation projects.
- Start with a capable teacher, a large model that already performs the task well.
- Feed it a large set of inputs and record its outputs, including the soft probabilities, not just the top answer.
- Train a smaller student model to match those outputs as closely as it can.
- Evaluate the student against the teacher on real tasks to see how much quality was preserved.
- Iterate on data, size, and training until the student hits the right balance of quality, speed, and cost.
The art lives in that last step. Make the student too small and it cannot absorb the teacher’s skill. Make it too large and you lose the efficiency you were chasing. Finding the sweet spot for a specific task is where distillation stops being a formula and becomes engineering judgment.
Why it is everywhere
Distillation shows up constantly because it solves the problem every AI product eventually faces: the best model is too expensive to run the way you want to run it.
- It makes AI cheap enough to run at scale, cutting the cost of every single request.
- It makes models small enough to live on a phone or inside a product, with no round trip to a server.
- It cuts latency, so answers arrive fast enough for real-time use.
- It keeps most of the quality while shedding most of the cost, which is the whole point.
- It can specialize, distilling a general giant into a focused student that does one job extremely well.
Distillation, quantization, and pruning: how they differ
Distillation is one of several ways to make models smaller and faster, and it is easy to confuse them. They are complementary, not competing, and serious deployments often stack them.
- Distillation trains a new, smaller model to imitate a larger one, so it changes the model itself.
- Quantization keeps the same model but stores its numbers at lower precision, shrinking memory and speeding math.
- Pruning removes parts of a model that contribute little, trimming it down without a separate student.
Because they attack size from different angles, you can distill a model, then quantize the result, then prune it further. Each step chips away at cost, and together they are how a lab-grade model becomes something that runs on everyday hardware.
Common pitfalls to avoid
- Expecting zero quality loss. A student usually trades a little accuracy for a lot of efficiency, so measure what you can afford to lose.
- Too little distillation data. The student learns from the teacher’s outputs, so a thin dataset leaves big gaps in its skill.
- Distilling the wrong teacher. A mediocre teacher produces a mediocre student, since the student can only inherit what the teacher knows.
- Skipping task-specific evaluation. A student that matches the teacher on average can still fail badly on the cases you care about most.
Frequently asked questions
What is knowledge distillation in machine learning?
It is a technique where a small student model is trained to imitate a larger teacher model. The student learns from the teacher’s detailed outputs, including how confident it was across options, which lets a compact model capture much of a large model’s capability at a fraction of the size and cost.
Does a distilled model lose accuracy?
Usually a little, but far less than its size reduction would suggest. A well-distilled student can keep most of the teacher’s quality while being many times smaller and faster. The right question is whether the small accuracy trade is worth the large savings in cost and latency, which for most products it is.
What is the difference between distillation and quantization?
Distillation creates a new, smaller model that imitates a larger one, changing the model’s structure. Quantization keeps the same model but represents its numbers with lower precision to save memory and speed up computation. They tackle efficiency differently and are often used together.
When should I use model distillation?
Use it when a model you trust is too large, slow, or costly to deploy the way you need, such as on a device, at high volume, or under tight latency limits. If you have a strong teacher and a clear task, distillation is often the cleanest path to a model that is cheap enough to run everywhere.
Key takeaways
- Distillation transfers a large teacher model’s skill into a small, fast student model.
- The student learns from the teacher’s nuanced soft labels, not just final answers, which preserves quality.
- It cuts cost and latency and lets models run on phones and inside products, not just in data centers.
- It pairs well with quantization and pruning, which shrink models in different and complementary ways.
- Success depends on a strong teacher, enough data, and evaluation on the tasks you actually care about.
Distillation is a big reason the gap between what only giant models could do and what small ones can do keeps shrinking. The frontier gets the headlines, but the distilled models get the real work, running quietly in the places a giant could never fit. If you are trying to take a capable model and make it cheap and fast enough to ship, that balance of quality against cost is exactly the kind of applied work we do at Vesper Labs.
Want to go deeper?
Talk to the team building this. We'd love to hear about the problems you're trying to solve.
Get in touch →
Comments