JA EN
LearnDistillation & Compression
·★ MEMBER·PAPER·10 min read

Distillation vs. Quantization vs. Pruning — Three Roads to a Smaller Model

There are three roads to a smaller model: coarsen the number grid (quantization), remove weights outright (pruning), or rebuild the thing at a smaller size (distillation). A head-to-head comparison on compression ratio, accuracy, and implementation cost — and why, when you stack them, training-based methods go first and quantization goes last.

ModalitytextTaskinference

Distilling the Knowledge in a Neural Network

Primary source — what this article is built on

undefined2026-08-29

Distilling the Knowledge in a Neural NetworkarXiv:1503.02531Paper page·PDF
Learning both Weights and Connections for Efficient Neural NetworksarXiv:1506.02626Paper page·PDF
Deep Compression: Compressing Deep Neural Networks with Pruning"arXiv:1510.00149Paper page·PDF
https://arxiv.org/abs/1510.00149"Trained Quantization and Huffman Coding
DistilBERT"arXiv:1910.01108Paper page·PDF
a distilled version of BERT: smallera distilled version of BERT: smaller
fasterfaster
https://arxiv.org/abs/1910.01108"cheaper and lighter
GPTQ: Accurate Post-Training Quantization for Generative Pre-trained TransformersarXiv:2210.17323Paper page·PDF
SparseGPT: Massive Language Models Can Be Accurately Pruned in One-ShotarXiv:2301.00774Paper page·PDF

Three ways to lighten a load

Say you want to move house with fewer boxes. You have three options.

You can lower the fidelity of what you keep: re-save every photo in the album at a coarser resolution. The count stays the same; only the bytes shrink. You can throw away what you never use: the pot you haven't touched in three years goes, and the pile physically shrinks. Or you can look at everything and rebuild: lay it all out, decide what this life actually requires, and assemble a smaller kit from scratch.

Shrinking a neural network maps onto those three options with surprising precision. In order: quantization, pruning, and distillation. This article puts all three on the same table. The goal isn't to go deep on any one of them — it's to answer two practical questions: which one fits your situation, and if you use several, in what order.

What each one actually removes

Let's fix the vocabulary first, because the three techniques delete genuinely different things.

Quantization lowers the bit width of the numbers that represent weights and activations. A weight stored in 16 bits (fp16) gets stored in 4 instead. The parameter count does not change at all, and neither does the shape of the model. Only bytes-per-weight goes down.

Pruning removes weights — either by zeroing individual entries, or by deleting whole heads, channels, or layers. The surviving weights keep their full precision; there are simply fewer of them.

Distillation trains a different, smaller model (the student) using the outputs of the large one (the teacher) as its target. Layer count, hidden width, vocabulary, even the architecture itself are all yours to choose. You aren't modifying the original model; you're rebuilding it.

In one line: quantization cuts precision, pruning cuts count, distillation rebuilds. That difference is what produces every entry in the table below.

Head to head on three axes

Quantization Pruning Distillation
What shrinks Bits per weight Number of weights The model itself
Typical compression 2–4× (16 → 8/4 bits) Depends on method and tolerated loss (unstructured goes further) Anything — you design the student
How accuracy degrades Gradually, then a cliff below some bit width Worse the sparser you go; structured hurts more Depends on student capacity; a bad design loses a lot
Data needed A few hundred calibration samples (PTQ) Calibration to full retraining Lots — sometimes generated by the teacher
Compute needed Minutes to hours on one GPU Hours, plus retraining A full training run. The heaviest by far
Does it get faster? Usually yes, especially when bandwidth-bound Hardware-dependent. This is the big trap Yes, reliably — it really is a smaller model
Can it change the shape? No Partly (whole layers/heads) Completely

The row to stare at is the second-to-last one. "Smaller" and "faster" are not synonyms. Quantization shrinks what sits in memory and shrinks the bytes you read per step, so in the bandwidth-bound generation phase it translates directly into speed. Pruning, as we'll see, buys you nothing at all unless the zeros you created are in a form where the hardware can actually skip the work. Get this wrong in a design doc and you'll discover it only after the implementation lands and nothing improved.

Before going further, it's worth feeling what "coarsening the grid" does. The mechanism is essentially the same one JPEG uses.

FIG 1Lower the Q value and fewer coefficients survive, so the file shrinks. For a while the image barely changes — then, past a point, the blocks fall apart. Weight quantization produces a curve of exactly this shape

Note the shape: it doesn't degrade smoothly. It holds up to a point, then drops off a cliff. All three techniques behave this way.

Quantization — the cheapest option, and the one to try first

Underneath, quantization is a division and a rounding step that maps a range of real numbers onto an evenly spaced grid. For the simplest symmetric scheme:

s=maxiwi2b11,w^i=sround ⁣(wis)s = \frac{\max_i |w_i|}{2^{b-1}-1}, \qquad \hat{w}_i = s \cdot \mathrm{round}\!\left(\frac{w_i}{s}\right)
(1)

Here wiw_i is the original weight, bb is the bit budget, and ss is the grid spacing (scale). In words, equation (1) says only this: pick the spacing so that the largest weight in the group lands exactly on the largest representable integer, then round everything else onto that grid. What you store is the rounded integers plus one ss per group.

The reason its implementation cost is in a different league from the other two is that no training is involved. Post-training quantization (PTQ) is mature; methods like GPTQ optimize the rounding layer by layer using only a few hundred calibration samples, and finish on large models in hours on a GPU. No dataset to ass

What's behind this

§

Members-only from here

371 walkthroughs, 26 textbook chapters, 48 student units and 6 close readings — all included for $4.99/mo, with three new explainers every day. Cancel any time; access runs to the end of the period.

Already a member? Sign in to keep reading

References

  1. Distilling the Knowledge in a Neural Network. arXiv:1503.02531Paper page·PDF
  2. Learning both Weights and Connections for Efficient Neural Networks. arXiv:1506.02626Paper page·PDF
  3. Deep Compression: Compressing Deep Neural Networks with Pruning. "arXiv:1510.00149Paper page·PDF
  4. https://arxiv.org/abs/1510.00149". Trained Quantization and Huffman Coding
  5. DistilBERT. "arXiv:1910.01108Paper page·PDF
  6. a distilled version of BERT: smaller. a distilled version of BERT: smaller
  7. faster. faster
  8. https://arxiv.org/abs/1910.01108". cheaper and lighter
  9. GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers. arXiv:2210.17323Paper page·PDF
  10. SparseGPT: Massive Language Models Can Be Accurately Pruned in One-Shot. arXiv:2301.00774Paper page·PDF

This article is written from the source paper above. Where they differ, the original is authoritative.

Comments

Sign in to comment