A. Smyntyna / Code
ENRU

importance matrix

A measurement of which weights a model actually leans on, made by running a corpus of real text through it and recording how much each weight moves the output. Quantizers use it to decide what can be crushed and what has to be protected. The IQ recipes in llama.cpp are named for it.

The idea that some weights are load-bearing is easy to state and useless until somebody measures which ones. A plain K-quant uses a fixed rule: this layer family gets promoted, that one does not, the same way for every model. An importance matrix replaces the rule with data from the model in front of you.

That is what makes the sub-4-bit recipes possible at all. IQ3_XXS at 3.06 bits per weight would be unusable as a uniform 3-bit squeeze. With the matrix deciding where the damage lands, a 284B model fits on a 128 GB machine.

The catch is that the matrix is only as representative as the text used to build it. A model quantized against an English corpus and then used for code was measured on the wrong thing.

Read next