Manuscript Offprint

arXiv:2608.28003

A Method for Layer Bit-Width Allocation in LLM Quantization via Performance Maximization Under a Quality-Degradation Constraint

Artem Safronov

Abstract

This paper proposes a layer bit allocation method for Gemma-3-1B, which formulated the problem as a performance maximization (latency decrease) function under a given degradation budget constraint (the allowable level of generation quality loss). The allocation differs from time- and money-consuming uniform layer quantization methods such as GPTQ or AWQ and allocation methods without performance acceleration proof such as MixLLM or TorchAO. To do this, the author used the layer sensitivity profile obtained in the previous research (SA-PTQ) and implemented it through activation pass-through mode in TensorRT LLM. The precision of each layer is individually determined in blocks according to the previously introduced grouping (5+5, 10+10, all26), thus separating the contribution of FFN, Attention, and lm_head to the overall speedup.

The clock speed measurements were made in 13 W8A8 variants on the RTX 5090. As a result, it was found that for FFN and lm_head, the time costs of quantization/dequantization procedures are compensated by the introduction of integer arithmetic. In the case of short context lengths, the reverse situation is observed for Attention: the addition of another quantization step leads to slower model execution. Besides, the manual implementation of SmoothQuant for TensorRT LLM was proposed due to the export process's failures, which is not available for lm_head.

The highest performing solution under the joint consideration of all three criteria with minimal degradation was FFN 5+5 configuration with lm_head, which demonstrated 11.0% latency reduction with negligible quality loss (98.90% Top-1 agreement, +0.85% perplexity degradation). However, a significant increase in performance by 19.1% was possible under acceptable quality loss conditions for FFN all26 + lm_head configuration. Several optimizations were suggested to further accelerate the model: fused INT8 attention kernels, KV-cache quantization, FP8 conversion instead of INT8, and partial Attention quantization similar to the FFN block.

Keywords: quantization, mixed-precision, TensorRT-LLM, Gemma-3-1B, SmoothQuant, W8A8, LLM inference, SA-PTQ

1 Introduction

The recent boom of distillation methods gave rise to the appearance of compact and versatile small language models (sLLMs) which can run on the consumer hardware. Gemma 3 1B is one such model — it uses about 2 GB of video memory, which makes it a viable candidate for the user-facing applications, including the video games requiring real-time generation.

The standard way of quantizing such models with the state-of-the-art GPTQ [2] or AWQ [3] quantization methods is to apply the same set of weights to all the layers indiscriminately. However, as it was shown by the author in "A Layer Importance Metric for Quantization...", the sensitivity of the model layers to quantization is vastly different — with the FFN block having a normalized sensitivity of Q=0.796Q = 0.796 (mean SQNR of 29.70 dB) and the embedding matrix in the tokenizer being surprisingly robust with a value of Q=0.819Q = 0.819 (mean SQNR of 45.61 dB), and other layers staying in between. This effectively creates groups of layers which can have much higher compression ratios than others.

sLLM class models' arrival made the question of why to use the mixed-precision quantization with varying ratios for different layers even more intriguing, as the memory savings are no longer critical for the 8 GB VRAM GPUs and above: a 2 GB model is easily placed in such a GPU with no memory issues. The issue of the computational efficiency still stands, and the only existing work which attempted to address it, MixLLM [5] and TorchAO [6], does not provide the evidence of any specific layers or operations within the modern transformer architecture benefitting from the mixed-precision nature of their approach more than others and, by extension, justifying the additional overhead from the per-layer quantize/dequantize steps at the model boundaries.

The present paper introduces the method for performing the selective mixed-precision quantization based on the SA-PTQ sensitivity estimates and activation pass-through mode in TensorRT-LLM [7] and provides the concrete evidence for the benefits for such an approach in terms of FLOPs per second for the model with the per-layer ratios, based on the real-world measurements with TensorRT-LLM. Contrary to the claims of the methods which effectively remove the per-layer quantize/dequantize overhead by advertising it as a general property of mixed-precision weights, the present paper actually measures the said overhead and its impact on the per-layer FLOPs for various operations in the transformer, demonstrating that for the FFN and lm_head layers the overhead is always offset by the gains from performing the calculations in the INT8 domain while for the short context lengths Attention operations, on the contrary, actually lose performance due to the overhead. The method allows to accelerate the inference by up to 11

The goal of this work is to apply the SA-PTQ layer importance metric developed in the author's previous work to the practical task of mixed-precision quantization of the Gemma-3-1B language model using TensorRT-LLM. The work provides an empirical assessment of the trade-off between inference speedup and generation-quality degradation for three key model subsystems – FFN, the Attention mechanism, and lm_head – individually and in combination, with the aim of identifying quantization configurations that provide the maximum hardware gain under controlled information loss.

References (19)