Two Terms to Settle First
QAT stands for quantization-aware training: you train the model with the low-precision constraint applied from the start, so it learns to cope with it.
PTQ stands for post-training quantization: you take an already trained, frozen model and compress it after the fact. That is what GPTQ, AWQ and GGUF do.
These two abbreviations are the two halves of the quantization module. This whole page is about why the second one exists despite its cost.
The Fundamental Problem with Post-Training Quantization
With PTQ the process is straightforward: you take an already trained model, compress its weights to reduced precision (typically 4 bits, i.e. half a byte per parameter), and hope quality holds up. These methods are clever (GPTQ compensates errors via the Hessian, AWQ protects important channels) but they share one limitation: the model was never trained to work with quantized weights. It discovers quantization after the fact, like a musician who finds out on concert day that their piano only has half its keys left.
QAT reverses the logic: instead of quantizing after training, you simulate quantization during training so the model learns to function at reduced precision. The musician rehearses with the damaged piano and learns to play despite the missing keys.
A reminder of the basic arithmetic, worked out in quantization concepts. For a 7 billion parameter model:
- 16 bits (2 bytes): 7 × 2 = 14 GB
- 4 bits (0.5 bytes): 7 × 0.5 = 3.5 GB
- 2 bits (0.25 bytes): 7 × 0.25 = 1.75 GB
It is that last line that motivates QAT. Around 4 bits, PTQ does the job perfectly well and QAT only adds a bit. Below that, PTQ falls apart and QAT becomes the only route. One caveat: these numbers are theoretical floors, the quantization scales and the layers kept in high precision mean the real file always comes out somewhat larger.
PTQ vs QAT: Two Philosophies
| PTQ (Post-Training Quantization) | QAT (Quantization-Aware Training) | |
|---|---|---|
| When | After training | During training |
| Principle | Compress a frozen model | Train the model to tolerate compression |
| 4-bit quality | Good, slight degradation | Better still |
| 2-bit quality | Mediocre to unusable | Still usable |
| GPU cost | Low (a few hours of calibration) | High (full training or fine-tuning) |
| Speed | Fast (minutes to hours) | Slow (hours to days) |
| Data required | 128 to 256 calibration excerpts | A real training dataset |
| Use case | Fast deployment, prototyping | Demanding production, embedded devices |
| Examples | GPTQ, AWQ, NF4, GGUF | BitNet b1.58, the QAT releases of Gemma 3 and Llama 3.2 |
PTQ = quantize a finished model. It's fast and practical, but the model endures quantization. QAT = train a model that knows it will be quantized. It's slower, but the model actively adapts.

How QAT Works
Fake Quantization Nodes
The core of QAT relies on a mechanism called fake quantization, i.e. simulated quantization. During the forward pass (the trip the computation makes from input to output) you insert operations that reproduce the effect of quantization on weights and activations:
- Quantize: convert the FP32/FP16 weight to INT4 (round to the 16 available discrete levels)
- Dequantize: immediately convert back to FP32/FP16
Where is the quantization step (the gap between two discrete levels). The result is still a floating-point number, but it can only take a limited number of distinct values, exactly like a real quantized weight.
The model thus "sees" the rounding errors during training. Its gradients account for this quantization noise, and the weights adjust to compensate. It's like training to aim with a rifle whose sight is slightly off: after a while, you internalize the offset and still hit the target.
It is called "fake" because the computations stay in floating point throughout training. You reproduce the effects of quantization (the rounding errors) without actually switching to integer arithmetic. Two reasons for that: you need to be able to move weights by tiny amounts, which integers do not allow; and integer arithmetic would buy no speed here anyway, since the point of training is learning, not throughput. Real quantization only happens when the model is exported.

The Straight-Through Estimator (STE)
Here is the central obstacle in QAT, and it is worth laying out slowly, because it is the real technical point of the page.
How a model learns. At each training step you measure the error made, then ask, for every weight: "if I nudged this weight up slightly, would the error rise or fall, and by how much?" That answer is the weight's gradient. The weight is then moved in whichever direction lowers the error. The machinery that computes all those gradients in one sweep, from the output back to the input, is backpropagation.
Why rounding breaks that machinery. The question "how much does the error move if I move the weight a little?" has no useful answer when there is a rounding step on the path. Rounding is a staircase function: nudge the weight by a hair and it stays on the same step, so the output does not change at all, the answer is zero. Nudge it just far enough to cross the step and the output jumps, the answer is infinite. Neither is usable information. In mathematical language: rounding is not differentiable, its derivative is zero almost everywhere. No gradient, no backpropagation. No backpropagation, no learning.
The fix, and it is cheeky. The Straight-Through Estimator (STE, proposed by Bengio and co-authors in 2013) consists of lying about that derivative. During backpropagation, you declare that rounding behaves as if it were not there: the gradient passes straight through, unchanged.
Reading the formula: is the real high-precision weight, is the same weight after rounding, and the fraction reads "how much moves when moves". The true answer is 0 or infinity; you replace it with 1, i.e. with the answer you would get if there were no rounding at all.
The asymmetry is the heart of it:
- On the way forward: the weights are rounded, so the model suffers the rounding error and sees it in its final error.
- On the way back: the gradients ignore the rounding, so the weights can move by tiny amounts, even smaller than one step of the staircase.
That is what makes training possible: the model is punished for the consequences of rounding, yet keeps the fine freedom of movement it needs to respond. The weights end up drifting towards values that land near the available levels, values that, unlike the originals, survive quantization well.
It's a rough approximation in theory. It works remarkably well in practice, and nobody has a better explanation than that.

