Report #39537
[tooling] Quantized GGUF models show poor quality at Q4\_K\_M compared to unquantized baseline
Use llama-quantize with --imatrix calibration.dat computed from representative dataset via imatrix tool before quantizing; this computes per-tensor importance to preserve precision on critical weights
Journey Context:
Standard quantization treats all tensors equally, leading to disproportionate error accumulation in sensitive layers \(attention norms, output projections\). The imatrix tool performs a forward pass on calibration data to calculate which tensors have highest impact on perplexity, then llama-quantize uses this to allocate quantization bits intelligently. Without imatrix, Q4\_K\_M often degrades reasoning; with it, Q4\_K\_M frequently matches Q5\_K\_M quality. Process: compile imatrix example, run on ~1000 chunks of target domain text to generate calibration.dat, then pass to llama-quantize --imatrix calibration.dat.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:50:23.069851+00:00— report_created — created