Skip to content
Distillation

Distillation overview

Distillation trains a student LLM using supervision from a teacher. You can transfer a large model's behavior into a smaller model, combine specialist models into one agent, or teach a model to solve tasks without hints it needed during training. The teacher supplies the learning signal; the student is the model you evaluate and deploy.

Start with the teacher–student relationship, then work through the chapters below. The examples build on SFT and token-level RL updates.

Read from basics to advanced techniques

ChapterWhat you will build
Distill a larger modelA small student trained with a stronger teacher's sampled reverse-KL feedback.
On-policy self-distillationA student that learns from a solution-informed version of itself.
Self-distillation with River OPSDAligned student and teacher streams for River's native full-vocabulary forward-KL loss.
Multi-teacher distillationOne student learning from domain specialists through explicit task routing.

Choose a distillation recipe

Two decisions are independent: who generates the response, and how you compare the teacher and student. On-policy distillation means the student generates the responses used for training. It does not prescribe a KL direction. This separation is central to Generalized Knowledge Distillation (GKD).

RecipeWho generates?What the teacher providesWhen to use it
Distillation through SFTTeacherDemonstrationsYou have teacher text, including from a different tokenizer.
On-policy distillation (OPD)StudentProbabilities at the student's response prefixesA stronger teacher can score the student's own attempts.
On-policy self-distillationStudentPredictions conditioned on a solution or feedbackExtra training context makes the same model a better teacher.
Multi-teacher OPDStudentFeedback from a specialist chosen for each taskYou want one model to acquire several teachers' capabilities.

Teacher-generated SFT remains a useful baseline. DeepSeek-R1's smaller distilled models were fine-tuned on curated R1-generated examples; that experiment did not require aligning R1's vocabulary with Qwen's or Llama's. DeepSeek-R1, §2.4

What current research supports

The following is a reading of public methods as of September 25, 2026, not a ranking of models. Large-scale reports support specialist-to-student OPD; they do not establish one universally best estimator or teacher schedule.

SourceRelevant result or designWhat to take into your experiment
MiMo-V2-Flash, §4.4Domain teachers provide a teacher–student log-probability difference at each sampled token, optionally combined with outcome advantages.Start with task routing and dense token feedback; add verified task rewards separately.
MOPDStudies specialist consolidation with sampled-token and corrected top-k objectives.Treat specialist selection and the estimator as separate experimental choices.
Moonshot's Kimi K3, §4.1.3Routes by domain and reasoning effort across nine teachers; clips sampled log-ratio rewards. Reports no clear benefit from top-k in that setting.Sampled-token feedback is a serious baseline, including for agents.
DeepSeek-V4.1-Flash, §5.2.4Uses full-vocabulary OPD with more than 40 teachers and adjusts data and teacher mixtures during training.Full distributions are another demonstrated choice, with substantial systems requirements.
SDFT and SDPOUse demonstrations or environmental feedback to create a better-informed self-teacher.Test whether extra context actually improves the teacher before distilling it.

The basic walkthrough uses sampled reverse-KL feedback. It is small enough to inspect and works with River's core RL interface. It is not a reproduction of any lab's full training system. Self-distillation is a newer family with different divergences, teacher updates, and filtering rules; the acronym alone does not specify an algorithm.