Dynamic quantisation

Dynamic quants v1 through v3, and how to measure them

This post assumes the block quantisation, K-quants, and imatrix background from part 1.

Dynamic quantisation (v1) — model-specific, but MoE-focused

Unsloth's first "Dynamic" quants targeted mixture-of-experts models like DeepSeek-R1. MoE architectures have uneven sensitivity across their many experts — some experts are activated constantly and need precision, others are rarely activated and can be compressed hard with little damage. A uniform K-quant rule spends bits evenly across experts regardless of that difference. Dynamic v1 measured per-expert importance and allocated bits accordingly, staying mostly within MoE models.

Dynamic 2.0 — generalised, per-layer, dense models included

Dynamic 2.0 (the source of the UD-Q4_K_XL files) extended this to every layer of every model, including dense architectures — Llama 4, Gemma 3, Qwen3.5, Phi-4.

Naming: UD-Q4_K_XL — "UD" marks it as Unsloth Dynamic rather than stock llama.cpp K-quants, and "XL" replaces the S/M/L sizing to indicate the per-layer allocation at roughly the Q4 tier.

How the accuracy claim is measured. Unsloth argues perplexity, the standard quant-quality metric, is a poor measure: aggregate perplexity can stay flat even while individual token predictions flip from correct to incorrect and back, because the errors cancel out across the dataset. They report KL-divergence against the unquantized model's output distribution instead, which is more sensitive to those flips. They've also published a case where a quant scoring worse on both perplexity and KLD (IQ2_XXS) beat a competing quant with better numbers (IQ3_S) on downstream evals like LiveCodeBench and MMLU Pro — evidence that KLD, while better than perplexity, is also not a complete measure.

Dynamic 3.0 — further layer selection, and a new metric

Dynamic 3.0, released within the last few weeks:

Decoder ring: reading a quant filename

| Segment | Meaning | |---|---| | Q4 / Q5 / Q8 | Nominal bits per weight for most of the model | | _0 / _1 | Old-style block quant: _0 = scale only, _1 = scale + zero-point | | _K | K-quant superblock scheme (256-weight superblocks, 8×32 sub-blocks) | | _S / _M / _L | Static, fixed rule for which tensor types get bumped up | | UD-... | Unsloth Dynamic: per-layer, model-specific allocation via calibration | | _XL / _XXL | Dynamic-scheme sizing tier, produced by per-layer analysis rather than a static rule | | IQ2 / IQ1 etc. | Importance-matrix quant — extreme low-bit formats that rely on calibration data to decide where to spend precision, since there is not enough bit budget for a naive scheme to work |

Practical selection guide