GPTQ Quantization
GPTQ is a post-training weight quantization method for large language models that compresses weights originally in 16-bit floating point to three or four bits, cutting memory usage by more than half with almost no loss of generation quality. It was proposed by Frantar et al. in a 2022 paper and is one of the most influential quantization schemes in the entire open-source inference ecosystem; almost all mainstream inference frameworks ship a built-in implementation.
Core principles
GPTQ follows the technical route of layer-wise quantization with second-order compensation. It does not train the model; it only uses a small calibration set (typically 128 to 500 real texts sampled from the training distribution) to fit each layer independently. The objective is to make the output of that layer as consistent as possible before and after quantization, rather than making the weights themselves as consistent as possible.
The key is that it uses approximate second-order information. The authors start from the autocorrelation matrix of the layer input, that is, the diagonal and inverse of an approximate Hessian, and process the columns one by one: each time a column is quantized, the resulting error is weighted by the importance of the remaining columns and redistributed onto them. In this way the error does not accumulate beyond repair but is absorbed by later quantization decisions. Because the matrix inverse can be precomputed and reused, the overall computational cost is far lower than earlier optimal quantization methods, and a model with 7 billion parameters can be quantized in a few hours on a single GPU.
The whole process is layer by layer, so memory only needs to hold one layer of weights and the corresponding calibration activations, which is why it can handle models from 6.7 billion to 70 billion parameters. There is no joint optimization between layers, a small concession in accuracy that costs little in practice.
Key points
group_size is usually 128, meaning every 128 weights share one set of scale and zero point; smaller groups are more accurate but cost more metadata, and 32 is usually already close to no quantization. Four bits is the dominant bit width; three bits degrades noticeably, and eight bits brings almost no compression benefit (only half saved relative to fp16, while four bits saves three quarters). The quality of the calibration set matters more than its size: the measured difference between quantizing with generic web text and with domain corpus can be considerable, so specialized domains such as finance and medicine must use real in-domain requests for calibration.
There is also a variant called act-order, which reorders the quantization sequence by activation importance and processes the columns with the largest effect on the output last; it is more accurate but requires gathering weights by the reordered index at inference time, sacrificing some speed. Another practice keeps a few high-precision weights within each group, which further reduces error.
Common misconceptions
First, assuming that GPTQ improves inference speed. It mainly saves memory and bandwidth; in decode scenarios with a batch size of one there is real speedup, but when compute becomes the bottleneck at large batch sizes the gain is limited, and the model may even be slightly slower because of dequantization operations.
Second, assuming that a quantized model can share caches or weight formats directly with the original model. GPTQ weights carry grouped quantization metadata and must be read by a loader that supports the format; they cannot simply be treated as ordinary weights.
Third, assuming that any random text will do as a calibration set. A mismatch between the calibration distribution and the actual usage distribution is the most common reason a quantized model mysteriously gets dumber.
Application scenarios
Single-GPU deployment under memory constraints, local execution on consumer graphics cards, higher replica density for large-scale model serving, offline inference on edge devices, and low-cost baselines in model comparison experiments.