📝 Quantisation_Explained.mdv4.7.4 · 2026-11-20

Quantisation Explained: A Beginner's Guide

(Also spelled "quantization" in American English. Same thing.)

If you've ever downloaded an AI model to run on your own computer, you've probably seen file names like Qwen3-8B-Q4_K_M.gguf and wondered what the jumble at the end means. It tells you how the model was quantised, which is the main reason ordinary computers can run these models at all.

This guide explains what quantisation is, why people use it, what it costs, and how to choose a version.


1. First, what is a model actually made of?

A large language model (LLM) such as ChatGPT, Claude, Llama or Qwen is mostly a huge list of numbers called weights (also called parameters).

A typical weight is a small decimal number like 0.0372 or -0.518.


2. How much space does a number take?

Computers store numbers in bits (ones and zeros). More bits give more precise numbers but take more space.

Format Bits per weight Bytes per weight Rough idea
FP32 ("32-bit floating point") 32 4 Very precise, used in training
FP16 / BF16 ("16-bit floating point") 16 2 The usual "full quality" release
8-bit 8 1 Half the size of FP16
4-bit 4 0.5 A quarter of the size of FP16

"Floating point" is the computer's version of scientific notation, so it can store both tiny and large decimals. BF16 ("brain float 16") is a 16-bit variant invented at Google Brain.

Now multiply it out. A 7-billion-weight model at 16 bits needs:

7,000,000,000 × 2 bytes = 14 GB

A 70-billion-weight model needs 140 GB. Most home computers don't have that much memory, and you need room left over for the operating system and the conversation itself.


3. So what is quantisation?

Quantisation means storing each weight with fewer bits, which in practice means rounding it.

Analogy 1: Rounding prices

Imagine a shopping list with exact prices:

$3.47, $12.89, $0.52, $7.15

Round them to the nearest 50 cents:

$3.50, $13.00, $0.50, $7.00

The list is shorter to write and still very close to right. Your total will be a little off, but not by much. That's quantisation: you trade a little accuracy for a lot of space.

Analogy 2: Reducing the colours in a photo

A photo can use millions of colours. Squeeze it down to 256 colours (like an old GIF) and it still looks mostly the same, though smooth gradients get slightly banded. Squeeze it to 16 colours and it starts to look like a poster.

Quantising a model works the same way. Going from 16 bits to 8 bits is barely noticeable, 4 bits shows a small loss, and 2 bits starts to look like the poster.


4. How it actually works: a worked example

The clever bit is that weights aren't rounded one at a time against a fixed ruler. They're handled in small blocks (typically 32 weights), and each block gets its own scale, like giving each region of a photo its own colour palette.

Here's a simplified example with a block of 8 weights squeezed into 4 bits. Four bits can hold only 16 whole numbers, from -8 to 7.

Original weights:

0.12  -0.53   0.88   0.05  -0.91   0.40   0.33  -0.07

Step 1: Find the scale. The biggest value (ignoring the minus sign) is 0.91. Divide it by 7, the largest whole number allowed:

scale = 0.91 ÷ 7 = 0.13

Step 2: Divide each weight by the scale and round to a whole number:

  1     -4      7      0     -7      3      3     -1

These small whole numbers are what get saved, at 4 bits each, plus the one scale number for the whole block.

Step 3: When the model runs, multiply back by the scale:

0.13  -0.52   0.91   0.00  -0.91   0.39   0.39  -0.13

Compare with the original:

Original 0.12 -0.53 0.88 0.05 -0.91 0.40 0.33 -0.07
Restored 0.13 -0.52 0.91 0.00 -0.91 0.39 0.39 -0.13
Error 0.01 0.01 0.03 0.05 0.00 0.01 0.06 0.06

The restored values are close, but there are two things to notice:

Why big values ("outliers") are the real enemy

Now change one weight in the same block to a large value, 5.0:

0.12  -0.53   5.0   0.05  -0.91   0.40   0.33  -0.07

The scale becomes 5.0 ÷ 7 ≈ 0.71, and everything else gets crushed:

0.00  -0.71   5.00   0.00  -0.71   0.71   0.00   0.00

One big number spoiled the whole block. Real models do contain a small number of these unusually large weights, and some of them matter a great deal. This is why:


5. Why bother? The benefits

  1. It fits. A 7B model drops from about 14 GB to about 4–5 GB at 4-bit, so it runs on an ordinary laptop or a modest graphics card.
  2. It's faster. When a model writes text, most of the time goes into reading weights from memory, not into doing sums. Smaller weights mean less to read, so you get words out faster.
  3. Bigger models become possible. This is the most important point, covered in section 8.

Approximate file sizes

Model size FP16 (full) Q8_0 Q6_K Q5_K_M Q4_K_M Q3_K_M Q2_K
7B 14 GB 7.4 GB 5.8 GB 4.8 GB 4.2 GB 3.4 GB 2.3 GB
14B 28 GB 15 GB 11.5 GB 9.6 GB 8.4 GB 6.8 GB 4.5 GB
32B 64 GB 34 GB 26 GB 22 GB 19 GB 16 GB 10 GB
70B 140 GB 74 GB 58 GB 48 GB 42 GB 34 GB 23 GB

Rough figures only. Real files vary a little by model. You also need extra memory on top of the file for the conversation (see section 10).


6. So is the model worse? (The honest answer)

Yes, always a little. Rounding throws information away, and you can't get it back. The question is how much, and that depends mostly on how many bits you keep:

