An article on the SpeShu.AI blog explains in detail how knowledge distillation compresses a large neural network into a compact version. The method was proposed by Geoffrey Hinton in 2015, but its application to language models became widespread starting in 2023 — when giant cloud systems gave way to local models of 3–7 billion parameters. According to the authors, distillation cuts infrastructure costs by 100x. A comparison with classic fine-tuning shows a radical difference: fine-tuning requires 100,000+ manually labeled examples, while distillation needs just 1,000–5,000 synthetic ones generated by the teacher model. The depth of transfer is higher — the student copies step-by-step Chain-of-Thought logic chains. Training time shrinks from days or weeks on expensive cloud clusters to mere hours on a local GPU. Accuracy matching the teacher's quality reaches 96%+ versus 82% for fine-tuning.
The practical economics are compelling: with millions of requests per month, the cost of frontier models scales while revenue almost never does. A distilled 7-billion-parameter model on your own server delivers zero inference cost after the hardware purchase, less than 1% of the API cost of a frontier model, fully offline operation, and complete control over user data. Distillation is justified when three conditions hold simultaneously: high request volume, a narrow task domain, and data privacy requirements.
White-box distillation transfers knowledge most deeply through access to the Teacher's architecture and weights, but only works with open models. Black-box trains "blindly" on final text responses via an API — the process is slower and requires more iterations, but it's the only way to extract expertise from closed models like GPT or Claude. The advanced Layerwise Distillation technique transfers knowledge layer by layer through task-aware filters and is only applicable in white-box scenarios. An alternative approach is distilling an entire body of knowledge into prompts or skills via NotebookLM: up to 30 sources are uploaded, and the result is packaged as a YAML skill. Limitation: NotebookLM averages out contradictory data, so the model should be asked to preserve discrepancies.
Source: habr.com · post in Telegram