Nine ways of saying ‘make the model smaller and faster’
Model optimization terms often sound interchangeable, but they change different parts of the system and make different trade-offs. This interactive figure keeps one model and one set of readouts on screen so you can see what each technique actually changes.
Change one setting at a time
One 7-billion-parameter model, drawn as 256 weights. Use the controls and watch parameter count, memory, latency, and retained quality move together.
a The weights
adapter
b What it costs
c The compression pipeline
Open a step to see what it changes.
1 Distillation teacher 7B
Train a small student model to copy a large teacher. The student learns from the teacher’s probability distribution, not only the correct answer. You pay for a training run and get a permanently smaller model.
2 Pruning 0% removed
Zeros were removed, but latency is unchanged. A dense kernel still multiplies by zero at full price—turn on step 6 to skip them.
Delete the weights that matter least—here, the smallest ones. Unstructured pruning leaves holes scattered through the matrix, so it needs a sparsity-aware runtime to become faster. Structured pruning removes whole channels or heads and is easier for ordinary kernels to exploit.
3 Healing raw
A short retraining pass lets surviving weights cover some of what the deleted weights were doing. It usually uses a small calibration set and far fewer steps than the original training run.
4 Fine-tuning general
Keep training a finished model on your own data so it fits your task, tone, or format. A full fine-tune rewrites every weight. LoRA and other adapters freeze the base model and train a small extra matrix beside it—the teal strip. That is why the parameter count here does not move: you added roughly 0.5% more weights, and you can swap them per task.
5 Quantisation FP32
Store each weight in fewer bits, with a shared scale factor per group to map the small integer range back onto real values. Memory falls in exact proportion—and since decoding is limited by how fast weights can be read, latency follows. Look closely at the grid: the shades collapse into visible bands, because there are only many values left to round to. Below 8 bits you usually need calibration data or quantisation-aware training.
6 Optimisation & kernels stock graph
Everything that changes how the graph runs without changing what it computes: fusing operators into one kernel, folding constants, changing memory layout, picking a better kernel for this shape and this GPU, caching keys and values across steps. The maths is identical and the answer is identical—only the clock moves. It is the one step on this list that costs no quality at all, which is why it is done first in practice and last here.
The estimates are deliberately simplified. Real results depend on the model architecture, hardware, kernels, calibration data, sequence length, and workload. The useful part is the direction of each trade-off—not the benchmark value itself.