Manuscript Offprint

arXiv:2611.00654

GateTrim: Adaptive-Rank Quantization for Large Language Models

Hongwei Ren, Jincheng Ren, Yuchuan Zhou, Jingchun Ling

Abstract

We introduce GateTrim, an adaptive-rank post-training quantization method for large language models that learns matrix-specific ranks through gate optimization and threshold-based rank selection. GateTrim standardizes the low-rank factors of a quantized low-rank-residual representation, learns a separate gate vector for each target weight matrix, and uses a shared threshold to automatically determine its retained rank. The resulting ranks can differ across matrices, and the compact quantized representations are subsequently reconstructed. We evaluate GateTrim under W4A8 on Qwen3-4B/8B/14B, Llama-3.2-3B-Instruct, and Llama-3.1-8B-Instruct. Across all five models, we observe a counterintuitive finding: increasing the threshold from τ=0.3\tau = 0.3 to τ=0.7\tau = 0.7 reduces the mean retained rank by 46.60%-67.89% while simultaneously lowering WikiText-2 perplexity by 0.59%-5.17%. Threshold 0.7 achieves the lowest mean retained rank and final perplexity among the three tested thresholds, 0.3, 0.5, and 0.7, and reduces measured target-export size by 1.50%-4.25% relative to 0.3. GateTrim uses an 8×5128 \times 512-token fitting pool and a separate development pool of the same size. Its Qwen3-4B/8B/14B perplexities at τ=0.7\tau = 0.7 are numerically below TwinQuant's published W4A8 values, reported with a 128×2048128 \times 2048-token calibration pool, in a cross-study comparison. On Qwen3-8B, the threshold-0.7 configuration already has the lowest perplexity before reconstruction under both tested initialization seeds; reconstruction improves it further without increasing retained rank or export size.

1 Introduction

Language model quantization reduces the precision used to represent weights and activations. Its effectiveness depends on how quantization error propagates through the model, as well as on the storage and execution costs of the resulting representation. A useful design represents a weight matrix through a dense quantized residual and an additional low-rank branch. The residual preserves a full-dimensional representation, while the low-rank branch provides complementary capacity for reconstructing the original operator.

This design introduces a capacity-allocation problem. A fixed rank assigns the same number of low-rank components to every matrix, although different attention and feed-forward projections may require different amounts of additional capacity. Increasing the rank adds parameters and computation; reducing it may remove components that are useful after quantization. The

*Corresponding author: Jingchun Ling (lingjingchun1990@qq.com).

appropriate allocation therefore depends on the quantized computation and its reconstruction objective, rather than solely on a decomposition performed before quantization.

Continuous gates provide a way to adjust the contribution of individual components. However, small gate values alone do not reduce stored tensor dimensions. Storage savings require explicit rank reduction and compact serialization. Compaction can also change weight-quantization groups and the groups used to quantize the intermediate activation. A compact representation is consequently not guaranteed to behave like the original representation with a subset of contributions set to zero.

GateTrim learns the retained rank of each target weight matrix through its own gate parameters. A target matrix is an individual attention or MLP projection, rather than an entire Transformer block or a quantization group. Stage 1 reconstructs a quantized low-rank-residual representation while standardizing each row of UU and each column of VV. Stage 2 learns gate amplitudes with the factors and normalization statistics fixed. A shared threshold then converts the learned gates into matrix-specific retained ranks. Stage 3 reconstructs each compact quantized representation at its selected rank. This procedure learns rank through continuous gate optimization followed by discrete rank selection; the threshold is a specified hyperparameter.

Across the five models evaluated under W4A8, increasing the threshold from 0.3 to 0.7 lowers both the mean retained rank and final WikiText-2 perplexity. Threshold 0.7 gives the lowest mean retained rank and final perplexity among the three tested thresholds in every model. For Qwen3-8B, this preference is already present after compact requantization but before reconstruction (q0) under both tested initialization seeds. Reconstruction further lowers perplexity without changing retained rank or export size. The results show that retaining more low-rank components does not necessarily improve the quality of the quantized model.

Our evaluation also examines quantization with a small calibration fitting pool. GateTrim uses eight 512-token fitting sequences and eight separate development sequences, with no gradient updates on the development pool. At τ=0.7\tau = 0.7, GateTrim achieves W4A8 WikiText-2 perplexities of 15.41, 11.24, and 9.49 on Qwen3-4B, Qwen3-8B, and Qwen3-14B, respectively. These are numerically below TwinQuant's published values of 18.3, 11.5, and 10.5, obtained with 128 calibration sequences of 2,048 tokens each [1]. This comparison places our results in the context of published work; the experimental settings of the two studies are detailed in Section 5.3.

The contributions are:

  1. Learning matrix-specific ranks for quantization. We introduce GateTrim, an adaptive-rank post-training quantization method that combines factor standardization with learned gates. A shared threshold automatically determines each target matrix's retained rank from its learned gates, and the resulting compact quantized representation is reconstructed.

  2. Lower rank with lower perplexity. We identify a counterintuitive finding across five model configurations: threshold 0.7 produces a lower mean retained rank and lower WikiText-2 perplexity than threshold 0.3. The preference for 0.7 is also observed before reconstruction on Qwen3-8B under both tested initialization seeds.