跪拜 Guibai
← All articles
Frontend · Backend · GitHub

LLM Distillation, Explained: What Teacher Models Hand Down, What Students Learn, and Where It Fails

By 程序员_小雨 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Distilled models lower the hardware and cost floor for running capable reasoning models, which is why they keep showing up in release notes. The same process carries real limits and licensing constraints, and training data quality decides whether a student generalizes or merely mimics the teacher's output style.

Summary

Knowledge distillation, KD, has become a staple of LLM cost and capability debates. The teacher model passes knowledge through training signals rather than weights: early methods distilled probability distributions over classes, while the LLM era mostly distills generated text, because commercial models rarely expose weights or full prediction probabilities. Hinton, Vinyals, and Dean formalized the approach in 2015, and it has since expanded from model compression to domain specialization and reasoning improvement.

Two LLM-era flavors stand apart. Answer distillation, or sequence-level distillation, teaches question-to-answer mapping, but knowing answers doesn't equal knowing methods. Reasoning distillation adds condition analysis, solution steps, and intermediate calculations, the approach Google's 2023 Distilling Step-by-Step! study used to improve small models. Soft labels carry dark knowledge, the similarity information hidden in probability distributions, and a student trained on both hard and soft loss learns the teacher's classification rules rather than just the right class.

A complete distillation run has six stages: choose teacher and student, prepare representative problems, generate and clean training data, run supervised fine-tuning, then evaluate independently. Data quality decides whether a student generalizes or memorizes repeated patterns. DeepSeek's 2025 release is the concrete case: six distilled models from 1.5B to 70B parameters, fine-tuned from Qwen and Llama bases on roughly 800K curated samples mixing reasoning and non-reasoning tasks. Distillation is also distinguished from fine-tuning, quantization, and RAG, with limits spelled out: teachers err, tiny students can't inherit everything, and a model can imitate reasoning style while still failing novel problems.

Takeaways
— Knowledge distillation was formalized by Hinton, Vinyals, and Dean in the 2015 paper "Distilling the Knowledge in a Neural Network."
— The teacher model supplies knowledge and training signals; the student does the learning, and the teacher does not need to be larger than the student.
— Hard labels state a single correct class, while soft labels carry probabilities across classes, including dark knowledge about which alternatives are similar.
— Traditional distillation trains the student against both hard loss (distance to the true answer) and soft loss (distance to the teacher's distribution).
— Commercial LLMs rarely expose weights or full probabilities, so LLM-era distillation works from API-generated text, code, or structured output.
— Answer distillation, or sequence-level distillation, maps questions to answers and can produce students who know answers without methods; reasoning distillation adds condition analysis and intermediate steps.
— Google's 2023 "Distilling Step-by-Step!" showed that natural-language reasoning explanations from LLMs improved small models' data efficiency and task performance.
— An output reasoning explanation does not equal a model's real internal computation; distillation transfers demonstrated behavior, not internal mechanisms.
— Generalization, applying learned patterns to unseen problems, depends on data diversity; a million repetitive samples yield memorization, not transferable ability.
— A full distillation pipeline: choose teacher and student, prepare problems, generate training data, clean and verify it, run supervised fine-tuning, then evaluate on held-out problems.
— Teachers produce errors, so generated data needs deduplication, error checking, and verification; code can be validated by compiling and running tests.
— DeepSeek's 2025 R1 release included six distilled models (1.5B to 70B parameters) fine-tuned from Qwen and Llama bases on roughly 800K curated samples, without compressing R1's own weights.
— A small, narrowly focused student can beat a general teacher on specific benchmarks, but a single benchmark win does not mean comprehensive superiority.
— Fine-tuning is a training method; distillation is a knowledge-transfer process; a student trained on teacher-generated data is both fine-tuned and distilled.
— RAG consults external knowledge at answer time and leaves parameters untouched; distillation changes parameters through training.
— Distillation limits: teachers can be wrong, student scale and architecture cap what transfers, models can mimic reasoning style without solving new problems, and third-party licenses and API terms constrain data use.
Conclusions

Distillation works precisely because commercial LLMs hide their internals: it operates on the one artifact they do expose through APIs, generated text, which is why it became an LLM-era fixture.

The answer-versus-reasoning contrast sets a practical floor: benchmark-style answers can be memorized, while visible step-by-step traces promote generalization, so evaluations need unseen problems rather than answer similarity.

Because a model's stated reasoning does not equal its internal computation, distilled students inherit observed behavior, including the failure mode where a confident, plausible explanation accompanies a wrong final answer.

DeepSeek's case positions distillation as a distribution lever: roughly 800K curated samples spread R1's reasoning capability across open Qwen and Llama bases without exposing R1 itself.

Concepts & terms
Knowledge Distillation (KD)
A training technique that transfers knowledge from one model to another through training signals instead of copied weights.
Teacher Model / Student Model
The two roles in distillation: the teacher provides knowledge and training signals, the student is trained to acquire them; the teacher does not have to be larger than the student.
Hard Label / Soft Label
Hard labels give a single correct category; soft labels give probabilities across categories, carrying richer similarity information.
Dark Knowledge
The extra information embedded in soft-label probabilities, such as a husky being judged closer to a wolf than to a cat.
Hard Loss / Soft Loss
The two error terms in traditional distillation; hard loss measures distance to the true answer, soft loss measures distance to the teacher's probability distribution.
Sequence-level Distillation
Distillation that trains a student on teacher-generated sequences such as answers, code, or explanations, instead of probability distributions.
Reasoning Distillation
Distillation using teacher-provided reasoning traces (condition analysis, methods, intermediate steps), as in Google's Distilling Step-by-Step! study.
Supervised Fine-Tuning (SFT)
Training a model on curated input-output pairs to move its parameters toward a target behavior; the usual step for training students on distilled data.
Generalization
Applying learned patterns to previously unseen problems; depends on training data diversity, not just volume.
RAG (Retrieval-Augmented Generation)
A technique for consulting external knowledge at answer time; it does not modify model parameters, unlike distillation.
From the discussion

Distillation is understood as a two-step process: the answer comes first, then the model's own reasoning trail. The soft-label husky example successfully clarifies how hidden knowledge is carried, and the RAG-as-exam-research versus distillation-as-pre-exam-study analogy is adopted as a handy takeaway. Both remarks endorse the article's framing without raising any objections.

— Distillation is characterized as giving the answer first and then letting the model work through its own reasoning.
— The husky example effectively conveys the concept of hidden knowledge in soft labels, making the explanation click.
— The analogy of RAG to looking up exam materials and distillation to pre-exam study is considered useful and worth reusing.
Featured comments
约洛

Distillation is giving the answer first, then providing the reasoning process itself.

去吧波波鸟

Very thorough explanation. The husky example of hidden knowledge in soft labels made it click instantly. RAG is like looking up materials during an exam, and distillation is studying before the exam. I'm taking that analogy to use directly.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