Bits What to expect
16 The original. Reference quality.
8 So close to the original that in practice you won't notice.
6 Very close. Hard to tell apart in normal use.
5 Small loss. A good choice if it fits.
4 The popular sweet spot. A small but real loss, usually acceptable.
3 Clearly weaker. More mistakes, more strange phrasing.
2 Badly damaged, especially in smaller models. Only worth it for very large models you otherwise couldn't run.

Where the damage shows up

In everyday chat, a 4-bit model often seems identical to the original. The loss shows up in harder work:

Benchmarks (standard tests that score models) can hide this, because they average lots of easy questions together with a few hard ones.

Small models suffer more

A 70B model has a lot of spare capacity and shrugs off rounding. A 3B or 4B model has very little spare, so every bit it loses hurts more. For small models, use higher bit counts (Q6 or Q8) if you can.


7. Decoding the file names

Most people running models at home use llama.cpp (a popular free program for running models) or tools built on it, such as Ollama and LM Studio. These use the GGUF file format. ("GG" comes from llama.cpp's creator, Georgi Gerganov.)

A name like Q4_K_M breaks down like this:

Part Meaning
Q4 Mostly 4 bits per weight
K The "K-quant" family, llama.cpp's improved method that also stores the block scales efficiently
_S / _M / _L Small, Medium or Large: how many of the more sensitive parts of the model are kept at higher precision. M is the usual balance.

Other names you'll see:

Formats from other ecosystems (mostly for graphics-card servers):


8. The trade-off that matters most

The useful question usually isn't "Is the 4-bit model worse than the full one?" It's this:

"With the memory I have, what's the best model I can run?"

Say you have about 16 GB to spare. Your choices might be:

In most cases the bigger model at lower precision beats the smaller model at full precision. A large model that's slightly blurred still knows more than a small model in perfect focus.

So quantisation makes a given model a bit worse, but it usually lets you run a better model than you could otherwise afford.


9. How to choose: rules of thumb

  1. Start with Q4_K_M of the biggest model that fits comfortably. That's the common sweet spot.
  2. If you have room to spare, step up to Q5_K_M, Q6_K or Q8_0.
  3. For small models (under about 8B), prefer Q6_K or Q8_0. They're cheap to store anyway, and small models are fragile.
  4. Avoid going below Q3 unless the model is very large (70B and up) and there's no other way to fit it.
  5. Prefer "imatrix" versions when they're offered.
  6. Leave headroom. The file has to fit in memory along with the conversation, so don't pick a file that uses all your RAM or video memory.
  7. If accuracy really matters (code, maths, facts you'll rely on), use the highest precision you can, and check the answers.

10. It's not just the weights

While it's working, a model keeps a running memory of the conversation called the KV cache ("key–value cache"), its working notes on everything said so far. For long conversations this can grow to several gigabytes.

The KV cache can be quantised too (in llama.cpp, with the --cache-type-k and --cache-type-v options). 8-bit is usually safe. Going lower can hurt long-conversation quality more than you'd expect, because errors in that working memory affect every word that follows.


11. How do people measure the damage?


12. Common myths

"Quantised models are broken." Not at 8-bit or 6-bit, and usually not at 4-bit. They're slightly blurred, not broken. Below 3-bit, it gets harder to argue with this one.

"4-bit means 4 times worse." No. It means about a quarter of the size of 16-bit. The quality loss is far smaller than that.

"Full precision is always the best choice." Only if you can afford the memory. Otherwise a bigger quantised model usually wins.

"You can un-quantise a model to get the quality back." No. Once the detail has been rounded away, it's gone. Converting back to 16-bit just gives you a bigger file of the same rounded numbers.

"All Q4 files are the same." No. The method, whether an importance matrix was used, and which parts were protected all make a difference. Q4_K_M with an imatrix is usually noticeably better than plain Q4_0.


13. A note on what's coming

Some model makers now release versions trained with quantisation in mind (called "quantisation-aware training"), so the model learns during training to cope with the rounding. These lose noticeably less at 4-bit than models squeezed down afterwards. Expect more of this.


Quick glossary

Term Plain meaning
LLM Large language model, the kind of AI that writes text
Weights / parameters The billions of numbers that make up a model
7B, 70B 7 billion, 70 billion weights
Bit A single 0 or 1. More bits give more precise numbers.
FP16 / BF16 16-bit number formats, the usual "full quality" release
Quantisation Storing weights with fewer bits by rounding them
Block A small group of weights that share one scale number
Scale The multiplier used to turn the stored whole numbers back into decimals
Outlier An unusually large weight that can spoil rounding for its neighbours
Token A word or piece of a word, the unit a model reads and writes
GGUF The model file format used by llama.cpp, Ollama, LM Studio and others
K-quants llama.cpp's improved quantisation family (Q4_K_M, Q5_K_M, Q6_K, ...)
I-quants Newer llama.cpp methods aimed at very low bit counts (IQ2, IQ3, ...)
imatrix Importance matrix: a measurement of which weights matter most, used to protect them
GPTQ / AWQ Quantisation methods common on graphics-card servers
KV cache The model's working memory of the current conversation
Perplexity How "surprised" a model is by text. Lower is better.
KL divergence How far a quantised model's choices have drifted from the original's
RAM / VRAM Your computer's main memory / your graphics card's memory

In one sentence: quantisation rounds a model's numbers so it takes much less memory and runs faster. At 8-bit you lose almost nothing, at 4-bit you lose a little, below 3-bit you lose a lot, and a bigger model at 4-bit usually beats a smaller one at full precision.