GPTQ and AWQ explained: how 4-bit weight quantisation keeps LLMs accurate
Most open models you run on one GPU use 4-bit weights made by GPTQ or AWQ. This article explains both algorithms from the maths up, runs them on a toy layer, and shows how LLM Compressor applies them today, with what each one costs and when to pick it.
- Reading time
- 16 min
- Sections
- 8
- Code examples
- 3
- Tables
- 1
- Sources
- 6
- Published
- 24 Nov 2026
- What changed
- LLM Compressor 0.15.0 is released
- Why it matters
- For most teams, the question is not which paper is better but which checkpoint to deploy and how to check it.
- What to do
- Start with W4A16 at group size 128
Download a 4-bit build of an open model for vLLM and there is a good chance it was made with GPTQ or AWQ. Both are post-training methods. They take a trained model, look at a few hundred example inputs, and choose 4-bit weights that keep each layer's outputs as close as possible to the original. Neither needs retraining, and both run in minutes to hours on one GPU.
They solve the same problem in opposite ways. GPTQ rounds weights one column at a time and pushes each rounding error onto the weights it has not rounded yet. AWQ leaves the rounding alone and instead rescales the few input channels that matter most, so they lose less precision. Understanding the two ideas helps you choose between them, debug a quantised model that behaves badly, and read the steady stream of quantisation releases. This autumn brought two notable ones: LLM Compressor 0.14.0 shipped a GPTQ kernel its authors call about 15 times faster, and version 0.15.0 followed on 28 October 2026.
What happened
LLM Compressor 0.15.0 is released (28 October 2026)
LLM Compressor, the vLLM project's library for producing quantised checkpoints, published version 0.15.0 on PyPI on 28 October 2026, with nightly pre-releases following into November (the latest listed is dated 7 November 2026). The release itself is small: it picks up a patch release of compressed-tensors, the checkpoint format vLLM reads. The project page lists GPTQ, AWQ, SmoothQuant, AutoRound, rotation methods (SpinQuant and QuIP) and simple round-to-nearest among its algorithms, and W4A16 and W8A16 among its weight-only schemes.
LLM Compressor 0.14.0 speeds up GPTQ (22 September 2026)
The 0.14.0 release notes say "GPTQ now ships a Triton-based quantization kernel, approximately 15× faster end-to-end", and that batching layers of the same shape gives up to 30 times end-to-end speedups on some mixture-of-experts workloads. The same release lets AWQ and SmoothQuant be combined with GPTQ in one recipe, adds AWQ mappings for new model families, and reports at the end of a run any modules that fell back to plain rounding. Earlier in the year, version 0.11.0 (2 June) added multi-GPU AWQ, with reported speedups of 2.9 to 3.2 times on 4 GPUs.
Why 4 bits, and what plain rounding gets wrong
When a model generates text one token at a time, each step has to read every weight from GPU memory. For batch sizes typical of chat serving, that reading, not the arithmetic, sets the speed. Smaller weights mean fewer bytes per token.
The arithmetic is simple. An 8 billion parameter model in 16-bit precision needs 8 × 10⁹ × 2 bytes = 16 GB. At 4 bits per weight with one 16-bit scale for every group of 128 weights, the cost is 4 + 16/128 = 4.125 bits per weight, or about 4.1 GB. If each group also stores a 16-bit zero point, it is 4.25 bits and 4.25 GB. The ratio 16 / 4.125 is about 3.9, which is the upper bound on the memory-bandwidth speedup. The GPTQ paper reported end-to-end speedups over FP16 of around 3.25 times on an A100 and 4.5 times on an A6000.
This scheme is called W4A16: 4-bit weights, 16-bit activations. Weights are stored small and expanded back to 16 bits inside the matrix multiply kernel. It differs from formats such as NVFP4 that also quantise activations, which our article on NVFP4 and MXFP4 covers.
Round-to-nearest, worked by hand
The simplest method, round-to-nearest (RTN), treats each group of weights on its own. With symmetric 4-bit integers, the grid runs from −8 to 7, and the step size is Δ = max|w| / 7.
Take a group of four weights: [0.12, −0.50, 0.33, 0.07]. The largest magnitude is 0.50, so Δ = 0.50 / 7 = 0.0714. Dividing gives [1.68, −7.00, 4.62, 0.98], which rounds to [2, −7, 5, 1]. Multiplying back by Δ gives [0.143, −0.500, 0.357, 0.071]. The rounding errors are [−0.023, 0, −0.027, −0.001].
Each error is small, but RTN makes a hidden assumption: that every weight matters equally. In a real layer, the output is y = W x, and some input channels of x are consistently far larger than others. A small error on a weight that multiplies a large input becomes a large error in the output. Errors on different weights can also add up or cancel, depending on how the inputs are correlated. At 4 bits RTN often works passably; at 3 bits it can collapse. On OPT-175B, the GPTQ paper reports WikiText2 perplexity rising from 8.34 in FP16 to 10.54 with 4-bit RTN, and to about 7,300 with 3-bit RTN.
You can see how bit width trades accuracy for size in our quantisation simulation.
GPTQ: round one column, then fix the rest
GPTQ (Frantar, Ashkboos, Hoefler and Alistarh; arXiv October 2022, ICLR 2023) treats quantisation as a small optimisation problem for each linear layer. Run a few calibration inputs through the model and collect the inputs X that reach the layer. Then choose quantised weights Ŵ that minimise the squared error of the layer's output:
minimise ‖W X − Ŵ X‖²
The curvature of this error is captured by the matrix H = 2 X Xᵀ, which has one row and column per input channel. H is large on the diagonal for channels with big inputs, and its off-diagonal entries record which channels move together.
The update rule
GPTQ builds on an older method, Optimal Brain Quantization. When you quantise one weight w_q to quant(w_q), you introduce an error. The optimal way to compensate is to nudge all the weights you have not quantised yet, F, by
δ_F = −(w_q − quant(w_q)) / [H_F⁻¹]qq · (H_F⁻¹){:,q}
In words: take the rounding error, divide it by how sensitive that weight is, and spread the correction to the other weights in proportion to how their inputs correlate with this one. If two input channels carry similar signals, rounding one weight up can be offset by moving its partner down.
An everyday analogy: you are splitting a restaurant bill and rounding each person's share to whole euros. If you round the first share up by 40 cents, you knock 40 cents off the people who have not paid yet, so the total still comes out right.
Three tricks that make it fast
The original method quantised weights in a greedy order and was far too slow for billion-parameter models. GPTQ made three changes, described in the paper:
- A fixed order. Quantising columns left to right, instead of choosing the best next weight each time, is usually only slightly worse on large layers. Because every row now shares the same order, they can all be processed together.
- Lazy batch updates. Instead of updating the whole matrix after every column, GPTQ processes blocks of 128 columns and applies the accumulated updates once per block. This turns many slow memory-bound updates into a few fast matrix multiplies.
- Cholesky reformulation. Repeatedly updating H⁻¹ is numerically fragile at scale. GPTQ precomputes the needed rows with a Cholesky decomposition and adds a small dampening term to the diagonal of H. The paper says it always uses 1% of the average diagonal value.
The paper calibrated on 128 random segments of 2,048 tokens from the C4 web dataset and reported quantising OPT-175B in 4.2 hours on one A100 80GB GPU. On that model, 4-bit GPTQ gave WikiText2 perplexity 8.37 against 8.34 for FP16, and 3-bit GPTQ gave 8.68.
GPTQ in a few lines
The core loop fits in a short NumPy function. It quantises with a group size of 128, computing each group's scale from the already-updated weights when the group starts.
import numpy as np
def quant(x, D):
return np.clip(np.round(x / D), -8, 7) * D
def gptq(W, X, g=128, damp=0.01):
W = W.copy(); n = W.shape[1]
H = 2 * X @ X.T
H += damp * np.mean(np.diag(H)) * np.eye(n) # dampening
U = np.linalg.cholesky(np.linalg.inv(H)).T # upper Cholesky of H^-1
Q = np.zeros_like(W)
for j in range(n):
if j % g == 0:
D = np.abs(W[:, j:j+g]).max(1) / 7 # group scale
Q[:, j] = quant(W[:, j], D)
err = (W[:, j] - Q[:, j]) / U[j, j]
W[:, j+1:] -= np.outer(err, U[j, j+1:]) # push error forward
return Q
We tested it on a toy layer with 512 inputs and 256 outputs, using 2,048 correlated calibration inputs in which 5 channels were 10 times larger than the rest. Measured as the relative error of the layer's output, RTN gave 11.5% and GPTQ gave 7.6%. The weights differ from RTN's only in which way some of them were rounded, yet the output error fell by about a third. A toy is not a model, but it shows the mechanism.
AWQ: protect the channels that carry the signal
AWQ, or Activation-aware Weight Quantization (Ji Lin, Song Han and co-authors; arXiv June 2023), starts from an observation. The paper states that "protecting only 1% salient weights can greatly reduce quantization error", and that to find those weights "we should refer to the activation distribution, not weights."
The paper's Table 1 makes the case with 3-bit quantisation and group size 128. On OPT-6.7B, FP16 perplexity is 10.86 and RTN gives 23.54. Keeping 1% of channels in FP16, chosen by activation magnitude, brings it back to 11.39. Choosing the same number of channels by weight magnitude gives 22.37, and choosing them at random gives 24.23. The important channels are the ones that receive large inputs, not the ones with large weights.
Scaling instead of mixed precision
Keeping some weights in FP16 and the rest in 4 bits is awkward for hardware. AWQ gets most of the benefit with a trick that keeps every weight in 4 bits. For an input channel with scale factor s, multiply the weight by s and divide the input by s:
y = W x = (W · diag(s)) (diag(s)⁻¹ x)
The output is mathematically unchanged, and the division can be folded into the previous layer. What changes is the rounding. The quantisation error on a scaled weight is roughly Δ′ · RoundErr · x / s. If scaling one channel barely changes the group's step size, so Δ′ ≈ Δ, the error on that channel shrinks by a factor of s. The paper measured this directly on OPT-6.7B: scaling salient channels by s = 2 improved perplexity from 23.54 to 11.92, with an average ratio Δ′/Δ of 1.038. Pushing to s = 4 was worse, at 12.36, because larger scales inflate the step size for the other weights in the group.
Searching for the scales
Rather than hand-picking channels, AWQ sets every channel's scale from its average activation magnitude s_X, raised to a power:
s = s_X^α, with α chosen to minimise ‖Q(W · diag(s)) (diag(s)⁻¹ X) − W X‖
α is searched over a grid of 20 points between 0 and 1. With α = 0, nothing is scaled. With α = 1, scales follow activations fully. There is no backpropagation and no reconstruction, only forward passes on calibration data, so AWQ needs little data. The paper reports good perplexity with about 16 calibration sequences of 2,048 tokens, against 192 for GPTQ. AWQ won the MLSys 2024 best paper award.
On our toy layer, the same 20-point search picked α ≈ 0.26 and reduced the output error from 11.5% for RTN to 9.7%. GPTQ did better on this toy because its inputs were strongly correlated, which is exactly what GPTQ's error feedback exploits.
GPTQ and AWQ side by side
| Property | GPTQ | AWQ |
|---|---|---|
| Core idea | Round column by column, push each error onto unrounded weights | Rescale channels with large activations before rounding |
| Uses second-order information | Yes, H = 2XXᵀ per layer | No, only per-channel activation magnitudes |
| Changes which way weights round | Yes | Only indirectly, through scaling |
| Calibration data in the paper | 128 segments of 2,048 tokens from C4 | Small set from the Pile; about 16 sequences sufficed |
| Sensitivity to calibration data | Higher, since it fits layer outputs, per the AWQ paper | Lower, as the AWQ paper argues |
| Typical output format | W4A16, group size 128 | W4A16, group size 128 |
| Can be combined | Yes: LLM Compressor 0.14.0 allows AWQ or SmoothQuant together with GPTQ | Yes |
The two are complementary. AWQ reshapes the weight distribution so the important channels quantise well, and GPTQ then chooses the rounding that best preserves each layer's outputs.
Continue learning
How this article connects
7 pages link to or from it. Drag to turn, click a dot to open it.
What it means in practice
For most teams, the question is not which paper is better but which checkpoint to deploy and how to check it. Here is a typical W4A16 GPTQ recipe in LLM Compressor, adapted from the project's own Llama 3 example:
from transformers import AutoModelForCausalLM, AutoTokenizer
from llmcompressor import oneshot
from llmcompressor.modifiers.gptq import GPTQModifier
model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
recipe = GPTQModifier(targets="Linear", scheme="W4A16", ignore=["lm_head"])
oneshot(model=model, dataset="perfectblend", splits="train[:512]",
recipe=recipe, max_seq_length=2048, num_calibration_samples=512)
model.save_pretrained("Meta-Llama-3-8B-Instruct-W4A16-G128", save_compressed=True)
Three details in that recipe matter. The output head (lm_head) is left in full precision, because it is small relative to the model and sensitive. The scheme uses group size 128, which balances accuracy against the 0.125 bits of scale overhead per weight. And the calibration set is general chat data: if your workload is code, legal text or another language, calibrating on similar data is a cheap way to protect accuracy where you need it.
The saved checkpoint uses the compressed-tensors format, which vLLM loads directly. For local inference with llama.cpp, the GGUF formats use their own quantisation schemes, covered in our llama.cpp article. For fine-tuning on top of a 4-bit base, see QLoRA.
What to do now
- Start with W4A16 at group size 128. It is a widely supported weight-only scheme and the setting the AWQ paper uses throughout.
- Keep sensitive layers in higher precision. Leave
lm_headunquantised, and for mixture-of-experts models check the guidance on router gates, which recipes often exclude. - Calibrate on data like your traffic. Swap the default dataset for a few hundred samples of your own prompts. AWQ needs fewer samples than GPTQ, according to its paper.
- Try AWQ, GPTQ and both together. LLM Compressor 0.14.0 and later let you stack AWQ with GPTQ. Compare all three on your evaluation set rather than trusting a single benchmark.
- Evaluate on tasks, not only perplexity. Perplexity can hide failures in long reasoning, tool calls or structured outputs. Run your real evaluations before and after quantising.
- Read the fallback summary. Since 0.14.0, LLM Compressor reports modules that fell back to plain rounding. A long list means part of the model did not get the method you asked for.
- Measure speed at your batch size. Weight-only quantisation helps most when decoding is memory-bound. At large batch sizes, compute dominates and the gain shrinks.
- Pin library versions. Quantisation libraries change quickly; 0.14.0 alone removed several deprecated options. Record the exact versions used to make each checkpoint.
Risks and open questions
Calibration data can bias the result. GPTQ fits each layer's outputs on the calibration inputs. If those inputs differ sharply from production traffic, accuracy can drop exactly where you need it, and a generic benchmark will not show it.
Averages hide outliers. A quantised model can match the original on average perplexity yet fail on rare but important inputs, such as long numbers, other languages or exact formatting. Test those cases explicitly.
Reported speedups depend on kernels. The memory savings are guaranteed by arithmetic; the speed is not. It depends on whether your serving engine has a fast mixed-precision kernel for your GPU and batch size.
Lower bit widths are less forgiving. Both papers show that 3-bit and 2-bit quantisation need much more care than 4-bit. Newer methods, such as rotation-based approaches and AutoRound, target that regime, and their results should be checked model by model.
Watch next: how well GPTQ and AWQ hold up against hardware-native 4-bit floating point formats on Blackwell GPUs, whether combined AWQ-plus-GPTQ recipes become the default in LLM Compressor, and how expert pruning and quantisation interact for large mixture-of-experts models.
Frequently asked questions
What is the difference between GPTQ and AWQ?
GPTQ quantises weights one column at a time and uses second-order information from the calibration inputs to push each rounding error onto weights not yet quantised. AWQ does not change the rounding procedure. It rescales input channels with large activations so that their weights lose less precision when rounded, then folds the inverse scale into the previous layer.
Does 4-bit quantisation make the model faster?
Usually, for single-user or small-batch decoding, because that is limited by reading weights from memory and 4-bit weights are about a quarter the size. The GPTQ paper reported about 3.25 times on an A100 and 4.5 times on an A6000. At large batch sizes the arithmetic dominates, so the gain is smaller.
What does W4A16 with group size 128 mean?
Weights are stored as 4-bit integers, activations stay in 16-bit precision, and every group of 128 consecutive weights shares one scale factor. The scale costs 16 bits per group, adding 0.125 bits per weight, so storage is about 4.125 bits per weight, or 4.25 with a zero point.
How much calibration data do I need?
The GPTQ paper used 128 segments of 2,048 tokens. The AWQ paper reports good results with about 16 such sequences. LLM Compressor's Llama 3 example uses 512 samples. More data that matches your use case is generally safer than more generic data.
Can I fine-tune a GPTQ or AWQ model?
You can train adapters such as LoRA on top of a quantised base while keeping the 4-bit weights frozen, which is the idea behind QLoRA. Full fine-tuning of the 4-bit weights themselves is not what these methods are designed for. If you need full fine-tuning, train in higher precision and quantise again afterwards.
Summary
GPTQ and AWQ both turn a trained model into 4-bit weights using only a little calibration data, but they work in opposite directions. GPTQ minimises each layer's output error directly: it rounds columns in a fixed order and uses the inverse of H = 2XXᵀ to push every rounding error onto the remaining weights, with lazy batches and a Cholesky step to make it fast and stable. AWQ notices that about 1% of weights, those fed by large activations, matter most, and protects them by scaling their channels with s = s_X^α before rounding. The result in both cases is a W4A16 checkpoint of about 4.1 bits per weight that cuts memory by nearly four times. LLM Compressor, now at 0.15.0, implements both and lets you combine them. More background is on our GPTQ, AWQ, vLLM and serving and cost pages.
Sources
- Paper arXiv: GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers
- Paper arXiv: AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration
- Code PyPI: llmcompressor
- Code GitHub: LLM Compressor release 0.14.0
- Code GitHub: LLM Compressor releases
- Code GitHub: LLM Compressor W4A16 Llama 3 example
Cite this article
Kelahmet, Ö. C. (2026, November 24). GPTQ and AWQ explained: how 4-bit weight quantisation keeps LLMs accurate. Özer Cem KELAHMET. https://www.ozercemkelahmet.com/articles/gptq-awq-4-bit-weight-quantisation
BibTeX
@online{kelahmet2026gptq,
author = {Kelahmet, {\"O}zer Cem},
title = {{GPTQ and AWQ explained: how 4-bit weight quantisation keeps LLMs accurate}},
year = {2026},
month = {nov},
url = {https://www.ozercemkelahmet.com/articles/gptq-awq-4-bit-weight-quantisation}
}Version historyfirst version
- Published
Factual corrections are listed here with what changed. Wording and formatting edits are not listed.