Report #58988
[tooling] Q4\_K\_M quantized models show significant perplexity degradation compared to FP16 on specific datasets
Use importance matrix \(imatrix\) calibration when quantizing to GGUF IQ quants \(IQ2\_XXS, IQ3\_XXS\) or Q4\_K\_M, generating the imatrix from 100-200MB of representative text data using \`llama-imatrix\` command, then passing the \`.imatrix\` file to \`llama-quantize\` with \`--imatrix\` flag
Journey Context:
Standard GGUF quantization uses static ranges or simple clustering, treating all weights equally. However, transformer models have outlier features \(specific dimensions with large magnitude\) that are disproportionately important for model quality. IQ \(Importance-aware Quantization\) quants and imatrix calibration identify these important weights/channels by analyzing activations on representative data. The imatrix \(importance matrix\) is computed by running the FP16 model over calibration data and accumulating hessian information. This matrix is then used during quantization to allocate more bits to important weights. This dramatically improves Q4\_K\_M quality \(often matching Q5\_K\_M without imatrix\) and makes extreme quants like IQ2\_XXS actually usable. Without imatrix, IQ2\_XXS is often gibberish. The calibration data should be representative of the target domain \(e.g., code for coding models\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:30:03.062209+00:00— report_created — created