The STE is a rule of thumb, not an exact solution. At very low precisions (1-2 bits) the gap between the true behaviour and the lie grows too large, and training can become unstable. More elaborate variants exist, such as LSQ (Learned Step Size Quantization), which treats the quantization step as a parameter to be learned too, with its own gradient.
The Complete Pipeline
Here are the typical steps of QAT training:
- Start from a pre-trained model in full precision (FP16/FP32)
- Insert fake quantization nodes after each linear layer (and optionally on activations)
- Fine-tune the model on a dataset, with a learning rate markedly lower than in pre-training, the weights gradually adapt to the rounding noise
- Export the model by replacing the simulated nodes with real 4-bit operations, this is the final deployable model
Why QAT Outperforms PTQ
At 4 Bits: A Bonus, Not a Revolution
At 4 bits, PTQ already produces very good results. A measured order of magnitude, with its protocol: on LLaMA-7B, perplexity on WikiText-2, weights in 4 bits with groups of 128, AWQ goes from 5.68 (full precision) to 5.78, i.e. +1.8%, the full figures are on the AWQ page. QAT narrows that gap further, because the weights have converged to values that land close to the available levels instead of enduring the rounding. But at 4 bits the stakes remain modest.
At 2 Bits: The Gulf
It's at very low precision that the gap becomes decisive. At 2 bits, each weight can only take four distinct values. PTQ at this precision produces practically unusable models: perplexity explodes, responses become incoherent. QAT, by contrast, keeps quality usable, because the model spent thousands of steps learning under the constraint. The limiting case is extreme quantization, where weights only take the values -1, 0 or +1: there, QAT is not an advantage, it is the only possible route.
QAT at Industrial Scale: What Is Public
Two publicly documented examples, which give a sense of what the process buys:
- Gemma 3 QAT (Google, 2025): versions of Gemma 3 quantized to 4 bits through QAT, published alongside the full-precision ones. The official model card describes a model that preserves quality similar to half precision while using three times less memory. Note "three times", not four: that is exactly the gap between the theoretical factor and the real file, once you count the tensors kept in high precision and the quantization scales.
- Llama 3.2 lightweight quantized models (Meta, 2024): for its small models Meta published two quantized variants, one obtained through QAT combined with low-rank adaptors, the other through a post-training method called SpinQuant, the first prioritizing accuracy, the second portability. That is this page's tradeoff, made explicit in a model catalogue.
Beyond those, most providers do not publish the details of their quantization procedures, and you should not assume that an "official 4-bit" model came out of a QAT run.
QAT is expensive in GPU time, but for a model provider the arithmetic is simple: you pay the training cost once, then serve millions of requests with a model that is smaller, faster and better than its PTQ counterpart. The longer the model is served, the better that trade looks.
The Drawbacks of QAT
1. High GPU Cost
QAT requires fine-tuning, or full training, which demands powerful GPUs. For a 70 billion parameter model, even fine-tuning under a quantization constraint ties up several A100 or H100 cards for hours or days. By comparison, the GPTQ paper reports about four GPU hours to quantize a 175 billion parameter model on a single card.
2. Training Data Required
Where PTQ only needs 128 to 256 calibration excerpts, QAT requires a real training dataset, large enough for the fine-tuning to mean something. That means having the data, preparing it, and running a full training pipeline.
3. Technical Complexity
Setting up a QAT pipeline requires more expertise than a post-training quantization. You need to choose the learning rate, the number of passes over the data, which layers to quantize, how to ramp the constraint up, and to watch training stability. A PTQ, by comparison, is often a single command.
When to Use What?
Choose PTQ (GPTQ, AWQ, NF4) when:
- You want to quickly deploy an existing model
- Standard 4-bit quantization is sufficient for your use case
- You don't have the GPU resources for fine-tuning
- You're exploring different models and want to compare quickly
Choose QAT when:
- You need the best possible quality at low precision
- You're targeting very low precisions (2-3 bits) where PTQ fails
- The model will be deployed at scale (the training cost is amortized by inference savings)
- You're deploying on embedded devices with strict memory constraints
In practice QAT belongs to model providers, who can afford to train once and serve at scale. Users stick to PTQ to adapt existing models. The simple rule: if an official QAT version exists for your need, take it, somebody has already paid the training cost whose benefit you get to collect.
1. What is the fundamental difference between QAT and a post-training method like GPTQ or AWQ?
2. During QAT training, in what precision are the computations actually carried out?
3. Rounding is a staircase function whose derivative is zero almost everywhere, enough to block backpropagation entirely. How does QAT get around the obstacle?
4. Does the STE's lie work at every precision?
5. You want to deploy an open-source model at 4 bits for an internal project. What does the page suggest?