llama.cpp now picks its own GGUF quant mix. Here's how well that works

Since late November, llama-quantize can trim a model to an exact file size and decide for itself how to spread the bits across the model's parts. We checked the evidence. For most models the result beats fixed presets like Q4_K_M. On models with Mamba components, though, the tool sometimes misses badly, and it takes a fair amount of prep work.

Analysis Nov 28, 2026 10 min read Original analysis by our editors
Illustrative image, AI-generated

What this is about

If you run a language model locally, you've always picked from a fixed menu of sizes: Q4_K_M, IQ4_XS, Q3_K_M and so on. These presets are ready-made recipes. Each one decides how coarsely every part of the model gets stored. If none of them fits your GPU well, you either leave memory unused or drop down a level.

Since November 23, 2026, llama.cpp has an alternative. Developer EAddario spent 15 months on pull request #15550. With it, you give llama-quantize just one target: a file size (--target-size) or an average number of bits per weight (--target-bpw). The program then works out the mix on its own. The feature landed in pre-release build b12669 on November 24 and, according to an overview on DEV Community, in llama.cpp v1.1.0 on November 26. No major outlet has covered it yet. Below we explain how the method works and check what the measurements so far actually show.

How the tool allocates the bits

Quantization means storing a model's numbers more coarsely, say with 4 bits instead of 16. The model gets smaller and loses some accuracy along the way. Not every tensor (a block of weights, such as an attention matrix) handles this equally well. The fixed presets already account for that roughly, using one rule of thumb for all models.

The new method works in four steps:

  1. Measure the error: For each tensor, it samples a set of rows. It test-compresses them into around 15 formats from IQ1_S to Q8_0, unpacks them again and compares the result with the original. The comparison is weighted by the imatrix, a kind of importance map built beforehand from sample text. It shows which weights carry real weight during actual inference.
  2. Weed out: Formats that take more space without meaningfully reducing the error get dropped. The technical term is Pareto filtering.
  3. Spend the budget: A Lagrangian optimization sets a "price per bit" and finds it via binary search. Bits go to the tensors where they cut the error the most, until the budget runs out. Think of it as packing a car with a fixed trunk: fragile items get plenty of padding, sturdy luggage goes in without any.
  4. Save progress: --state-file stores the measurements. You can resume an interrupted run, and according to a test in the halo-box fork, additional target sizes then take "seconds".

According to the official README, a call looks like this: llama-quantize --target-size 1.5g --state-file mein-state.dat --imatrix imatrix.gguf modell-f32.gguf ausgabe.gguf. --target-exclude lets you rule out formats, such as the very coarse IQ1 and IQ2 types. In that case, though, no state file is saved. If you pin individual tensors with --tensor-type, the tool counts them against the budget. If too little is left for the rest, the run aborts.

The author points out one limitation himself: the method optimizes a proxy, namely the estimated error per tensor. It doesn't measure how much the model as a whole changes afterward. In his words:

"Errors interact non-linearly across layers, there are no guarantees."

What the evidence shows

Most measurements use KLD (Kullback-Leibler divergence). It tells you how far the compressed model's token probabilities drift from the original's. Zero would mean identical.

Source Scope Result
EAddario, PR description 238 comparisons, 34 models, IQ1_M to Q8_0 195 better, 26 tied, 16 worse, 1 without a value
EAddario, January discussion 132 tests, 11 model families 96 better (about 73 %), standard better 25 times, 10 tied
Bartowski (independent) 5 models, 28 comparisons 18 better, 10 worse (5 of them on Granite)
Llamap author (independent) Llama 3.1 8B, Qwen3-8B, 4 levels clearly better than Unsloth Dynamic 2.0 6 times, narrowly worse 2 times
halo-box fork Qwen3-1.7B, 1 comparison even, within measurement noise

The frequently quoted 93 percent breaks down into 82 percent wins and 11 percent ties. Almost all the ties come from the top level: by our count of the PR table, Q8_0 had 22 ties but only 11 wins. Q6_K had the most losses, at 5. The clear gains are in the low and middle range.

Bartowski, one of the best-known GGUF publishers on Hugging Face, released his own tests on the day of the merge. The table shows the ratio of the new method's KLD to the standard preset's KLD on Wikipedia text. Values below 1 are better.

Model Q3_K_M IQ4_XS Q4_K_M Q5_K_M
Qwen3.5-4B 0.543 0.791 0.825 1.118
LFM3-1.7B 0.634 0.952 0.855 1.026
Llama 3.1 8B 0.856 1.054 0.800 0.948
LFM2.5-8B-A1B (MoE) 0.822 0.863 0.795 0.898
Granite 4 H Small 0.759 1.832 1.050 1.406

For Qwen3.5-4B at Q3_K_M, the divergence almost halves (0.0906 → 0.0492). His verdict: in the middle range from Q5_K_M to IQ2_M, it's "an improvement on several models". At the top end, the benefit is small or negative.

Where it misses: Mamba hybrids

IBM's Granite 4 H Small is a hybrid of Transformer and Mamba, a different architecture that processes text as a running state. On top of that, it uses Mixture of Experts. According to Bartowski, it lost "at most sizes by a wide margin". At IQ4_XS, KLD rose from 0.0388 to 0.0712, an 83 percent increase. Only Q3_K_M came out ahead.

