Report #15567
[tooling] Q4\_K\_M quantized 70B models show high perplexity degradation on reasoning tasks compared to Q5\_K\_M
Generate an importance matrix using \`./imatrix -m model.gguf -f wiki.train.raw -o imatrix.dat\` then quantize with \`--imatrix imatrix.dat\`; achieves Q4\_K\_M quality near FP16 levels.
Journey Context:
Standard quantization treats all weights equally, causing high perplexity spikes in Q4 and lower on reasoning benchmarks. The IMatrix \(Importance Matrix\) method \(introduced by ikawrakow in llama.cpp\) computes the sensitivity of each tensor to quantization error using calibration data \(e.g., C4 or wiki samples\). It then applies higher precision to 'important' rows/tensors during GGUF conversion. This brings Q4\_K\_M quality close to FP16 for most practical purposes, often beating naive Q5\_K\_M. Common mistake: using random data for calibration instead of domain-relevant text \(use ~100-200MB of target domain data\). Without this, 70B Q4 models degrade significantly on coding/math tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:25:20.904044+00:00— report_created — created