# What Is Distillation?

> What distillation is, how a small model learns from a large one, where it saves money and what to check first, explained simply for your AI interview.

**In short:** Distillation is when a small AI model is trained to copy the answers of a large model, so it runs cheaper and faster on one job. The large model is the teacher, and the small model that learns from it is the student.

AI and LLM interview question Q293, Fine-tuning and adaptation. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-distillation

## Say it in 30 seconds

Distillation is teaching a small AI model by letting a large one show its answers. The big model is the teacher, the small one is the student. The student learns from the teacher's labels and scores, so it can do the same narrow job faster and with less memory. It is usually not as good as the teacher, so I would measure it on the real task. And I would check the vendor's terms first, because some forbid using their outputs to build competing models.

## Say it in 2 minutes

Distillation is a way to make a small model good at one job by copying a large model. The large model is the teacher. The small model is the student. You send the teacher real inputs, keep its answers, and train the student on those input and answer pairs. Over time the student gives close answers on its narrow job, though often not identical ones, at lower cost and higher speed.

The useful detail is the score the teacher gives every option. If a claim note is labelled water damage, a plain label says nothing about the other options. The teacher's scores might show that wear and tear was a close second. That extra signal helps the student learn which mistakes are close calls. This needs a teacher whose scores you can read, such as a model you run yourself.

The limits matter in an interview. The student is usually not as good as the teacher, so I test it on cases it never saw in training. It copies the teacher's mistakes too, and it is only as wide as the examples I trained it on. Some providers also forbid using their outputs to build competing models, so I read the terms before I start.

For a claims team, I would use the big model to label a few thousand past notes, check a sample by hand, and train a small model for the routine ones. Hard or rare notes would still go to the big model. That keeps the cost low without betting everything on the student.

## What is distillation, in plain words?

Distillation is a way to train a small AI model by letting a large one show it the answers. The large model is the teacher. The small model is the student, and it is trained to give the same answers the teacher would give on the same inputs.

Think of a senior claims handler training a new hire. The new hire does not read the whole rulebook. They sit beside the senior, see thousands of decided claims, and learn the pattern. Later they work faster and cost less, but they are only as good as the claims they were shown.

The AI version is the same. An insurer might use a large, costly model to label old claim notes, then train a small model on those labels so it can sort new notes alone.

- **Teacher model:** The large, capable model whose answers are copied.
- **Student model:** The small model that is trained to copy them.
- **Soft label:** The teacher's score for every option, not only its final pick.

> "The process of reducing the size of one model (known as the teacher) into a smaller model (known as the student) that emulates the original model's predictions as faithfully as possible." (Google Machine Learning Glossary)

## How does the student learn from the teacher?

The steps are simple. You collect real inputs from your work, let the teacher answer them, and train the student on those pairs. OpenAI's guide describes the same route: "distill the results of a large model to create training data for supervised fine tuning". It adds: "Tune a smaller model (like gpt-4.1-mini) using the dataset you created from the large model."

*Diagram, How a teacher trains a student: A large teacher labels past claim notes, and a small student learns from those labels. The student then does the sorting alone, at lower cost. The teacher helps build the student, and the student takes over the routine work.*
1. Real past claim notes go in, the kind of input the small model will face.
2. The big model writes a label for each note, with a short reason.
3. The small model trains on those pairs until it copies the labels.
4. The trained student takes over the routine notes at lower cost.

1. **Collect real inputs:** Take a few thousand past claim notes. Remove names and bank details first.
2. **Get the teacher's answers:** Ask the big model to label each note with a short reason. A person checks a sample.
3. **Train the student:** Fine-tune the small model, which means training it further on your examples, so it learns to copy the labels.
4. **Test on notes it never saw:** Compare the student with the teacher and a human reviewer, on notes kept out of training.

## Why do the teacher's scores teach more?

A plain label only says "water damage". The teacher's scores can also show that wear and tear was a close second and fraud was far off. In plain words, that extra signal tells the student which mistakes are close calls. This needs a teacher whose scores you can read, such as a model you run yourself. A hosted big model often returns only its text answer, so there the training data is just the labels and short reasons.

The idea was written up in 2015. Geoffrey Hinton, Oriol Vinyals and Jeff Dean wrote a paper titled "Distilling the Knowledge in a Neural Network", which builds on work by Caruana and his collaborators. Its abstract says Caruana's team showed that they could "compress the knowledge in an ensemble into a single model which is much easier to deploy". An ensemble is a group of models whose answers are combined, and it is costly to run.

- **Hard label: One answer.** The note is marked water damage. Nothing is learned about the other options.
- **Soft label: Every option scored.** Made-up scores: water 0.91, wear and tear 0.06, fraud 0.03. The student sees which mistakes are close.

*Diagram, Hard label or the teacher's scores: Both labels come from the same note, and the scores are made up for this example. A hard label gives one answer, while the teacher's scores show how close the other options were.*
1. The plain label gives the student one answer to learn from.
2. The teacher's full scores add the close calls.
3. The student is then tested on notes it has not seen.

