Hypothetical scenario. Northwind can operate a smaller model quickly, but its standalone behavior does not meet the target’s requirements. Dev suggests using it to propose tokens. Maya asks who decides which proposals survive, and Priya asks how rejected work changes the cost.
Maya: “Could the smaller model help without replacing the target?”
Dev: “A speculative decoder can draft a group for target verification.”
Priya: “Use the actual acceptance and correction rule, then count useful tokens and rejected work.”
You will distinguish speculative decoding from deploying a distilled model, following the supplied acceptance calculation and toy cost ledger. Target verification preserves a decoding contract under the algorithm; it is not an independent factual check on the answer.
How can a draft help while the target keeps authority?
Leviathan, Kalman and Matias's speculative-decoding method uses a cheaper draft model to propose several tokens and a target model to verify them together. Exact sampling uses an acceptance rule and correction distribution; blindly accepting plausible draft text does not preserve the target distribution. For a proposal token x with draft probability q(x) and target probability p(x), the acceptance probability is min(1, p(x)/q(x)) when q(x) is positive. A rejection requires the algorithm's correction step, not simply choosing the draft's next favorite token.
Hypothetical scenario. If q(x) = 0.4 and p(x) = 0.2, acceptance probability is min(1, 0.2/0.4) = 0.5. If a proposed group of four tokens takes two toy cost units to draft and four to verify, an illustrative cost is six units. Accepting three useful tokens yields 6/3 = 2 units per accepted token; accepting one yields 6/1 = 6. Compare with a chosen baseline of four units per token: only the first case improves this simplified ledger.
This accounting is not a GPU benchmark and omits batching and correction details. Unlike the distillation mechanism below, speculative decoding keeps the target as decoding authority. A distilled model substitutes its own learned behavior when deployed alone. Evaluate these as different interventions, especially when the draft's acceptance rate changes with the task.
Hypothetical scenario. Maya wants a smaller triage model without losing rare escalation cases.
In short. Define which teacher behavior must survive. Evaluate rare costly errors separately.
A cheaper model still has to do the task
Hypothetical scenario. A team wants a smaller model for a narrow document-classification and explanation task. A larger model produces useful examples, but some labels are unsupported by the source. Copying all its outputs into a training set would copy both useful behavior and mistakes.
Distillation transfers selected behavior from a teacher into a student through a training objective and data process. It is not an automatic compression of every useful capability. The application must decide which behavior to retain, how to verify training targets and which resource boundary a smaller candidate is intended to improve.
The previous chapter compared interventions and low-rank adaptation. This chapter connects teacher-generated data, student evaluation and deployment economics. The decision is whether a candidate meets the required task at a worthwhile operating cost under the actual workload.
Give the target verifier authority over draft tokens
Hypothetical scenario. A draft model proposes several tokens; the target verifies them under the selected speculative algorithm. Accepted prefix, first rejection and any correction token determine useful progress. Counting every drafted token as delivered output exaggerates throughput.
| Artifact | Concrete evidence | Decision boundary |
|---|---|---|
| Draft group | proposal tokens and draft probabilities | Unaccepted work |
| Verification | target probabilities, acceptance rule | Target sampling contract |
| Useful output | accepted prefix and correction evidence | Progress denominator |
Exact sampling claims require the specified acceptance and correction distributions, not arbitrary confidence thresholds. Distinguish speculative decoding from training a smaller student: one changes inference scheduling, the other changes a model. Include draft work, target verification, rejected suffixes and synchronization in the cost ledger. A higher acceptance share can still lose if the draft is too expensive or the request mix changes.
Teacher output is not ground truth
A teacher can produce incorrect, biased or policy-incompatible outputs. A confident explanation may conceal an unsupported label. Synthetic examples require provenance, permitted use and review just as human-authored examples do.
Training only on easy successful teacher answers can omit the decisions the student most needs to learn: missing evidence, ambiguous categories, conflicting source versions and cases that require an explicit limitation. Diversity of wording does not establish diversity of task behavior.
A larger parameter count is also not proof of a suitable teacher for this domain. Evaluate the teacher's outputs against the task contract. The teacher may help propose labels or explanations while a source-based process determines whether they are acceptable training targets.
Distill a defined behavior, not a reputation
The original Distilling the Knowledge in a Neural Network describes training a student using information from a teacher's output distribution. In a text-generation application, training on selected generated responses is a related transfer approach, but it does not automatically expose the full token distribution or inherit every property of the original method.
Specify the student input and output interface. If training examples include evidence that serving will not provide, the student faces a different task at deployment. If the student uses a shorter context, verify whether required source relationships still fit.
Keep a versioned account of the teacher, generation instructions, filtering decisions and student configuration. Review rights and confidentiality before sending examples to a teacher service. A synthetic label does not erase the sensitivity of the input that produced it.
Apply Distillation and Small Models: Preserve the Task, Measure the Trade at the acceptance boundary
Distillation is a training intervention, while deploying a smaller model is a serving decision. They are related when a student learns from a teacher's outputs, but the trained artifact still needs a task evaluation and measurements at the actual serving boundary. Parameter count alone cannot establish which task constraints survive or what resource cost the deployed path will have.
For an illustrative evaluation, let the baseline accept eighty of one hundred held-out cases and the candidate accept seventy-eight. Their accepted fractions are 80 / 100 = 80% and 78 / 100 = 78%. An aggregate drop of two percentage points is not the whole review: inspect which cases changed. Losing two required safety or exception cases has a different consequence from a documented trade in optional wording preferences.
Teacher output is a source of training targets, not an independent correctness oracle. If unsupported confidence appears in those targets, the student can learn that behavior successfully under the training objective. Review evidence support, abstention behavior and important task slices before deciding which examples deserve to be copied. A teacher with strong average results can still supply unsuitable labels for a narrow application.
The economic comparison also needs routing and outcome denominators. Suppose a hypothetical route serves sixty requests with a student and forty with a larger model. The student share is 60 / 100 = 60%, but it is not a sixty-percent cost reduction. Compute each route's token, runtime, retry and review costs, then divide the combined cost by accepted outcomes under the declared contract. Include repeated or escalated work rather than counting the first student response as a completed task.
Keep a fallback policy compatible with the student release. Escalation can be appropriate when the student cannot produce a supported result, but its authority and deadline remain bounded. Preserve model, prompt, retrieval and evaluation identities so a serving regression can be investigated and rolled back as a coherent change.
Derive target yield and cost break-even
Hypothetical scenario. Generate 1,000 proposed examples. Reject 200 for unsupported labels and 100 for duplication, with the rejected groups explicitly disjoint. Retained examples are 1,000 − 200 − 100 = 700. The retained fraction is 700 ÷ 1,000 = 0.7; it describes this constructed process, not a universal synthetic-data yield.
Suppose a separate 100-case held-out comparison has 90 acceptable teacher outputs and 85 acceptable student outputs. The observed fractions are 0.9 and 0.85, a difference of 0.05, or five percentage points. Inspect which cases changed and whether required constraints failed. The count alone cannot establish an acceptable quality trade.
For a deliberately invented cost model, choose a one-time preparation and adaptation cost of 100 currency units, a baseline per-request cost of 0.01 units and a candidate per-request cost of 0.004 units. Savings are 0.01 − 0.004 = 0.006 units per request. Ignoring all other costs, break-even volume is 100 ÷ 0.006 ≈ 16,666.67 requests, so at least 16,667 whole requests are required.
These are chosen accounting inputs, not vendor prices. Review effort, idle capacity, monitoring, repeated adaptation and fallback calls can move the result. If quality requires routing many cases back to the baseline, include that routing mix.
For example, choose 80% candidate routing and 20% baseline routing with no additional overhead. Mean request cost becomes 0.8 × 0.004 + 0.2 × 0.01 = 0.0052 units. Savings are 0.01 − 0.0052 = 0.0048, and the same initial 100 units break even at 100 ÷ 0.0048 ≈ 20,833.33, or 20,834 whole requests.
In the wild: Distillation and Small Models: Preserve the Task, Measure the Trade
distillation paper: Original distillation transfers teacher distribution information under a specified training objective.
Smaller weights do not set the serving result
A smaller candidate can reduce weight payload while leaving retrieval, network waits or long output generation as the dominant cost. Throughput and latency depend on architecture, hardware, batching, context and request mix. Measure the whole task boundary used for the product decision.
Quantization changes numeric representation rather than transferring behavior from a teacher. It can be combined with adaptation or distillation, but each changed artifact needs evaluation. Do not multiply a parameter-count ratio by a precision ratio and present the result as measured speed.
The runtime lesson already separated weight memory from request state. A smaller model does not automatically eliminate long-context cache growth, queueing or the need for admission limits. Preserve the same deadline and uncertain-outcome accounting when comparing deployments.
The router sends the hardest cases to the student
Hypothetical scenario. A router uses short question length as a proxy for easy tasks. Short policy exception questions actually require the most careful evidence interpretation, so the student receives disproportionately difficult cases and fails them.
Evaluate the routing policy and student together. A model's confidence-like output or answer length is not a calibrated correctness guarantee. Include fallback latency, cost and data exposure, and define whether a failed student attempt can safely be followed by another model.
Monitor the routed population over time. Changes in source policies or user behavior can make the original comparison obsolete. Keep a rollback path and explicit criteria for withdrawing the candidate when a required failure category worsens.
Three compression misconceptions
“The student is a smaller copy of the teacher.” It is a separately trained model with behavior shaped by the selected data and objective. Capabilities outside that evidence remain unestablished.
“Generated data is free.” Generation, filtering, review, rights analysis and repeated training consume resources even when the marginal text looks inexpensive.
“A fallback preserves all guarantees.” Fallback changes the request path and can add latency, expense and different behavior. Evaluate its actual routing and completion contract.
Make a change only with a release and recovery plan
Use distillation when the task is sufficiently defined, suitable teacher evidence exists, and the expected quality-resource trade can be evaluated. Compare the full deployment, not only model files. Retain the previous working configuration and the evidence needed to diagnose regressions.
Avoid a training project when the main cost lies in unnecessary context, repeated failed attempts or an inefficient retrieval path. Improving those boundaries may preserve behavior with less operational complexity. A smaller candidate is one possible intervention, not the definition of an optimized system.
The course concludes with a design exercise that asks you to choose among these interventions. The answer should explain why a change addresses a diagnosed failure, what evidence could reject it and how the service behaves when required evidence or resources are unavailable.
Limits of Distillation and Small Models: Preserve the Task, Measure the Trade
Teacher outputs are training targets rather than ground truth. Smaller parameter count does not establish task equivalence or lower end-to-end cost. Include routing, retries, review and accepted outcomes in the deployment comparison.
Test the draft group boundary
The draft agrees often, but end-to-end latency grows. Which evidence should decide release?
Reveal the design reasoning
Useful accepted tokens and task completions per full elapsed/resource cost. Include all discarded work and compare the same workload. Agreement alone is not a speed guarantee.
Decision: Keep target semantics and full rejected-work accounting in the speculative decision.
Check yourself: defend the candidate
A teacher labels every synthetic example confidently. Can the labels enter training without review?
Confidence does not establish source support or policy compliance. Inspect target quality, provenance and suitability, and preserve independent evaluation cases.
The candidate uses smaller weights, but network retrieval dominates response time. Is a latency improvement established?
No. Measure the relevant end-to-end boundary under the actual workload. Reduced weight payload is a different dimension from user latency.
A router falls back on one fifth of requests. Can the original all-candidate cost estimate stand?
No. Include the actual routing mix, failed attempts and overhead. Recalculate savings and break-even under explicit assumptions, then verify them with measured usage and current prices.
Northwind decision log
Define which teacher behavior must survive.
Evaluate rare costly errors separately.
Select the smaller model only within task constraints.
Go deeper into transfer and runtime accounting
- Book chapter: Dive into Deep Learning, section 4.1: Softmax Regression — Aston Zhang, Zachary Lipton, Mu Li and Alexander Smola. Background for class distributions and training objectives.
- Book chapter: Dive into Deep Learning, section 4.7: Environment and Distribution Shift — the same authors. Relevant to teacher data and routed deployment populations.
- Video lecture: Backpropagation, intuitively | Deep Learning Chapter 3 — 3Blue1Brown. Follow how training changes weights, then distinguish that intervention from correcting retrieval or serving.
- Primary paper: Distilling the Knowledge in a Neural Network — Geoffrey Hinton, Oriol Vinyals and Jeff Dean. Read the original transfer objective and its scope.
Check the mechanism in this lesson
If q(x) is 0.4 and p(x) is 0.2, should an exact speculative sampler accept every occurrence of x because the target assigns positive mass?
Compare the explanation
No. The declared acceptance probability is min(1, p/q) = 0.5. Rejection requires the algorithm's correction distribution. Positivity alone is not the exact-sampling acceptance rule.
Carry the decision forward
Northwind can distinguish speculative proposals from a replacement model. Page 34 follows adapter and prefix identities, where apparently identical text can still produce incompatible reusable state.