CyberFreezeDev Loading
  1. Home
  2. AI glossary
  3. Model distillation

What is model distillation?

A big model teaching a small one a narrow job, so it runs cheaper and faster.

3D render of matte panels of neural network nodes, with activations lighting up layer by layer

Definition

A smaller student model learns to copy a larger teacher, but only on the task you care about, so it can be many times smaller.

Read more about Definition

Model distillation, or knowledge distillation, is a training method where a smaller student model learns to reproduce the behaviour of a larger teacher model. The idea was popularised in the 2015 paper Distilling the Knowledge in a Neural Network by Hinton, Vinyals and Dean.

The student does not need to match the teacher on everything. It only needs to match it on the task you care about, which is why a distilled model can be many times smaller and still do that task well.

How it works

Soft labels

The student learns from the teacher's full probabilities, not just its top answer.

Read more about Soft labels

In the classic method the student learns from the teacher's full probability distribution over answers, not just the top answer. Those probabilities carry information such as "this is probably a cat, slightly possibly a fox". A raised temperature softens the distribution so more of that information shows.

Output distillation for LLMs

The teacher writes answers for many prompts, and the student is fine-tuned on them.

Read more about Output distillation for LLMs

With language models it is common to have the teacher write answers, explanations or reasoning for many prompts, then fine-tune the student on those outputs.

Real examples

DeepSeek's R1-Distill models and DistilBERT are well-known distilled models.

Read more about Real examples

DeepSeek released R1-Distill models: smaller Qwen and Llama based models fine-tuned on reasoning traces from the much larger DeepSeek-R1. DistilBERT is an older, widely used distilled version of BERT.

Where it matters in business

Cost at volume

A distilled small model handles high-volume narrow tasks for much less.

Read more about Cost at volume

Classifying millions of messages or documents with a large hosted model is expensive. A distilled small model can do the same narrow task for much less.

Latency

Small models answer faster, which matters in chat, voice and real-time checks.

Read more about Latency

Small models answer faster, which matters in chat, voice and real-time checks.

Running locally

It fits on one GPU or an edge device, keeping data in house.

Read more about Running locally

A distilled model can fit on a single GPU or an edge device, keeping data in house.

A practical example

A large model labels past support emails, staff correct a sample, and a small open model trained on them handles the daily volume.

Read more about A practical example

A company routes support emails into twelve categories. It runs a large model over a few thousand past emails to label them, has staff correct a sample, and fine-tunes a small open-weight model on the result. The small model runs on its own server, handles the daily volume, and sends low-confidence emails to the large model or a person.

Common mistakes

Breaking the teacher's terms

Some providers forbid training competing models on their outputs. Check first.

Read more about Breaking the teacher's terms

Some providers' terms forbid using their outputs to train competing models. Check before you distil from a hosted model.

Expecting general skills

A student built for one task is not a general assistant.

Read more about Expecting general skills

A student distilled for one task is not a general assistant. Test it outside its task and you will see the gap.

Copying the teacher's mistakes

The student learns errors too, so have people correct a sample of labels.

Read more about Copying the teacher's mistakes

The student learns errors too. Have people correct a sample of the teacher's labels.

Questions

What is the difference between distillation and quantization?

Distillation trains a new, smaller model. Quantization keeps the same model and stores its weights with fewer bits. They are often combined: distil to a small model, then quantize it to fit the hardware.

How much data does distillation need?

For a narrow task, a few thousand good examples often go a long way. Quality and variety matter more than volume. Keep a separate real test set to check the result.

Is a distilled model as good as the teacher?

On the task it was trained for it can come close. On everything else it is usually weaker. Measure it on your own examples before switching.

Last updated