---
title: Group-wise Lookup-free Quantization (GQ)
url: https://www.emergentmind.com/topics/group-wise-lookup-free-quantization-gq
type: topic
---

# Group-wise Lookup-free Quantization (GQ)

Group-wise Lookup-free Quantization (GQ) denotes a family of quantization schemes in which a tensor or latent representation is partitioned into groups, but the resulting discrete representation is executed without runtime nearest-neighbor search, prototype-table access, or per-group scale switching inside the arithmetic hot path. The term is used across several distinct settings—mixed-precision LLM inference, discrete visual tokenization, fully quantized Winograd convolution, and ultra-low-bit scalar LLM quantization—but the shared objective is consistent: preserve the accuracy advantages of finer granularity while retaining hardware-efficient execution paths [2310.04836] [2508.05599] [2412.19867] [2604.18556].

## 1. Core definition and semantic scope

In GQ, the phrase **group-wise** refers to quantization granularity that is finer than tensor-wise or channel-wise quantization, but coarser than per-element quantization. The precise grouping depends on the application. In LLM weight quantization, groups are typically formed along the reduction axis or row-wise over consecutive entries; in WeTok, grouping is channel-wise over latent dimensions; in Winograd convolution, groups are aligned with row, column, or vector-width structure in transformed tensors; in GSQ, groups are formed row-wise with group size 128 by default [2310.04836] [2508.05599] [2412.19867] [2604.18556].

The phrase **lookup-free** is not identical across these works. In DGQ for A8W4 LLM inference, lookup-free means that the INT8 GEMM inner loop consumes only integer tensors and does not read or switch scales per group; all scales needed at inference reduce to a single per-output-channel FP16 post-scale applied outside the inner GEMM loop [2310.04836]. In WeTok, lookup-free means that quantization does not perform nearest-neighbor search against stored code vectors, and decoding into the decoder input is also lookup-free because the quantized latent is the binary tensor itself [2508.05599]. In fully quantized Winograd convolution, lookup-free means the method uses standard uniform affine quantizers with per-group scales and optional zero-points, with no codebooks or learned LUT indices [2412.19867]. In GSQ, lookup-free means runtime dequantization is the product of one per-group scale and one small integer code on a fixed symmetric grid, so kernels remain standard scalar weight-only kernels [2604.18556].

A common misconception is that lookup-free quantization is necessarily scale-free. These papers show the opposite. DGQ retains a per-output-channel FP16 post-scale, Winograd GQ tracks fused scales through transform stages, and GSQ uses one real scale per group. Lookup-free therefore refers to the elimination of expensive runtime indirections, not to the absence of scaling metadata.

## 2. Common algorithmic patterns

Across the cited works, GQ appears in three main technical forms. This suggests a useful taxonomy rather than a single canonical algorithm.

The first form is **scale absorption into arithmetic-friendly tensors**. DGQ starts from fine-grained INT4 weights, then converts them into a coarse-grained INT8 representation so that inference uses continuous INT8 GEMM kernels without per-group scale lookups. The central mapping is

