Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder

AI builder glossary

Distillation

Training a small model to imitate a larger one on a specific task, using the large model's outputs as labels, to get similar quality at lower cost.

Distillation is fine-tuning where the training examples come from a stronger model. A large teacher model processes real inputs from your feature, and its answers become the labels; a small student model is then trained to reproduce them. Done well, the student handles that one task nearly as well as the teacher, at a fraction of the cost and latency.

The product recipe: start from a task the large model already does well, proven by an eval set. Run the teacher over a few thousand real inputs, filter or correct its labels, fine-tune the student (usually with LoRA), and evaluate on held-out cases the student never trained on. Serve it behind the same interface as the original so you can switch back instantly.

Distillation copies a capability; it doesn't create one, so the teacher's mistakes become the student's habits. It suits narrow tasks with checkable outputs, such as classification and field extraction, far better than open-ended writing. Before you start, do the arithmetic against a small hosted model and routing, because a self-hosted student has to beat those after paying for GPUs and upkeep. And read your provider's terms: some restrict using model output to build competing models.

Example

Deskmate labels 5,000 real tickets with a large model's triage decisions, trains a 4-billion-parameter open-weight student on them, and offers it to customers who need on-premises processing once it matches the teacher on the urgent-ticket eval set.

Learn more in the course

Related terms

Go from definitions to doing

Learn to build AI-powered apps in 132 practical lessons.