Knowledge distillation is a training approach in which a student model learns to approximate the behavior of a teacher model. The teacher is usually larger or more capable, while the student is often smaller and optimized for a particular workload. The objective is not to copy the teacher’s parameters directly, but to transfer useful behavior through examples or other training signals. A smaller student is common, but a difference in model size is not a defining requirement.
In classical distillation, the teacher provides output probability distributions rather than only a single correct label. These soft targets convey relationships among possible answers that a hard label does not capture. A temperature parameter can soften the distributions during training, and the training objective may combine a teacher-matching loss with a loss against verified labels. For foundation models, a practical alternative is response-based distillation: the teacher generates answers to representative prompts, and the student is trained on those prompt-and-answer pairs. This approach can work even when the teacher is accessible only through an API and does not expose internal representations or token probabilities.
Distillation has a different purpose from other foundation-model training activities. Pre-training develops broad capabilities from large datasets. Continued pre-training further trains an existing model on additional data, often using the original language-modeling objective to strengthen domain knowledge. Fine-tuning adapts an existing model using a more targeted dataset or objective. Distillation specifically concerns learning from a teacher, and it can be implemented by fine-tuning a student on teacher-generated examples. These terms therefore describe related activities, not mutually exclusive alternatives.
In a cloud implementation, engineers collect representative prompts, obtain teacher outputs, filter and validate the resulting examples, and train the student using managed training infrastructure or a supported managed distillation feature. Store datasets and model artifacts with access controls, encryption, and versioning. Confirm that the teacher’s license and service terms permit using its outputs to train another model. Prompts containing sensitive information also require appropriate data-handling controls.
For example, a support organization might use a capable teacher to generate answers for common product questions, then train a smaller student to handle those requests. The student can serve routine traffic while difficult cases are routed to the larger model using tested routing rules. Evaluate the student on a separate, representative test set, including uncommon requests, factual correctness, refusal behavior, and required output formats. Measure latency, throughput, memory consumption, and cost under realistic traffic rather than assuming that fewer parameters always guarantee better operational performance.
The main trade-off is reduced inference expense versus the upfront cost of teacher inference, data preparation, training, and evaluation. Savings depend on request volume and deployment choices. A student that performs well on a narrow workload may lose the teacher’s broader reasoning, multilingual ability, or safety behavior. Teacher-generated mistakes can also become training targets, so synthetic answers should not automatically be treated as ground truth.
Distillation is not quantization or pruning. Quantization reduces numerical precision, and pruning removes selected model components; distillation teaches a model using another model’s behavior. These techniques can be combined. Distillation also does not guarantee factual accuracy, remove the need for retrieval of current information, or ensure that the student matches the teacher across every task.