Walk through distilling an MoE teacher into a dense student for an edge deployment.
Your product must run on-device, where hosting all experts of your MoE is impossible. The team decides to distill the MoE into a dense model matching its active parameter count. Walk through the approach and the quality ceiling you should warn stakeholders about.
Distill the MoE teacher into a dense student of active-param size on soft logits plus LM loss. Expect tail-domain regressions because specialist knowledge cannot fit into active-size capacity.
Imagine a hospital with one general doctor and a hundred specialists. Each patient sees the general doctor plus the two specialists their case needs. Now you must move to a remote village where only one doctor will fit in the clinic. You can train a new general practitioner by having them shadow the whole hospital for a year, watching every case and writing notes on what the specialists do. They will get most common cases right, faster than before. But for the rare illness that needed the kidney specialist, the new doctor has only a fraction of that specialist's depth, because one head cannot hold a hundred specialties at full detail. Tell the village to expect great everyday care and occasional referrals for the unusual cases.
Detailed answer & concept explanation~6 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.
6 min: distillation loss anatomy + data mix decisions + deployment unlocks + ceiling mechanics + per-domain evaluation plan.
Real products, models, and research that use this idea.
- Mistral has shipped distilled dense variants alongside Mixtral MoEs for edge and mobile use cases.
- DeepSeek-V3 has spawned several distilled dense students in the open-source community targeting on-device latency budgets.
- Google's Gemini 3.1 Pro / Nano lineage demonstrates the dense-distillation pattern for moving frontier capability to constrained hardware.
- Llama 4 Maverick (MoE) deployments often pair with distilled dense Llama 4 variants for edge inference.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you choose temperature T in the soft-target loss?
QHow would you decide between a single broad distillation pass and a two-stage broad then product mix?
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.
Sizing the dense student to active-param count and expecting full-MoE quality. The MoE's quality budget is total parameters; the active count is its compute budget.
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.