## Where does distillation help, and where does it fall short?

The big win is speed and memory. Google's glossary says a smaller student has "two key benefits": faster inference time, and reduced memory and energy usage. For a claims team sending thousands of notes a day, that usually means a lower bill, since a large hosted model bills per request. The trade-off is quality. As the glossary puts it: "However, the student's predictions are typically not as good as the teacher's predictions."

Google's Gemma 2 report from 2024 says it trained its 2B and 9B models with distillation, "instead of next token prediction". DeepSeek's R1 paper, first submitted in January 2025, open-sourced six smaller models distilled from R1, based on Qwen and Llama.

- **The student copies mistakes too:** If the teacher gets a type of note wrong, the student learns the same wrong label.
- **It is narrow:** A student is strongest on the job it was trained for, and weaker on new kinds of claims.
- **Labelling costs money:** Teacher calls, time and a human check on a sample all come before any saving.
- **Check the terms first:** Anthropic's commercial terms bar using its services to build a competing product, including training competing AI models. OpenAI's business terms bar using its output to develop competing AI models.

> "to build a competing product or service, including to train competing AI models" (Anthropic, commercial terms)
>
> "use Output to develop artificial intelligence models that compete with OpenAI's products and services" (OpenAI, business terms)

### How would you decide if distillation is worth it?

I ask three questions. Is the job narrow and repeated? Do I have enough real inputs to learn from? Are the terms allowed? If all three are yes, a student can cut the cost of routine requests. If the job is rare or changing, the big model is the safer choice.

- **Keep the big model: Full cost, top quality.** Best on rare, odd notes, but every request pays the big model's rate.
- **Routine notes to the student: Lower cost, fast.** Good on the notes that look alike. Odd ones go back to the big model.

The usual design adds a simple switch in code that decides which model answers. Routine notes go to the student, and anything it is unsure about goes to the big model. That switch is the part to test hardest.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: a small student learns to copy a large teacher.
- [ ] How the training data is made: the teacher labels real inputs.
- [ ] Why the teacher's scores teach more than one final answer.
- [ ] The trade-off: faster and smaller to run, but usually not as good as the teacher.
- [ ] The terms: check the vendor's rules before using its outputs.

**Common traps**

- Trap: "Distillation just deletes parts of the model to make it smaller." Better: That describes pruning. Distillation trains a separate small model to copy the big model's answers.
- Trap: "The student will be as good as the teacher." Better: Usually it is not as good as the teacher. Measure it on your own task before you switch.
- Trap: "We can copy any model's answers to train ours." Better: Read the licence and the terms first. Many vendors forbid building competing models.

## Can you spot the right plan?

**Spot the plan:** A team wants to cut the cost of its claims bot. Which plan is the sound one?

A. Copy the vendor's answers into a student and ship it, since the terms are a formality.
B. Label a sample of past claim notes with the teacher, hold back a test set, and check the terms first.
C. Train the student on one day of calls, then switch every customer over at once.
D. Send every claim to the student alone, with no way to fall back to the big model.

**Answer:** B. It has good data, a test set kept out of training, and the terms checked before work starts. The other three skip one of those, or leave no way back for rare cases.

**Quick check:** What does the student get from the teacher that plain labels do not give?

A. A longer system prompt
B. The teacher's score for every option, not only its final pick
C. A bigger model file
D. Permission to skip testing

**Answer:** B. The scores show which options were close. The other three do not change what the student learns.

## Can you answer these from memory?

**Flash cards**

- **What is distillation?** Training a small student model to copy a large teacher's answers.
- **What is a soft label?** The teacher's score for every option, not only its final pick.
- **Who wrote the 2015 paper?** Geoffrey Hinton, Oriol Vinyals and Jeff Dean.
- **What does distillation save?** Cost, speed and memory when the student runs a routine job.
- **Is the student usually as good?** Usually not as good. Measure it on your own task first.
- **What is the main legal risk?** Vendor terms that forbid using their outputs to build competing models.

## Likely follow-up questions

- Q294 How do you prepare a fine-tuning dataset? https://designervenkat.online/interview/ai/how-to-prepare-a-fine-tuning-dataset
- Q299 Synthetic data for fine-tuning? https://designervenkat.online/interview/ai/synthetic-data-for-fine-tuning
- Q300 How do you evaluate a fine-tuned model? https://designervenkat.online/interview/ai/how-do-you-evaluate-a-fine-tuned-model
- Q281 Fine-tune vs RAG vs prompting: when to use which? https://designervenkat.online/interview/ai/fine-tuning-vs-rag-vs-prompting
- Q284 What is LoRA? https://designervenkat.online/interview/ai/what-is-lora
- Q282 What is full fine-tuning? https://designervenkat.online/interview/ai/what-is-full-fine-tuning
