FT-based distillation vs logit distillation: and what works with closed APIs
Explain the difference between classical logit distillation and FT-based distillation. Which one works when your teacher is a closed-API model (GPT-4o, Claude), and why?
Logit distillation matches the teacher's full softmax via KL and needs its logits. FT-based distillation just SFTs the student on teacher-generated text, so it works with any closed-API teacher.
Imagine learning chess from a grandmaster. The richest way is the master narrating not just the move they played, but how much they liked every other move too, a full ranked opinion on each turn. You copy that whole ranking. But some masters will only let you watch them play; they never share the rankings inside their head. So you fall back to the simpler way: watch thousands of their finished games and learn to imitate the moves you saw. You lose the rich 'how sure were they' signal, but you can learn from any master you can watch. To get cleaner lessons, you keep only their best games and study those.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: define both methods + the KL vs cross-entropy loss + what closed APIs expose + why FT-based is the only option there + rejection sampling and CoT traces + the licensing caveat.
| Aspect | Logit distillation | FT-based distillation |
|---|---|---|
| Signal copied | Full softmax over vocab (soft targets) | Sampled text only (hard targets) |
| Loss | KL divergence between distributions | Next-token cross-entropy (standard SFT) |
| Teacher access needed | Per-token logits plus aligned tokenizer | Text generation only |
| Works with closed APIs | No (full logits not exposed) | Yes (any callable teacher) |
| Information transferred | Confidence and rejected alternatives | Argmax behavior only (lossier) |
| Common augmentation | Temperature scaling on teacher | Rejection sampling, CoT traces |
Real products, models, and research that use this idea.
- DeepSeek distilled reasoning traces from DeepSeek-R1 into smaller Qwen and Llama students via SFT on generated chain-of-thought, an FT-based pipeline.
- Stanford Alpaca bootstrapped a Llama student by SFT on instruction-response pairs generated by a closed OpenAI teacher, a canonical FT-based distillation.
- Google's Gemma 2 9B and 2B were trained with logit-level distillation from a larger in-house teacher, feasible only because the teacher logits were accessible internally.
- Hugging Face TRL and the Unsloth toolkit ship reference SFT recipes that teams use to distill GPT-5.5 or Claude Opus 4.7 outputs into open-weight Llama 4 students.
- Together.ai and Fireworks publish distillation workflows where customers generate data from a frontier API teacher, rejection-sample it, then SFT a small hosted student.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does logit distillation transfer more than FT-based distillation, even on identical prompts?
QHow would you build an FT-based distillation pipeline for a reasoning student from a closed teacher?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Claiming you can logit-distill from GPT-4o or Claude. Closed APIs expose at most top-k logprobs, never the full vocab softmax, so the KL loss cannot be computed. Only FT-based distillation works there.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.