Skip to content
mentoor

Topic 5 of 5 · 5 min read

Distillation, quantization and speculative decoding

Goal: Match a speed or cost goal to the technique that serves it and name the quality risk each brings.

Three common ways to make a model cheaper or faster are distillation (train a smaller model to imitate a larger one), quantization (store the weights with fewer bits) and speculative decoding (let a small model draft tokens that a large model checks). They differ in what they change and in what risk to quality they bring.

Check yourself · 1 of 3

What does quantization change?

Choose one answer

Why it matters

Providers and open-source tools often offer "mini", "lite", "turbo" or "4-bit" versions. Knowing what sits behind those labels helps you pick the right one and know what to test.

The three techniques

  1. Distillation. A large "teacher" model produces answers, and a smaller "student" model is trained to match them. You end up with a different, smaller model. It is cheaper and faster, but it may lose depth on hard or rare tasks.
  2. Quantization. The same model, with each weight stored in fewer bits, for example 4-bit instead of 16-bit. Memory drops and speed often improves. Small losses in accuracy can appear, more so at very low precision, so test on your own tasks.
  3. Speculative decoding. A small draft model proposes several tokens, and the large model checks them in one pass, keeping those it agrees with. Done correctly, the output matches what the large model would have written, so the gain is speed, not a quality change. It needs both models and helps most when the draft guesses well.

Matching goal to technique

  • Cut serving cost for a simple, high-volume task: a distilled or "mini" model.
  • Fit a model into limited memory: quantization.
  • Lower delay without changing outputs: speculative decoding.

Before and after

Before: "We switched to a 4-bit version and shipped it. It is the same model, so it must be the same quality."

After: "Same model, fewer bits. We ran our 200 test questions on both and compared scores before shipping. Quality dropped slightly on maths, so we kept 8-bit for that feature."

What goes wrong

  • Treating a smaller "mini" model as a drop-in replacement without testing.
  • Using very low precision on tasks that need exact numbers or code.
  • Expecting speculative decoding to change answers, or to help when the draft rarely matches.
  • Testing only on easy examples that hide the quality loss.

Examples

Choosing by goal

Goal Technique Main risk
Cheaper answers for a simple task Distilled or mini model Weaker on hard cases
Fit a model on a small card Quantization Small accuracy loss, worse at very low bits
Lower delay, same answers Speculative decoding Little gain if the draft guesses poorly

A safe rollout

A support team moves from a large model to a smaller distilled one. They run 200 past tickets through both, compare resolution quality, and route only the simple ticket types to the small model. Hard cases stay with the large one.

Key points

  • Distillation trains a smaller student model to imitate a larger teacher, giving a new, cheaper model.
  • Quantization stores the same model's weights in fewer bits to save memory and often time.
  • Speculative decoding has a small model draft tokens that the large model verifies, aiming for the same output faster.
  • Distillation and quantization can lower quality, so test on your own tasks before switching.
  • Choose the technique by goal: cost, memory or latency.

Common mistakes

  • Switching to a smaller or lower-precision model without testing it on your own tasks.
  • Assuming quantization is free of any quality change.
  • Expecting speculative decoding to change the answer quality.
  • Using one test example to decide.

Check yourself · 2 of 3

You need lower delay but must keep outputs identical to the large model. Which technique fits?

Choose one answer

Check yourself · 3 of 3

A team swaps to a 4-bit version of its model. What should it do before shipping?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic