In the file list of almost any GGUF build on Hugging Face sits a dozen variants of the same model: Q8_0, Q6_K, Q5_K_M, Q4_K_M, Q4_K_S, IQ4_XS, Q3_K_L, Q2_K. The model card shows a table of descriptions next to them, most entries say “recommended”, but what actually separates the variants is never explained. That is why most people grab Q4_K_M: it is the only one labeled “default size for most”. Drawing on the Selectel blog, we break down what hides behind these names, how 16-bit weights turn into 4, and why at two bits the model falls apart.
Why quantize at all
By default, the weights of a trained model are stored as 16-bit floating point numbers. FP16 weights of a 7-billion-parameter model take up about 14 GB; at 4 bits that is about 4 GB — 3.5 times less. This difference decides whether the model fits into your VRAM or system RAM and how much memory the launch eats together with the context. Quantization is a way to store weights in fewer bits, trading accuracy for size.
Napkin math
Basic symmetric quantization rests on three steps:
scale = max(|w|) / qmax # grid step q = round(w / scale) # stretch and round w ≈ scale × q # multiply back
Here qmax = 2^(b−1) − 1: for 4 bits that is 7, i.e. integer values from −8 to 7 — 16 options per grid node in total. The step is set by absmax, the maximum of the absolute weight values: for weights −0.9 and 0.7 it is 0.9. A napkin example: weights 0.10, 0.24, 0.51, 0.79, 0.98; step 0.98 / 7 = 0.14; quants 1, 2, 4, 6, 7. The maximum reconstruction error is 0.05 against a theoretical ceiling of 0.07 (half the grid step). The largest weight is always reconstructed without loss.
Experiment: 4736 weights under a microscope
The authors staged a toy experiment: the sklearn load_digits task, 1797 images of digits at 8×8 with brightness divided by 16, a split with test_size=0.3 and random_state=0. The model is an MLPClassifier with one hidden layer of 64 neurons, 2000 iterations. Two weight matrices — 64×64 and 64×10, 4736 weights in total plus 74 biases, which are not quantized. Quantization is simulated: q × scale is returned in float64, so there is no real memory saving — only the degradation of quality is measured. An important methodological subtlety: you need a copy of the original weights, otherwise cascading quantization distorts the measurement. The np.clip(q, −qmax−1, qmax) function never fires when the step is chosen via absmax, but you should not delete it — other ways of choosing the step need it.
| Bit width | Accuracy on digits |
|---|---|
| 16 bits (FP16) | 0.980 |
| 8 bits | 0.980 |
| 6 bits | 0.980 |
| 5 bits | 0.976 |
| 4 bits | 0.961 |
| 3 bits | 0.931 |
| 2 bits | 0.109 |
Down to 4 bits the compression is almost free: minus two percentage points for a fourfold saving of memory. Then comes the cliff: 3 bits give 0.931, and 2 bits — 0.109, the level of random guessing for 10 digits (about 0.10). The saving in the experiment: 75,776 bits (about 9.5 KB) turn into 18,944 bits (about 2.4 KB) — exactly 4 times less.
Why everything falls apart at two bits
The culprit is an outlier: one large weight sets the grid step for the entire matrix. The zeroing threshold equals half of absmax, and 96% of the weights of the first matrix and 93% of the second slide into zero. The author compares it with a map of Europe to which a point for Alpha Centauri has been added: the scale is such that all the cities merge into a single dot. In a real network the largest weight is only 1.4–1.6 times bigger than the 99th percentile, so the idea of “cutting away 1% of the outliers” looks natural.
The mechanics of the trade-off. With absmax the step would be 2.0 / 7 = 0.29, and a typical weight of 0.25 divided by it gives 0.86 — after rounding, a one, and all the small neighbors land there too, in that same one. With the percentile the boundary sits at about 0.3, the step becomes 0.3 / 7 = 0.043 — a grid 7 times finer, and the same weight of 0.25 now gives 5.8, i.e. a six. The price of this: clip starts to work. An outlier of 2.0 at a step of 0.043 requires the integer 47, and four bits hold at most seven — clip cuts 47 down to seven, and on the way back 2.0 turns into 0.3. A workable but risky trade.
Group quantization: what the letter K means
The answer to the outlier problem is group quantization: the matrix is divided into groups of 16 weights, and each group gets its own step. An FP16 multiplier per 16 weights adds one bit per weight, so the saving comes out at 16/5 = 3.2× instead of 4×. But the mechanism works: where naive quantization produced 0.109, i.e. pure guessing, groups of 16 weights hold about 0.79. It was 0.980, it became 0.79 — nineteen percentage points lost, ten times more than at four bits, so such a prototype is still unfit for use. A separate detail: “two bits” is in fact two bits per weight plus one more for the multipliers — “the cover is deceiving”. At an equal three bits per weight, naive quantization gives 0.931, while groups on “two” bits give 0.785.
Another important fact about low-bit builds: they “do not look broken”. The generated text is smooth and coherent, but the first things to degrade are arithmetic, code and long chains of reasoning — that is where the errors accumulate.
A dictionary of names: S, M, L, XL, IQ
The letter K in Q4_K stands for group quantization, and with different precision for the layers that influence the result more. The suffixes S, M and L are different variants of this allocation, from the more frugal to the more generous. Q4_K_M is “four bits, in groups, the middle variant of the allocation”. A separate breed are variants like Q4_K_L and Q3_K_XL: an addition by those who publish the builds — the quants are ordinary, but the embeddings and the output layer are kept at Q8_0.
The I prefix, as in IQ4_XS, means i-quants — a separate family of llama.cpp formats: instead of a uniform grid there is a table of 16 values (a codebook). i-quants need an importance matrix (imatrix): calibration data is run through the model, you look at which weights actually participate in the answers, and precision is handed out by importance. imatrix is also applied to ordinary K-quants: in bartowski’s cards it was used for all builds, including Q4_K_M. According to the author, the difference between IQ4_XS and Q4_K_M is in the design of the grid (a table versus a uniform one with groups), not in imatrix.
Beyond GGUF: GPTQ quantizes the weights one by one and corrects the neighbors; AWQ protects the weights with large activations; SmoothQuant moves the outliers from the activations into the weights. INT8 and INT4 are a uniform integer grid; FP8 is an 8-bit floating point number whose nodes are denser near zero and sparser at the edges, while the distribution of weights clusters exactly near zero, with rare outliers sitting at the edges. New video cards compute FP8 natively, and in quality it is almost indistinguishable from full precision, which is why it is often picked for production. Asymmetric quantization with a zero shift is needed for the activations after ReLU; weights are usually compressed symmetrically.
A cheat sheet of the variants
| Variant | What it means | When to use it |
|---|---|---|
| Q8_0 | 8 bits, the basic format | The reference point for comparing quality: losses are practically zero |
| Q6_K | 6 bits, group | When memory is plentiful: quality close to full precision |
| Q5_K_M | 5 bits, group, middle | A compromise between size and quality |
| Q4_K_M | 4 bits, in groups, the middle variant of the allocation | “Default size for most” — the default for most tasks |
| Q4_K_S | 4 bits, group, frugal | When VRAM is tight |
| IQ4_XS | 4 bits, i-quants: a codebook of 16 values, imatrix required | The smallest size at 4 bits |
| Q3_K_L | 3 bits, group, generous | When size matters more than quality: three-bit weights are already risky |
| Q2_K | 2 bits (plus a bit for the multipliers), group | Falls apart: the naive variant is at the level of random guessing |
What this means in practice
To boil it down to decisions: up to about four bits, quantization is cheap — from zero to two points of accuracy for a fourfold saving of memory; on larger models the picture is similar (according to Liu et al., 2025, four-bit weights are almost lossless, three-bit ones are already risky). Below that — only with tests for your own task: which variant to pick for a specific VRAM and a specific job, no table will tell you; only a measurement settles that. And test not the smoothness of the text but arithmetic, code and multi-step reasoning — they break first.
Starting a local experiment is simple: the builds live in the catalog of open GGUF models on Hugging Face, Ollama for running local models helps you launch the downloaded file on your own hardware, and the step-by-step way into the topic is the guide to running local LLMs.
A short takeaway for anyone choosing a build. Down to four bits the compression is almost free: in the experiment on 4736 weights, accuracy drops from 0.980 to 0.961 (minus two points) while the size shrinks exactly 4 times (75,776 bits turn into 18,944). The default is Q4_K_M (“default size for most”); if you need even less — Q4_K_S or IQ4_XS (i-quants with a 16-value codebook, they require imatrix). At three bits the quality already sags (0.931), and two bits without grouping is the level of random guessing (0.109): one outlier sets the grid step, and 93–96% of the weights slide into zero. Group quantization (the letter K, groups of 16 weights, a step per group) partially rescues even two bits — about 0.79 — but gives up nineteen percentage points against full precision. The main practical point: a low-bit model looks fine in chat, while arithmetic, code and long chains of reasoning break first, so a build for your task has to be verified with a measurement.

