Skip to content

Distillation: Training Small Models From Large Ones

How knowledge distillation transfers capability from a large model into a smaller, faster one.

Editorial team 1 min read

Distillation trains a smaller "student" model to imitate a larger "teacher" model.

How It Works

  • Generate outputs from the teacher on many inputs.
  • Train the student to reproduce them — either final answers or full probability distributions over tokens, which carry richer information.

Benefits

  • Much of the teacher's quality on target tasks at a fraction of the cost.
  • Faster, cheaper inference.
  • Models small enough for devices or high-volume use.

Task-Specific Distillation

For a specific application — say, classifying support tickets — distilling from a large model onto a small one trained just for that task can be very effective.

Data Matters

The student learns only what the teacher demonstrates. Cover the variety of inputs expected in production, including edge cases.

Limitations

  • The student rarely matches the teacher on broad, complex tasks.
  • Teacher errors are copied.

Terms of Use

Many model providers restrict using their outputs to train competing models. Check terms before distilling from a commercial API.

More in Generative AI

All Generative AI guides →
Generative AI Guide · 2 min

Prompt Engineering Fundamentals

The building blocks of a good prompt — context, task, constraints and format — with before-and-after examples.

Generative AI 2 min read 24 Jul 2026

Generative AI Guide · 2 min

Few-Shot Prompting With Examples

Showing a model a few examples of the input and output you want is often clearer than describing it. How to choose good examples.

Generative AI 2 min read 23 Jul 2026

Generative AI Guide · 2 min

Getting Structured Output From LLMs

How to get JSON and other machine-readable output reliably from a language model, and how to validate it.

Generative AI 2 min read 22 Jul 2026

Generative AI Guide · 2 min

Why Language Models Hallucinate

What hallucination is, why it happens, and practical ways to reduce and catch it.

Generative AI 2 min read 21 Jul 2026