Shrinking a model to fit
How a model that needs a data centre can run on a desk, and what you give up.
A 70 billion parameter model stored at full precision needs about 280 GB of memory. Very few machines have that. The largest models have more than ten times as many parameters.
Quantisation is how they are made to fit.
Rounding the numbers
Each parameter is a number. At full precision it is stored with 32 bits, which can describe it very finely. Quantisation stores it with fewer bits.
- With 16 bits, the model is half the size and almost identical.
- With 8 bits, each number is rounded to one of 256 levels.
- With 4 bits, each number is rounded to one of only 16 levels.
A 4-bit model is about an eighth of the full-precision size. That 280 GB model becomes about 35 GB.
It is like sampling sound. A recording with plenty of samples sounds like the original. Take fewer samples and the smooth wave becomes a staircase. It is still recognisable, until it is not.
What you lose
Less than you would expect. Neural networks cope well with rounding. For questions, summaries and most code, a 4-bit model answers almost exactly like the original.
The differences show up at the edges: long chains of mathematical reasoning, subtle wordplay, very long answers that must stay consistent.
Quality does not fall in a straight line. From 8-bit to 4-bit, little is lost, which is why 4-bit is the common standard. Below that there is a cliff. At 3-bit, reasoning becomes noticeably worse. At 2-bit, the output starts to fall apart.
Bigger models tolerate rounding better. They have more spare capacity, so the rounding errors average out.
The rule that surprises people
A large model at 4-bit usually beats a small model at full precision.
Size matters more than precision. If you have a fixed amount of memory, use it for more parameters and not for finer numbers.
See it
Paul’s Chakra simulator shows this happening. Choose a lower setting and the smooth wave turns into steps, the chat begins to produce nonsense and the mandala turns a sickly green.
Close the page in your mind, then answer
Do not scroll up. Pulling the answer out of your own head is the step that makes it stay.