LyraLearn AI Learning Platform
Exams
← Module 20 Β· Model Customization
🎧 Listen

Small Models and Distillation

Model customization isn't only about changing a model β€” sometimes the architectural win is choosing a smaller one. Small language models (SLMs) in the 1–14B parameter range (Phi, Llama, Mistral, Gemma families) run on a single GPU or even a developer laptop, and for a well-scoped task they can match a frontier model at a fraction of the cost. Knowing when a 7B local model is the right architecture β€” not a compromise β€” is a differentiating exam answer.

Knowledge distillation shown as a large teacher model pouring synthetic examples into a small student model, with a cascade router sending most traffic to the small model and escalating hard cases.

Distillation: teacher β†’ student

Knowledge distillation is how small models get good. A large teacher model generates high-quality outputs β€” answers, reasoning traces, labelled examples β€” and a small student model is fine-tuned on them, absorbing the teacher's behaviour on that task distribution. You are effectively using the expensive model once, at training time, to avoid paying for it on every request forever. Microsoft's Phi models were trained heavily on such synthetic "textbook-quality" data, and Azure AI Foundry exposes distillation as a managed workflow. The caveat to state in an exam: the student inherits the teacher's ability only within the distilled task β€” general capability still scales with size.

When a small local model is the right architecture

Three drivers, individually sufficient:

Routing and cascades: the hybrid pattern

You rarely choose one model for everything. Model routing sends each request to the cheapest model that can handle it; a cascade goes further β€” try the small model first, and escalate to the large one when confidence is low, the query is complex, or validation fails. Done well, 80–90% of traffic never touches the expensive model.

This is precisely the platform's own hybrid local + cloud design: local models handle the always-on, high-volume work (embeddings, simple queries), while hard reasoning escalates to a cloud frontier model. In an interview, draw the spectrum from lesson one, then close with this: customization is not one technique but a portfolio β€” prompt what you can, retrieve what changes, tune what must be consistent, and route each request to the smallest model that can do the job.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.