The author's own data shows the same pattern. On Nemotron-Nano-9B-v2, another Mamba hybrid, KLD rose from 0.0082 to 0.0119 at Q4_K_M. In the 238-comparison table, the pure Mamba model mamba-2.8b lost at all seven levels, and Falcon-H1-7B at four. In the January analysis, granite-4.0-h-tiny collapsed completely at IQ1_M: perplexity, a measure of how "surprised" the model is by the text it reads, jumped from 39 to 720.

Our take: the proxy scores each tensor in isolation. For architectures with Mamba components, it appears to significantly underestimate the impact of small errors. The cause hasn't been confirmed. The author didn't respond to Bartowski's Granite results in the PR. Reviewer pwilkin merged it anyway, saying: "Let's merge it and fine-tune the special cases in follow-up PRs." Other hybrids fare well: Qwen3.5-4B, which uses Gated DeltaNet layers, benefited clearly in Bartowski's tests.

The cost: compute time and prep work

The author says a run takes 5 to 10 times longer than normal quantization. For reference, an arXiv paper puts standard quantization of Llama 3.1 8B at 27 to 43 seconds. That works out to roughly 3 to 7 minutes, which matches the roughly 3 minutes the Llamap author reports for an 8B model. In a hands-on report on Zenn using Gemma 4 31B, a 15 GB run took 274 seconds. More generally, the author there estimates 10 to 20 minutes for a 30B model on a 16-core CPU.

The real effort lies elsewhere:

  • Source model: You need the uncompressed model. For Gemma 4 31B, that meant downloading about 60 GB.
  • New imatrix: According to the PR, it has to be in GGUF format with activation data, meaning it must be created with llama-imatrix from commit 0504396 onward. Without that data, the target options refuse to run. So older imatrix files from the web may not help.
  • Hardware for the imatrix: For usable speed, the Zenn author cites 64 GB of VRAM at BF16 or 32 GB at Q8_0, or alternatively a cloud GPU.
  • Teething problems: On Windows, the build initially failed because of the Microsoft compiler and a naming conflict, which PR #33014 fixed on November 25. Bartowski noticed that the thread count is ignored with the target options. On Gemma 4, --target-size 15.7g produced a smaller file with better perplexity (56.18) than --target-bpw 5.34 (58.69). The author attributes this to rounding effects.

What about ready-made quants from Unsloth and Bartowski?

Unsloth advertises Dynamic V3.1, released in November for Qwen3.8-27B, as delivering "10 to 15 percent higher accuracy" at the same size. V3.1 is also said to beat ISTA's GSQ-RCO and Exllama-3. But the numbers only appear in charts, and Unsloth doesn't explain how tensors are chosen. These remain vendor claims.

The only independent head-to-head with the new tool comes from the developer of the competing project Llamap. At the same file size, --target-size clearly beat the older Unsloth Dynamic 2.0 at levels Q2 through Q4. On Qwen3-8B Q3, KLD dropped from 0.0640 to 0.0429, a third less. At Q5, however, it trailed slightly (0.0078 vs. 0.0075). Keep two things in mind: only two small dense models were tested, no MoE or hybrid models. And the author's main goal is to show that his own tool does even better. It measures divergence directly at the model's output, but needs about 15 minutes and a 32 GB GPU to do so. On the flip side, an independent user test over the summer found that Unsloth's recipe halved KLD on Qwen3.8-27B compared with Bartowski's IQ2_XXS. So hand-crafted recipes aren't automatically beaten by the automated approach.

One concrete example shows where automation fits: Bartowski's Qwen3.8-27B list jumps from Q2_K (10.82 GB, KLD 0.161) to IQ3_XXS (12.32 GB, KLD 0.074), with nothing in between. That's exactly the kind of gap --target-size can fill. But be careful: file size isn't the same as memory usage. The KV cache, which holds the text processed so far, plus compute buffers come on top. Bartowski's rule of thumb: pick a file 1 to 2 GB smaller than your VRAM. An 11.5 GB file on a 12 GB card only works with very short context or by offloading to system RAM.

Our verdict

The new feature is real progress, but it's no substitute for measuring. For dense Transformer models and regular MoE models in the roughly 2 to 5 bit range, the author's data and independent data agree: divergence is lower than with the fixed presets, often by 10 to 45 percent in KLD. At the top end, from Q6_K up, it adds little. For models with Mamba components, such as Granite 4 H, Nemotron Nano or Falcon-H1, it can do real damage.

Our take: the longer quantization run isn't the problem. That's a few minutes. The expensive parts are the source model, the new imatrix and above all the validation run with llama-perplexity --kl-divergence against the original. Without that check, you don't know whether you've landed on a winner or a loser. It pays off for three groups: anyone who wants to fill a memory gap between two presets, publishers who do their own quantizing, and tinkerers with their own fine-tunes that have no ready-made GGUFs.

If you just want to run a popular model, Bartowski's or Unsloth's ready-made files in the standard sizes will serve you well, especially for hybrid models. What's still unclear is how the method performs on large MoE models and on real tasks like coding. KLD and perplexity only predict that to a limited extent. The arXiv paper on Llama 3.1 8B explicitly notes that perplexity doesn't fully predict behavior on specific tasks.

#llama.cpp#quantization#gguf#local-ai#unsloth

Ask the AI assistant

Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.

Connecting …

The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.

Comments

What do you think? Already tried it? Write it here, no sign-up needed.

  1. Loading comments …

Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.