A Layer Importance Metric for Quantization Accounting for the Speed-Quality Trade-off in Autoregressive Models
Abstract
Small language models (sLLMs) are nowadays hosted on devices with limited memory and computational budget. In an autoregressive setup, inference is memory-bandwidth bound: uniform quantization is often detrimental to such models, since their architecture has limited redundancies and only a few layers are not very sensitive to lower precision. We propose a composite metric that combines two orthogonal criteria: information retention (measured in terms of a normalized SQNR-based coefficient) and throughput gains (modeled using a roofline-based latency analysis). By profiling Gemma 3 1B, we find that Feed-Forward Network blocks and the embedding matrix are the most promising targets for acceleration. For each candidate, we estimate a normalized quality score based on simulated quantization and a normalized speed score based on roofline modeling with no actual execution needed. We combine the two scores in a composite priority coefficient, allowing us to tune the trade-off between speed and quality as needed. Our metric is general and can be used to prioritize individual blocks, their projection sublayers, or transformer layers as a whole. We evaluate our approach on several model architectures, showing that our estimates have at around 4% prediction error for the accelerated speedup. We find that our method generally allocates more resources to the most expressive layers compared to evolutionary search, specialized accelerators, or Shapley-value-based approaches that require expensive approximate inference. Our analytical approach makes sLLM quantization a predictable engineering task.
Figures & tables
| Variant (FFN/Attn/Emb) | short | dnd_10 | dnd_50 | dnd_100 | size, MB |
|---|---|---|---|---|---|
| Q8 only attn_v | 62.3 | 63.7 | 61.3 | 58.0 | 1999 |
| Q8 only attn_kv | 63.1 | 63.9 | 58.5 | 59.1 | 1992 |
| Q8 only attn_k | 64.4 | 60.8 | 61.4 | 58.0 | 1999 |
| F16 F16 F16 | 67.2 | 64.6 | 64.4 | 61.7 | 2007 |
| F16 Q8 F16 | 67.7 | 65.6 | 64.7 | 59.7 | 1935 |
| Q8 ffn_all=F16 | 72.3 | 73.7 | 70.7 | 65.5 | 1652 |
| Layers | 26 |
|---|---|
| lm_head F16 | 1.900 ms |
| lm_head Q8 | 0.945 ms |
| Token F16 | 6.33 ms (158.0 tok/s) |
| Token Q8 (predicted) | 5.37 ms (186.1 tok/s) |
| Actual speedup | 1.148, 5.51 ms (181.3 tok/s) |
| Error | 2.6% |
| gemma-3-1b-it | llama3.2-1b | qwen2.5-1.5b | |
|---|---|---|---|
| Layers | 26 | 16 | 28 |
| FFN F16 (1 block) | ms | ms | ms |
| FFN Q8 (1 block) | ms | ms | ms |
| (analytical) | 1.94 ms | 2.52 ms | 3.61 ms |
| 12.53 ms (79.8 tok/s) | 11.57 ms (86.4 tok/s) | 17.53 ms (57.0 tok/s) | |
| (hybrid) | 10.59 ms | 9.05 ms | 13.92 ms |
| Model | Predicted | Actual | Error |
|---|---|---|---|
| gemma-3-1b-it | 1.183 | 1.175 | 0.7% |
| llama3.2-1b | 1.278 | 1.236 | 3.3% |
| qwen2.5-1.5b | 1.259 | 1.344 | 6.3% |