$$
S^{(2)} = \mathrm{round}\Big(\frac{S'}{s^{(1)}}\Big), \quad
q^{(8)} = \mathrm{clip}\Big(S^{(2)}\cdot\big(q^{(4)} + zp^{(4)}\big), -127, 127\Big), \quad
\hat{w} \approx s^{(1)}\cdot q^{(8)}.
$$

The group-wise scales are absorbed offline into $q^{(8)}$, leaving only a single channel-wise post-scale at runtime [2310.04836]. Winograd GQ follows a related idea, but at the level of transformed convolutional operands: scale factors from quantized transform matrices, transformed inputs, and transformed weights are fused so that the integer path never needs table lookups, and final dequantization multiplies by the accumulated scale [2412.19867].

The second form is **implicit codebooks without prototype storage**. WeTok partitions the latent tensor into groups and quantizes each group with a sign operator over an implicit binary hypercube. For each group,
$$
t^{(g)}[i, j, m] = \mathrm{sign}(z^{(g)}[i, j, m]),
$$
so the per-group code lies in $\{-1,+1\}^{d'}$, and the decoder input is simply the concatenated binary tensor [2508.05599]. No stored prototypes and no nearest-neighbor search are involved.

The third form is **fixed scalar grids with learned assignments**. GSQ uses a symmetric integer grid $G=\{g_k\}$ and group-wise scales $s_g$, with dequantization
$$
\hat w_i = s_g \cdot q_i,
$$
where $q_i \in G$. Runtime remains lookup-free because the kernel performs integer code unpacking plus per-group scale multiplication, but the assignments are optimized with a Gumbel-Softmax relaxation rather than simple local rounding [2604.18556].

These forms share a systems-level principle: they push complexity into offline preprocessing, training-time optimization, or entropy regularization so that inference-time execution can remain vectorizable and kernel-compatible.

## 3. DGQ and lookup-free A8W4 inference for LLMs

"Dual Grained Quantization: Efficient Fine-Grained Quantization for LLM" introduces a mixed-precision A8W4 scheme designed to preserve the accuracy of fine-grained group-wise INT4 weight quantization while avoiding the inference inefficiency that ordinarily arises when different segments of the reduction axis use different scales [2310.04836].

The starting point is the standard contrast between coarse-grained and fine-grained quantization. Channel-wise quantization assigns one scale per output channel and aligns naturally with integer GEMM because the inner loop does not need to change scales mid-accumulation. Group-wise quantization splits the input-channel dimension into groups with separate scales, which reduces quantization error but disrupts continuous integer matmul. DGQ resolves this by introducing dual scales for weights: a channel-wise FP16 scale $s^{(1)}$ and a group-wise integer scale $S^{(2)}$ stored as INT8. Fine-grained INT4 codes are lifted into an INT8 tensor offline, after which runtime uses standard CUTLASS INT8 kernels.

At inference, integer GEMM computes
$$
y_{\mathrm{int32}} = q^{(8)} \cdot q_a,
$$
and the final output is approximated by
$$
y \approx (s^{(1)} s_a)\cdot y_{\mathrm{int32}} + b.
$$
In the paper’s notation, the post-scale is $s_{f16}=s_{X,f16}\cdot s^{(1)}$, and the kernel path requires only a single per-output-channel FP16 scale in the epilogue. This is the sense in which DGQ realizes group-wise lookup-free quantization: group-wise scales are not read inside the GEMM hot loop [2310.04836].

Scale determination is handled by a two-phase grid search. Phase 1 computes original group-wise INT4 scales and zero-points by minimizing the reconstruction error of the quantized matmul for each group. Phase 2 decouples the original group-wise scale tensor into $s^{(1)}$ and $S^{(2)}$, enforces integer-range constraints so that $q^{(8)} \in [-127,127]$, and optimizes the channel-wise scale over a small grid. The method also introduces percentile clipping for activations, using a simple percentile smoothing scheme to suppress activation outliers without complex optimization.

The reported empirical results are framed around both quality and systems performance. DGQ consistently outperforms prior A8W4 methods across LLaMA and OPT families and tasks including WikiText-2, C4, PTB, CSQA, and MMLU. With efficient CUTLASS kernels, it achieves up to $3\times$ speedup versus A16W4 for long sequences, and the implementation reports $\mathbf{1.12}\times$ memory reduction and $\mathbf{3.24}\times$ speed gains compared to A16W4. The paper also states that DGQ reaches A8W8-level inference time while using $\sim 0.5\times$ the memory of A8W8 [2310.04836].

The main trade-off is that complexity is shifted from runtime to preprocessing. Projection error can still arise when group-wise INT4 codes are mapped to INT8 through $S^{(2)}$ and $s^{(1)}$, grid-search ranges and resolutions remain design sensitivities, and the benefits depend on robust INT8 GEMM kernels.

## 4. GQ as compositional discrete tokenization in WeTok

"WeTok: Powerful Discrete Tokenization for High-Fidelity Visual Reconstruction" uses GQ in a substantially different regime: discrete visual tokenization rather than arithmetic acceleration. Here GQ converts continuous encoder latents into extremely large compositional codebooks without storing prototypes or performing nearest-neighbor lookup [2508.05599].

Let the encoder produce
$$
z = E(x) \in \mathbb{R}^{C \times H' \times W'}.
$$
WeTok partitions $z$ along the channel dimension into $G$ groups, with each group quantized directly by sign. Each group has a fixed, non-learnable, implicit binary codebook
$$
C_{GQ,g} = \{-1,+1\}^{d'}.
$$
Concatenating the per-group binary vectors yields a token $t[i,j] \in \{-1,+1\}^{C}$ for each spatial location, and the quantized latent fed to the decoder is simply $\hat z(i,j)=t[i,j]$. The effective codebook cardinality per location is
$$
K_{\mathrm{eff}} = 2^C = \prod_{g=1}^{G} 2^{C_g},
$$
which scales exponentially with the latent channel count while avoiding stored code vectors [2508.05599].

The principal technical contribution is not only sign-based quantization, but grouped entropy regularization. WeTok follows lookup-free quantization practice by adding an entropy loss on the code distribution, but factorizes the distribution across groups:
$$
q(c \mid z[i,j]) = \prod_{g=1}^{G} q_G(c_g \mid z^{(g)}[i,j]).
$$
This allows the per-token entropy across the full code space to decompose into a sum of group entropies, and the global codebook entropy to be approximated by a sum of grouped terms. The resulting regularizer,
$$
L_{\mathrm{entropy}}(z) = L_{\mathrm{token}} - \zeta L_{\mathrm{codebook}},
$$
is computed over grouped subspaces of size $2^{C_g}$ instead of the full $2^C$ space. The paper states that this reduces memory from $O(2^C)$ to $O(\sum_g 2^{C_g})$, eliminating the entropy loss as the bottleneck while avoiding the stronger independence assumption of BSQ [2508.05599].

WeTok couples GQ with a Generative Decoder (GD), which reconstructs from grouped binary latents together with an extra noise input $\epsilon \sim N(0,I)$ and models $p(x \mid t,\epsilon)$. The decoder is trained in a second stage by zero-initializing the new input channels so that it initially behaves identically to the pre-trained deterministic version, then gradually learns to use $\epsilon$.

The reported reconstruction numbers are unusually strong for a discrete tokenizer. On the ImageNet 50k validation set, WeTok achieves zero-shot rFID $0.12$, compared with FLUX-VAE $0.18$ and SD-VAE 3.5 $0.19$. Its highest compression model, at compression ratio $768$, achieves zero-shot rFID $3.49$, surpassing Cosmos at ratio $384$ with rFID $4.57$. In-distribution reconstruction results include rFID $0.61$ and PSNR $24.50$ at ratio $16$, and rFID $0.19$ and PSNR $29.69$ at ratio $8$. The ablations isolate GQ itself: with $d'=8$ fixed and increasing $d$, LFQ hits OOM beyond $d \ge 24$, while GQ remains flat at approximately $10.6$ GB like BSQ; increasing the number of groups consistently improves reconstruction metrics [2508.05599].

The main limitation is intrinsic to sign quantization. Because amplitude is discarded, fidelity depends on the decoder’s ability to recover magnitudes and details from binary latents, and the factorized approximation used for codebook entropy remains an assumption.

## 5. Fully quantized Winograd convolution via group-wise affine quantization

"Data-Free Group-Wise Fully Quantized Winograd Convolution via Learnable Scales" extends GQ into convolutional acceleration for diffusion models and CNNs. In this setting, the objective is not prototype-free tokenization or LLM GEMM restructuring, but numerically stable fully quantized Winograd convolution using standard integer arithmetic and no training data [2412.19867].

For Winograd $F(m,r)$ convolution, the transformed quantities are
$$
U = G W G^{\top}, \quad V = B^{\top} D B, \quad Y = A^{\top}(U \circ V)A.
$$
The paper identifies a key failure mode of low-precision Winograd: in the output-domain tensor $Y$, different Winograd taps can have very different variances and ranges, empirically exhibiting a cross-like pattern with orders-of-magnitude differences. Pixel-wise scales would alleviate the numerical problem but would destroy vectorization and kernel efficiency. Group-wise quantization over row, column, or vector-width aligned groups instead offers a hardware-aware compromise [2412.19867].

The quantizer itself is lookup-free affine quantization:
$$
q = \operatorname{clip}\big(\operatorname{round}(x/s) + z,\; q_{\min},\; q_{\max}\big), \qquad
\hat{x} = s(q-z).
$$
Weights, activations, transform matrices, and Winograd-domain intermediates are all quantized group-wise, with int8 operands and int32 accumulators. Activations use dynamic per-group min–max at inference time. To reduce range differences in the Winograd domain, the paper parameterizes the transforms with diagonal scales:
$$
A^{\top} = V_{n\times m}^{\top} S_A, \quad
B^{\top} = S_B V_{n\times n}^{-\top}, \quad
G = S_G V_{n\times r},
$$
subject to
$$
S_A S_B S_G = I.
$$
Only $S_B$ and $S_G$ are learned, while $S_A=(S_B S_G)^{-1}$. The learning is data-free: for random Gaussian or uniform inputs, the method minimizes the discrepancy between full-precision convolution output and fully quantized Winograd output, using one shared set of scales across all Winograd layers [2412.19867].

The integerized pipeline quantizes the input transform, the Hadamard product, and the output transform, while tracking fused scales such as $s_X$, $s_Y$, and $s_y$. Because these scales are fused, the arithmetic path never requires codebook access or table lookup. For $F(6,3)$, the paper notes that the inner-product length is $8$, and the worst-case int8×int8 sum $8 \times 127 \times 127 = 129{,}032$ is well within int32 limits [2412.19867].

The reported results are strikingly dependent on whether learnable scales are used. For Stable Diffusion v1.5 with the AKL autoencoder, FP16 obtains FID $21.72$ and CLIP $31.72$; W8A8 group-wise standard convolution obtains FID $21.80$ and CLIP $31.70$; W8A8 Winograd $F(6,3)$ with standard scales collapses to FID $329.25$ and CLIP $3.56$; W8A8 Winograd $F(6,3)$ with learned scales recovers to FID $20.72$ and CLIP $31.51$; and W8A8 Winograd $F(4,3)$ with learned scales gives FID $22.29$ and CLIP $31.70$. On ImageNet classification with ResNet-18 and ResNet-34 under W8A8, GQ with learned scales outperforms PAW+FSQ by $1.62\%$ and $2.56\%$ in top-1 accuracy for Winograd $F(6,3)$, respectively. Highly optimized integer kernels reduce convolution-layer wall-clock by $31.3\%$ versus standard convolution and produce a $12.8\%$ end-to-end improvement on an InstaFlow-0.9B pipeline on Arm Graviton3, single thread [2412.19867].

The method’s assumptions are explicit. Larger tiles accentuate range imbalance, 8-bit is the demonstrated sweet spot, group size must align with vector width, and applicability is natural for CNN-like blocks rather than transformer MLPs.

## 6. GSQ and ultra-low-bit scalar GQ for LLMs

"GSQ: Highly-Accurate Low-Precision Scalar Quantization for LLMs via Gumbel-Softmax Sampling" places GQ in the regime of 2–3 bit weight-only quantization for LLMs. Its central claim is that a carefully optimized scalar, group-wise, lookup-free format can close most of the accuracy gap between conventional scalar quantization and more complex vector- or trellis-based methods while remaining fully compatible with existing scalar inference kernels [2604.18556].

GSQ partitions weights into groups and assigns each group a single real scale $s_g$, with no per-level codebook and no zero-point. Each weight $w_i$ is mapped to a small symmetric integer grid $G=\{g_k\}$, and runtime dequantization remains the single fused multiply
$$
\hat w_i = s_g \cdot q_i.
$$
Because the grid is fixed and scalar, the format is compatible with llama.cpp- and vLLM-style low-bit GEMM backends.

The novelty lies in how the assignments are optimized. For each weight, GSQ introduces logits $\alpha_{ik}$ over grid levels and uses a Gumbel-Softmax relaxation:
$$
y_{ik} = \mathrm{softmax}\Big(\frac{\kappa \,\alpha_{ik} + u_{ik}}{\tau}\Big), \quad u_{ik} \sim \mathrm{Gumbel}(0,1),
$$
with relaxed dequantization
$$
\hat w_i = s_g \sum_{k=1}^{K} y_{ik} g_k.
$$
As the temperature $\tau$ is annealed and the scale factor $\kappa$ increased, the relaxed assignments harden toward one-hot vectors. For bit-widths above 2, GSQ replaces the global $K$-way relaxation with a five-way local-shift relaxation around an initialized grid index, reducing parameter count from $d \times 2^b$ to approximately $5d$ while still allowing accurate local moves [2604.18556].

The calibration objective is distillation-style reconstruction:
$$
\mathcal{L}(\theta) = \sum_{x \in \mathcal{D}_{\mathrm{cal}}} \big\| f(x;\hat W(\theta)) - f(x;W) \big\|_F^2.
$$
The paper uses group-wise symmetric quantization with group size $128$ by default, warm-starts the logits from a GPTQ solution, anneals $\tau$ linearly from $2$ to $0.05$, increases $\kappa$ from $100$ to $500$, uses Lion rather than AdamW, and performs a final scale-only fine-tuning pass with discrete assignments fixed [2604.18556].

On Llama-3.1-8B/70B-Instruct, the reported zero-shot averages show that GSQ narrows or nearly closes the gap to QTIP at very low precision. In uniform 3-bit quantization, GSQ reaches average $72.32$ on 8B and $77.99$ on 70B, compared with QTIP at $72.81$ and $78.17$. In uniform 2-bit quantization, GSQ reaches $68.55$ on 8B and $75.57$ on 70B, compared with EfficientQAT at $63.79$ and $71.43$, and QTIP at $69.88$ and $77.25$. The paper also reports ternary results and non-uniform 2/3-bit configurations, including GSQ averages of $77.50$ at $2.62$ bpp and $77.40$ at $2.37$ bpp on 70B. On L40s GPUs with vLLM plus Humming, throughput rises from $60.3$ TPS/GPU for BF16 to $289.6$ for uniform 3-bit, $301.1$ for $2.62$ bpp, $329.2$ for $2.37$ bpp, and $374.0$ for uniform 2-bit. The same format scales to trillion-parameter MoE quantization in Kimi-K2.5, where the paper reports mixed gains and losses across reasoning, coding, and long-context benchmarks, underscoring the importance of calibration data composition [2604.18556].

GSQ therefore broadens the meaning of GQ: it shows that lookup-free execution need not imply crude or greedy scalar assignment, provided the training-time discrete optimization is strong enough.

## 7. Comparative interpretation, misconceptions, and limitations

Taken together, these works indicate that GQ is better understood as a design principle than as a single method. The unifying principle is not a common formula, but a common constraint: group-level expressivity must be retained without introducing runtime lookup overheads that negate the systems benefits of quantization. This suggests a cross-domain pattern in which the quantizer becomes more structured offline so that the deployed representation becomes simpler online [2310.04836] [2508.05599] [2412.19867] [2604.18556].

A second clarification concerns the meaning of “lookup-free.” In WeTok, the eliminated operation is nearest-neighbor search over learned prototypes. In DGQ, the eliminated operation is per-group scale lookup or dequantization inside the GEMM inner loop. In Winograd GQ, the eliminated objects are codebooks and LUT indices, while affine quantization metadata remains. In GSQ, the eliminated structure is any per-level table or vector-code decoding step, leaving only integer codes and group scales. The phrase therefore refers to the removal of runtime indirection, but the source of that indirection differs by domain.

The limitations are correspondingly domain-specific. DGQ remains sensitive to projection error, grid-search resolution, activation outliers, and hardware availability of efficient INT8 kernels [2310.04836]. WeTok’s sign quantizer discards amplitude information and relies on grouped entropy approximations and decoder capacity to recover fine detail [2508.05599]. Winograd GQ depends on learned transform scales to tame severe range imbalance, with larger tiles making the problem harder and group size constrained by vector-width considerations [2412.19867]. GSQ remains dependent on calibration quality, can underperform under domain shift or at extreme context lengths, and still trails the strongest vector or trellis methods in some low-bit regimes [2604.18556].

The broader significance of GQ lies in this repeated compromise. Purely coarse-grained quantization is kernel-friendly but often accuracy-limited at low precision; purely fine-grained or prototype-heavy quantization is accurate but can disrupt continuous integer execution or create codebook overheads. GQ methods occupy the middle ground: they preserve much of the statistical benefit of grouping while restoring a runtime path that is compatible with standard kernels, vectorized operators, or implicit-code decoding.

Source: https://www.emergentmind.com/topics/group-wise-lookup-free-quantization-gq