Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Quantization vs distillation: shrink the numbers, or the model?
A model too big to serve has two escape hatches. Quantization keeps the model exactly as it is and stores each number in fewer bits. Distillation throws the big model away and trains a smaller one to copy it. They shrink different things — which is why the best answer is often to use both.
The one distinction that decides everything
Quantization keeps the exact same model — same architecture, same parameter count — but stores each weight in fewer bits: dropping from 16-bit floats to 8-bit or 4-bit integers roughly halves or quarters the memory, with no change to what the model is. Distillation does the opposite: it trains a brand-new, smaller student model to imitate the outputs of a larger teacher, producing a genuinely smaller network with fewer parameters. Quantization compresses the representation; distillation compresses the model.
Want the same model to fit on smaller hardware with minimal effort? Quantize it. Want a fundamentally smaller, faster model for a specific job and you can afford to train one? Distill it. They aren't rivals — they act on different axes and stack.
Head to head
| Dimension | Quantization | Distillation |
|---|---|---|
| What changes | Numeric precision of the weights | The model itself — a new, smaller architecture |
| Parameter count | Unchanged | Reduced (the student is smaller) |
| Needs training? | Often none (post-training); QAT is optional | Yes — you train the student on teacher outputs |
| Effort & time | Low — minutes to hours | High — a training run plus data |
| Where the speedup comes from | Less memory to move; fast integer kernels | Fewer parameters to compute |
| Quality loss | Small to INT8; grows at INT4 and below | Student can trail the teacher, esp. off-task |
| Hardware | Needs INT8/INT4 kernel support to see gains | Runs anywhere the smaller model fits |
| Best for | Fitting an existing model on smaller GPUs, fast | A dedicated small model for a known task |
When to use each
Reach for quantization
- You want the same model to fit in less VRAM, now
- You have little time and no training data or budget
- INT8 quality is fine for your task (usually it is)
- Your serving hardware has fast low-precision kernels
- You need a quick win before investing in anything heavier
Reach for distillation
- You need a genuinely smaller, faster model for one task
- You can generate or collect teacher-labeled training data
- Latency and per-token cost matter more than up-front effort
- The task is narrow enough that a small student can nail it
- You'll serve it at a scale where a smaller model pays back the training cost
The answer is often "distill, then quantize"
Because they act on different axes, the two compose cleanly and teams routinely chain them: distill a large teacher into a smaller student to cut the parameter count, then quantize that student to INT8 or INT4 to cut the memory footprint further. A third axis, pruning (zeroing out unimportant weights), stacks on top of both. Together they can hit a size-and-latency target that no single technique reaches — say, taking a 70B teacher down to a distilled 7B student and then quantizing it to 4-bit to run on a single modest GPU.
Start with quantization — it's the fastest, lowest-effort win and often gets you where you need to go for free. Reach for distillation when quantization alone can't hit your size or latency target, or when a purpose-built small model would be materially faster and cheaper at your scale.
The quality-vs-size frontier
Each technique degrades quality in its own way. Quantization is remarkably forgiving down to 8-bit — the loss is usually small enough to ignore, which is why INT8 is a safe default. Push to 4-bit and below and accuracy slips more noticeably; quantization-aware training (simulating low precision during training, rather than just rounding a finished model) recovers much of that loss at aggressive bit-widths. Crucially, quantization keeps the model's full breadth — it still knows everything it knew, just a little less precisely.
Distillation trades differently. A well-trained student can match the teacher closely on the tasks it was distilled for, sometimes almost indistinguishably. But it's a smaller network with less capacity, so it tends to lose general breadth — the long tail of rare knowledge and edge behaviors the big teacher had. That's fine when you want a specialist and dangerous when you quietly needed a generalist. The honest framing: quantization keeps breadth and sacrifices a little precision everywhere; distillation keeps sharpness on-task and sacrifices coverage off-task.
Quantization: same knowledge, slightly coarser numbers. Distillation: a smaller brain that's great at what you trained it on and thinner everywhere else.
A worked scenario: getting a 70B model onto one GPU
You have a strong 70B model and a single GPU that can't hold it at 16-bit precision. The fastest path is quantization: drop it to INT4 and its memory footprint falls by roughly 4×, often fitting on that one card, with quality good enough for many workloads — and you did it in an afternoon with no training data. It's still the same 70B model, just stored more coarsely. This is the right first move almost every time.
Now suppose that quantized 70B is still too slow or too expensive per token at your request volume, and your actual task is narrow — say, classifying and routing support tickets. Here distillation earns its cost: train a 7B (or smaller) student on the big model's outputs for that task, and you get a model that's an order of magnitude cheaper and faster to run, purpose-built for the job. Then quantize that student too. The 70B was a great teacher; it doesn't have to be what you serve.
Fit-it-now, keep-all-abilities → quantize. Need-a-smaller-faster-specialist → distill. Need-both → distill then quantize (then prune). Compression is a stack, not a single switch.
The flip point: how much smaller you need to go
Both shrink a model, but differently: quantization stores the same weights in fewer bits (no training, minutes to apply); distillation trains a new, smaller model to imitate the teacher (a real training run). So the deciding number is how much smaller you need.
Going FP16 → 4-bit is a 16/4 = 4× memory cut essentially for free, with only a small quality haircut when done well (GPTQ/AWQ-style). That makes ~4× the practical “free” ceiling: if you need to shrink up to about that and keep the same architecture, quantize. Need to go much smaller — a student a fraction of the teacher’s parameter count — and quantization alone will crater quality, so you must distill (paying the training cost) to actually rebuild capability in a smaller network. They also compose: distill to a smaller model, then quantize it, to stack a ~4× on top of the size cut distillation already bought.
The picture: two axes, one stack
Cost and trade-offs: what each step buys in memory and speed
Here Time is the effort to produce the model. Space is the memory its weights need. The rows follow the page’s 70B-to-one-GPU scenario.
| Case | Time | Space | Why |
|---|---|---|---|
| 70B teacher, FP16 | None: it is the model you have | 140 GB | More than one 80 GB card before a single token of KV cache. |
| 70B, INT8 (post-training) | Minutes to hours, no training data | 70 GB | Fits one 80 GB card, but leaves about 10 GB for KV cache, so long contexts or large batches still do not fit. |
| 70B, INT4 (GPTQ/AWQ style) | Hours, with a small calibration set | 35 GB, ≈36 GB with one 16-bit scale per 128 weights | The scales add 16 ÷ 128 = 0.125 bits per weight. Quality slips more than at INT8; check it on your task. |
| 70B, INT4 with QAT | A training run that simulates low precision | Same ≈36 GB | Costs training compute to win back quality that plain rounding lost. Memory is no better than plain INT4. |
| 7B distilled student, FP16 | A training run plus teacher-labelled data | 14 GB | 10× fewer parameters means 10× fewer multiply-adds per token. Breadth off-task is what you give up. |
| 7B student, INT4 | The distillation run, then minutes | 3.5 GB | 140 ÷ 3.5 = 40× smaller than the teacher. Fits on a small GPU with room for cache. |
| Generating the teacher’s labels | One teacher pass per training example: a million 200-token answers at the 14 tokens/s ceiling below is 14M seconds, about 162 days on one card | A dataset of prompts and teacher answers (or their probabilities) | The hidden cost of distillation. In practice you batch it hard or spread it over many GPUs, but it is still a bill that quantization never sends. |
| Pruning on top | Another pass, usually with fine-tuning to recover | Depends on the pattern of zeros | Scattered zeros save little unless the kernels skip them. Structured patterns, such as 2 of every 4 weights zero, are what hardware can actually accelerate. |
Why the speedups differ. Generating one token at batch size 1 reads every weight once, so decode is bound by memory bandwidth: tokens per second can be no more than bandwidth ÷ weight bytes. On a card with an illustrative 2 TB/s, that ceiling is about 14 tokens/s for the 140 GB teacher, 57 for the 35 GB INT4 version, 143 for the 14 GB student and 571 for the 3.5 GB INT4 student. Quantization raises the ceiling by moving fewer bytes, but still does all 70B multiply-adds per token (about 2 × 70B = 140 GFLOPs). Distillation cuts the multiply-adds too, to about 14 GFLOPs. That is why it wins once you batch many requests and compute, not bandwidth, becomes the limit. The practical reading: if one user at a time is waiting on tokens, quantization is the cheap fix. If the bill comes from millions of requests in large batches, only a smaller model cuts it, and that means distilling.
Common mistakes
- Sizing the GPU on weights alone
The 35 GB INT4 model “fits” a 40 GB card until you add the KV cache, which grows with context length × batch size and is not shrunk by quantizing the weights. Budget weights + KV cache + activations, or quantize the KV cache separately and test that as its own change.
- Calibrating on the wrong data
GPTQ and AWQ pick their rounding using a small calibration set. Calibrate a code or legal model on generic web text and the weights that matter for your traffic get rounded worst. Use a few hundred samples that look like real requests, in the same languages and lengths, and re-quantize if your traffic changes.
- Judging quality by one average score
A low-bit model can match the original on an average benchmark and still regress on the slice you care about, such as long inputs, arithmetic or a rarer language. Run your own eval set, split by task, before and after. Do the same for the student against the teacher.
- Serving general traffic from a narrow student
The student was trained on one task’s distribution. Send it everything and the off-task requests get the thin, confident answers the page warns about. Route by task, keep the teacher (or a larger model) as a fallback, and watch how much traffic falls outside the training distribution. That share tends to grow as users discover the feature, so measure it monthly, not once.
- Distilling from a teacher you may not train on
Some model licences and API terms forbid using outputs to train another model. Read the teacher’s terms before you generate a million labels, not after the student ships.
Which would you pick?
Three situations. Pick the side you'd actually build — the explanation follows.
A model works well but does not fit the GPU you have, and you need it working this week.
Quantization is the fastest lowest-effort win and often enough on its own, which is why the page makes it the starting move. Distillation means designing, training and evaluating a new model — the right tool when quantization cannot reach your target, not the first thing to try when the deadline is this week.
You need a much smaller, much faster model for one narrow task, and you can afford to train.
Quantization keeps the same architecture and all its general knowledge at coarser precision, so it cannot deliver a fundamentally smaller, faster model — pushing precision far enough to fake that degrades everything at once. Distillation buys a specialist: excellent at what it was trained on, thinner everywhere else, which is the trade this task is happy to make.
How should you think about combining compression techniques?
They act on different axes — distillation shrinks the architecture, quantization coarsens the numbers, pruning removes weights — so they compose rather than compete. Treating it as a single switch leaves easy wins unclaimed, and the compounding-loss worry is a reason to measure at each stage, not to stop at one.
Quick answers
What's the difference between quantization and distillation?
Quantization keeps the same model but stores its numbers in fewer bits (16-bit → 8-bit/4-bit), so it shrinks without changing architecture. Distillation trains a new, smaller student model to imitate a larger teacher, producing a genuinely smaller network. One compresses the representation; the other compresses the model.
Which is better, quantization or distillation?
Different jobs. Quantization is cheap, fast, often near-lossless to 8-bit, and needs little retraining — the default first move. Distillation needs training and data but yields a truly smaller, faster model for a task. Many teams distill, then quantize the student.
Does quantization hurt quality?
To 8-bit, loss is usually small — INT8 is a safe default. At 4-bit and below it degrades more, though modern methods keep it usable. Quantization-aware training recovers much of the loss at aggressive bit-widths versus just rounding a finished model.
Can you combine them?
Yes, and it's common: distill a large teacher into a smaller student to cut parameters, then quantize that student to cut memory. Pruning is a third, composable axis. Together they hit targets a single technique can't.
Quantization vs Distillation: round the numbers, or train an apprentice
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Prompting HandbookA friendly, hands-on field guide for everyday humans — learn the CRISP framework, spot bad prompts, practice with real recipes, play a drag-and-drop game, and test yourself with a quiz. No code required.Read →
- The Senior AI Engineer Interview Handbook60 questions across architecture, production incidents, agentic systems, RAG, evals, cost, safety, and leadership — what staff-level AI interviewers actually probe for.Read →
- The LLM Serving HandbookHow to serve large language models fast and cheap — prefill vs decode, the KV cache, continuous batching and PagedAttention (vLLM), quantization, speculative decoding, and the latency-vs-throughput tradeoffs that decide your inference bill.Read →
- The Transformers HandbookThe architecture behind every LLM, built up from scratch — tokens and embeddings, positional encoding, self-attention (query/key/value), multi-head attention, the transformer block (FFN, residuals, layer norm), and how a decoder-only model generates text autoregressively.Read →
- The Fine-Tuning HandbookWhen to fine-tune vs RAG vs prompting, full fine-tuning vs parameter-efficient methods, how LoRA and QLoRA make it cheap enough for a single GPU, why the data matters more than the method, catastrophic forgetting, and how to evaluate and decide.Read →
- The On-Device AI HandbookSmall models, everywhere: why 1–14B models got frontier-adjacent (distillation + textbook data), the napkin law of local inference (tokens/sec ≈ bandwidth ÷ bytes), quantization and the llama.cpp / GGUF / Ollama / MLX stack, the honest local-vs-cloud decision table, four hybrid patterns that ship, and the evals craft of choosing a small model that actually fits the device.Read →