GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
ICML 2025

DistiLLM-2: A Contrastive Approach Boosts the Distillation of LLMs

Distill by raising the student's probability on the teacher's text and lowering it on its own bad text, with a different loss for each. Better students and faster speculative-decoding drafters.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2025
AUTHORS
Ko, Chen, Kim, Ding, Liang, Zharkov, Yun
FROM
KAIST AI, Microsoft
PUBLISHED
Mar 2025 · ICML 2025
CITED BY
96Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 22% of this breakdown.

01

The paper in one minute

Knowledge distillation trains a small student to match a large teacher's next-token distributions. Two choices matter: which loss (forward KL, reverse KL, or blends) and which data the loss is computed on (responses written by the teacher, or by the student itself). Forward KL rewards covering everything the teacher might say, which in a small student smears probability over bad outputs; reverse KL rewards saying only what the teacher likes, which can make the student narrow. Student-written data closes the gap between training and inference, but is lower quality.

DistiLLM-2 pairs each loss with the data it suits. On teacher responses, a skew forward KL (KL from the teacher to a mix of teacher and student) pulls the student's probability up on what the teacher writes. On student responses, a skew reverse KL pushes the student's probability down where the teacher assigns little. The two terms are weighted (1 − β) and β, with β rising linearly from 0.5 toward 1 during training. The skew coefficient α is set per sample from how far the student's probability is from the teacher's. Student responses are regenerated once per epoch rather than every step, which works with fast batched inference.

The authors also show what does not work. Plugging DPO's preference loss in with the teacher as the reference model (DPKD) maximizes the gap between the two responses and drives the student into degenerate text. Using responses from stronger models than the teacher on the forward-KL side did worse than the teacher's own text.

DistiLLM-2 beat KD, SeqKD, ImitKD, GKD, DistiLLM and Speculative KD on instruction following for three teacher-student pairs, on GSM8K and MATH, and on HumanEval and MBPP, and helped as a reference model for DPO, for vision-language students, for recovering INT4 quantized models and for training speculative-decoding drafters.

THE IDEA, VISUALLY
TWO KINDS OF RESPONSE, TWO LOSSES teacher-written response skew forward KL pull student probability UP where the teacher's is high student-written response skew reverse KL push student probability DOWN where the teacher's is low loss = (1 - β) · SKL(teacher text) + β · SRKL(student text) WHAT ELSE IS IN THE RECIPE β rises linearly from 0.5 toward 1 over training skew α set per sample from the teacher-student gap (α0 = 0.1) student responses regenerated once per epoch (vLLM-friendly) teacher's own text beats stronger models' text for the SKL side LoRA rank 16, 50K prompts, 2-3 epochs, 4 A100s WHY NOT JUST DPO WITH THE TEACHER AS REFERENCE DPKD maximizes the gap between the two responses; with the teacher as reference it drives student text to near-zero probability and degenerates (Figure 1). ROUGE-L 6.4 vs 26.2 for DistiLLM-2 on Dolly (Table 12). COMPONENTS (TABLE 5), EVOL-INSTRUCT AVERAGE DistiLLM 41.55 → + contrastive 43.61 → + rising β 44.80 → + adaptive α (all three) 46.50 AVERAGE WIN RATE, 3 BENCHMARKS (TABLE 2) Qwen2-7B → 1.5B teacher 76.12 KD 41.19 GKD 56.14 DistiLLM 56.35 DistiLLM-2 58.69 Mistral-7B → Danube2-1.8B teacher 83.01 KD 40.0 GKD 50.68 DistiLLM 52.37 DistiLLM-2 56.45 Gemma-2-9B → 2B teacher 90.15 KD 49.53 GKD 69.73 DistiLLM 70.3 DistiLLM-2 74.83 win rate vs a fixed reference, judged by GPT-4o / GPT-4o-mini AS A SPECULATIVE-DECODING DRAFTER (TABLE 10) Phi-3-medium Phi-3.5-mini SFT drafter 1.32x 1.24x DistiLLM 1.71x 1.65x DistiLLM-2 1.97x 1.84x 68M Llama drafter; acceptance 0.412 → 0.487 on Phi-3-medium
Forward KL on the teacher's text teaches the student what to say; reverse KL on the student's own text teaches it what not to say. Using each loss on the data it suits beats using one loss on both.
Research notes: the problem, approach and results
+4.53

average win-rate points over the next best method for Gemma-2-9B distilled into Gemma-2-2B (74.83 vs 70.30)

1.97x

speculative-decoding speedup for Phi-3-medium with a 68M drafter distilled by DistiLLM-2; 1.32x with a fine-tuned drafter

6.4 vs 26.2

ROUGE-L on Dolly when DPO is applied with the teacher as reference (DPKD) versus DistiLLM-2; the DPO variant degenerates

THE PROBLEM

Distilling an LLM into a small model usually applies one loss to whatever data is used, teacher-written or student-written. Forward KL on teacher text spreads the student thin; reverse KL on student text makes it narrow. Applying preference-style losses directly can collapse the student.

THE IDEA

Use skew forward KL on teacher responses (pull the student up where the teacher is confident) and skew reverse KL on student responses (push it down where the teacher is not), weight the second more as training goes, set the skew per sample by how far apart teacher and student are, and regenerate student responses once per epoch.

THE RESULT

Across three teacher-student pairs, average win rate rose 2.0 to 4.5 points over the next best method; math and code gains over DistiLLM were 0.2 to 6.3 points. A 68M drafter distilled this way sped up Phi-3-medium's speculative decoding 1.97x, against 1.71x for the previous DistiLLM and 1.32x for fine-tuning.

02

Why it matters to an FDE

Customers who settle on a capable 7B to 9B model often want something smaller for edge devices, latency or cost. Distillation is the standard path, and the choices this paper studies are the ones a team makes, usually by default: which loss, on which data.

The default is often the weakest. Plain KD (forward KL on teacher outputs) scored 41.19 average win rate for Qwen2-1.5B, against 56 to 59 for methods that also use student outputs. If a team's distillation script only replays teacher text, it is leaving most of the gain behind.

Batched student generation is cheap enough. Regenerating student responses once per epoch with a fast inference engine matched fully on-policy training on the authors' Dolly test (ROUGE-L 26.20 vs 26.37), so the on-policy benefit does not require a slow training loop.

Drafters for speculative decoding. A tiny draft model trained this way was accepted more often by the large model, giving 1.97x speedup on Phi-3-medium. If a customer serves a large model and wants lower latency, distilling a better drafter is a direct application.

The gains are a few points, not a new tier. Win-rate gains over the next best method were 2.0 to 4.5 points; math gains over DistiLLM were 0.2 to 1.8. The student still trails the teacher by 15 to 27 points of win rate.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 149 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    What each component added, the data findings, side applications, and three misreadings

    Free account
  2. 04How it works

    Skew KL and skew reverse KL, the contrastive pairing, the schedules and the training setup

    Premium
  3. 05The numbers that matter

    Instruction following, math, code, ablations, capacity gap and the side applications

    Premium
  4. 06Try it yourself

    Recheck the tables, then distill a toy teacher four ways and compare quality and coverage

    Premium
  5. 07Where it breaks

    LLM-judge evaluation, small math gains, LoRA only, hyperparameters and slips

    Premium
  6. 08Using it on a deployment

    Distilling a customer's model into a small student or a drafter, and what to measure along the way

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →