Large language models (LLMs) are obviously very good at what they do, but they’re expensive to run. A 7B parameter model stored in 16 bit precision alone will need around 14GB of memory for its weights. Many teams simply don’t have that much GPU memory available. Quantisation is the solution to this problem and involves storing the model weights in fewer bits. AutoGPTQ is a well known open source library which applies the GPTQ algorithm to quantise a model after training. This article looks at how it works, what it gives you and where it stands today.
Understanding Post-Training Quantisation
What Quantisation Means
Quantisation takes high precision numbers (e.g. 16 bit floating point values) and turns them into lower precision numbers (e.g. 8 bit or 4 bit integers). Fewer bits per weight means a smaller model file, less memory usage and often faster inference.
Post-Training vs. Quantization-Aware Training
There are two broad approaches. Quantisation aware training builds in the low precision during the training process itself, which can preserve accuracy at the cost of a huge amount of compute. Post-training quantisation (PTQ) is the approach of quantising a model that has already been trained. PTQ requires only a small calibration dataset and a few hours or less on a single GPU so is very practical for most teams.
How GPTQ and AutoGPTQ Work
The GPTQ Algorithm
GPTQ was introduced by Frantar et al in 2022. It quantises the model one layer at a time. For each layer it takes a set of calibration data through the model and records how the layer responds. It then quantises the weights column by column and adjusts the remaining weights to compensate for the error introduced at each step. The adjustment is based on approximate second order information which allows the compressed layer to produce outputs very close to the original.
What AutoGPTQ Adds
AutoGPTQ packages up GPTQ in a fairly accessible Python library. You load a Hugging Face model, you provide calibration samples, you specify your quantisation config and you save out the compressed model. It also comes with optimised GPU kernels (ExLlama and Marlin) to speed up inference with the quantised weights.
Key Settings, Benefits, and Trade-offs
Important Configuration Options
- Bits: the target precision (most commonly 4-bit), with 2, 3 and 8-bit also available.
- Group size: the weights are quantised in groups (often of 128) to strike a balance between accuracy and size.
- Activation order: processes the columns in order of importance which can improve accuracy.
- Calibration data: a few hundred text samples that are representative of the model’s actual workload.
Benefits
A 4-bit GPTQ model uses about 1/4th the weight memory of its 16-bit counterpart. This enables much larger models to run on consumer GPUs and results in lower serving costs. The integer weights are converted back to 16-bit during the computation phase within the fused GPU kernels. As the model is reading less data from memory, generation can also be faster (LLM inference is typically bandwidth limited).
Trade-offs
Quantisation will lead to a small loss in accuracy (particularly at 2 or 3 bits) and the results will be highly dependent on the quality of your calibration data. Newer model architectures may also require new tooling. You MUST test the quantised model on your own data prior to deployment.
AutoGPTQ Today and How to Learn It
Current Status
Autogptq was archived by its maintainers in April 2025 and is no longer supported on Hugging Face Transformers. Gptqmodel (the successor) was originally a fork of AutoGPTQ and is now the actively maintained version. It supports newer models and has much faster quantisation. The underlying concepts are the same so understanding of AutoGPTQ absolutely translates to the current tools.
Building Practical Skills
Learning quantisation absolutely requires a grounding in Python, PyTorch and transformer architecture. The best way to learn is through hands on practice: quantise a small open model, compare the memory usage and output quality and then try it out with an inference server (vLLM for instance). There are a number of pre-quantised GPTQ models available on the Hugging Face Hub which can be very useful for comparison purposes. A good gen ai course will be able to walk you through all of this with guided projects. When you’re looking at the options it’s worth checking whether the course covers model optimisation, deployment and actual GPU lab work.
Conclusion
AutoGPTQ made GPTQ quantisation actually practical for the wider world. It demonstrated that you could quantise LLMs down to 4bit with a fairly small loss in accuracy and without any need for retraining. The project is now archived but the approach has definitely lived on in GPTQModel and the like. For anyone working with LLMs, learning post-training quantisation is a worthwhile step towards being able to deploy models.
