Cortexa Ground Truth
Nº 42 · Explainer · · 5 min read
Tip: once it’s playing, tap any line to jump the audio there.
How a big AI model gets small.
Quantization stores a model's numbers more coarsely. Distillation trains a small model to copy a big one. Both save money and both cost some quality.
“How is this model so cheap and fast?” Sooner or later a client asks it about a smaller Artificial Intelligence (AI) model that holds up better than expected. Part of the answer is that someone shrank a bigger model. There are two common ways to do it, and each trades a little quality for a lot of savings.
What is a model made of, and why does size matter?
A large language model (LLM) is, at bottom, a very long list of numbers (its weights) that the software multiplies together to produce each word. More numbers mean more memory to hold them and more arithmetic to run them, and that shows up as slower answers and a bigger bill. Shrinking a model means cutting one of those two things: the size of each number, or how many numbers there are.
What does quantization change?
Quantization keeps the same model and stores each number with fewer digits. Hugging Face's documentation describes it as representing weights and activations with low-precision data types like 8-bit integers instead of the usual 32-bit floating point1, which needs less memory and lets the chip do the math faster. Think of rounding 0.7312 to 0.73 across billions of numbers. A research method called GPTQ reduced the weights of 175-billion-parameter models to 3 or 4 bits each with little accuracy loss2, so a model that size could run for generation on a single graphics processing unit (GPU).
What does distillation change?
Distillation builds a different, smaller model. A small “student” is trained to reproduce what a large “teacher” produces. Geoffrey Hinton, Oriol Vinyals and Jeff Dean described it as a way to compress the knowledge in an ensemble into a single model which is much easier to deploy3 (an ensemble is a group of models whose answers are averaged). The best-known small example is DistilBERT, which its authors report is 40% smaller than BERT, keeps 97% of its language understanding, and runs 60% faster4. The student never matches the teacher everywhere. It keeps most of it.
01
The big original
accurate, and costly to run
02
Round or copy
quantize the same model, or distill a new, smaller one
03
Test on your work
real client examples, not the vendor demo
04
Keep it if it holds
good enough for the job, at the lower cost
Either route gives up some quality, so start with the small version and move up only where it falls short.
What's Real?
- The savings are real. Fewer bits per number means less memory and faster arithmetic, and a distilled model has fewer parts to run in the first place. The energy saving is weaker than the memory saving: the same documentation says quantization consumes less energy “in theory”1, and that is worth measuring before it goes in a client's sustainability slide.
- The quality cost is real too, and it grows as the numbers get coarser. One study of the LLaMA 3 models found non-negligible degradation when quantized, most severe at ultra-low bit-widths5 (preprint). Another group found that standard methods work well down to 8-bit but lose accuracy at lower bit widths6 (preprint), which is why they train the model to cope with the rounding.
- A distilled model inherits its teacher's habits and blind spots. It is a copy of a copy, so a gap in the big model usually shows up in the small one, and the 97% figure above is an average on a test, not a promise for your task.
- Neither method tells you whether the result is good enough for a given job. That is an evals7 question, answered on your own examples.
The “so what” — for anyone serving tech clients
- Ask which version you are getting. A vendor's “small” or “fast” option may be a distilled model, a rounded copy of a bigger one, or a separate model altogether. The answer tells you what to test.
- Test the compressed model on the client's own task before you promise a price. A model that scores well in general can still stumble on the one job the client cares about.
- Price the pipeline step by step. Sizing each step to the smallest model that passes its test is where most of the saving sits, and a token9 costs less on a smaller model.
Sources
- Hugging Face — Optimum documentation, “Quantization”
- Frantar, Ashkboos, Hoefler & Alistarh — “GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers” (preprint)
- Hinton, Vinyals & Dean — “Distilling the Knowledge in a Neural Network” (preprint)
- Sanh, Debut, Chaumond & Wolf — “DistilBERT, a distilled version of BERT” (preprint)
- Huang et al. — “An empirical study of LLaMA3 quantization: from LLMs to MLLMs” (preprint)
- Liu et al. — “LLM-QAT: Data-Free Quantization Aware Training for Large Language Models” (preprint)
- Cortexa Ground Truth Nº 8 — “Evals, in plain English”
- Cortexa Ground Truth Nº 22 — “You rarely need the biggest model”
- Cortexa Ground Truth Nº 5 — “What a ‘token’ is, and why it’s on your invoice”
Up next
More in Ground Truth





