What Is Quantization in LLMs? 8-bit, 4-bit, FP8 and MXFP4
By LatestLLM Editorial · Published · Facts verified · 8 min read
Also called: quantisation, 4-bit, 8-bit, INT8, FP8, MXFP4, GPTQ, AWQ, model compression
Before this: Dimension
In one line
Quantization stores a model's numbers in fewer bits, for example 4 instead of 16, so it needs a fraction of the memory and often runs faster, at some cost in precision.
Quantization, simply and technically
In plain English
A model is a very long list of numbers, and each number is normally stored with a lot of precision. Quantization rounds each number to a coarser one, like rounding 3.14159 to 3.1. The list takes far less memory, so a model that needed several expensive graphics cards can fit on one, or a small model can run on a laptop or phone.
The rounding adds a little error. Careful methods keep that error small enough that answers hardly change, which is why most downloadable models come in 4-bit and 8-bit versions. Push the rounding too far and quality drops.
Think of it like this: Quantization is like saving a photo at a lower quality setting. The file shrinks dramatically, and at moderate settings you cannot tell the difference. Compress it too hard and blocky artefacts appear. A model behaves similarly, with one extra wrinkle: a few numbers in a model matter much more than the rest, so good methods protect those and squeeze the others harder.
Everyday example: Rounding to a few levels
A list of numbers between −1 and 1 is stored using only 15 possible values instead of thousands.
Input:
0.1302, −0.0158, −0.0367
Output:
Stored as small whole numbers plus one shared scale
What it shows: Each number snaps to the nearest of the 15 levels. 0.130 might become 0.143 and −0.016 might become 0.000. The list is now about a quarter the size, and the small rounding errors mostly cancel out when thousands of numbers are added together in the model's calculations.
Technically
Weight quantization maps each real weight w to a b-bit integer q = round(w / s) with a scale s, and dequantises as q · s. With symmetric absmax scaling, s = max|w| / (2^(b−1) − 1), so 4-bit uses integers from −7 to 7. One scale per tensor is crude because outliers stretch the range; practical schemes use a scale per group or block of 32 to 128 weights. LLM.int8() (Dettmers et al. 2022) cuts memory in half with 8-bit matrix multiplication by handling a few outlier features separately; GPTQ and AWQ push to 4 bits after training, AWQ by protecting about 1% of salient weights, and QLoRA fine-tunes through a frozen 4-bit model so that a 65B model fits on one 48 GB GPU.
Floating-point formats with block scales are now native to hardware. MXFP4 stores 4-bit floating-point values with one 8-bit scale per block of 32, 4 + 8/32 = 4.25 bits per weight; gpt-oss stores its expert weights this way, giving a 60.8 GiB checkpoint for 116.83B parameters. DeepSeek-V3 stores FP8 (E4M3) weights with 128×128 block scales, 641.3 GiB for 671B parameters. Memory is the main saving, because decoding is bound by reading weights: fewer bytes per weight means more tokens per second.
Technical example: Round-to-nearest on real numbers, and a size check
The first 8 of 384 numbers a real embedding model produced are quantised with one absmax scale at 8 and 4 bits. Model sizes follow from parameters × bits, and gpt-oss-120b's published checkpoint is checked against its MXFP4 layout.
Code (python):
x = [0.1302, -0.0158, -0.0367, 0.058, -0.0598, 0.0331, 0.0301, 0.0289]
def quantize(v, bits):
qmax = 2 ** (bits - 1) - 1
scale = max(abs(a) for a in v) / qmax
q = [round(a / scale) for a in v]
return q, [i * scale for i in q], scale
for bits in (8, 4):
q, deq, scale = quantize(x, bits)
err = max(abs(a - b) for a, b in zip(x, deq))
print(f"{bits}-bit: scale {scale:.5f}, integers {q}, largest error {err:.5f}")
for name, params in {"gpt-oss-120b": 116.83, "Gemma 4 31B": 30.7}.items():
print(name, {bits: round(params * bits / 8, 1) for bits in (16, 8, 4)}, "GB at 16/8/4 bits")
moe, other = 114.71, 116.83 - 114.71 # expert and non-expert parameters, billions
gb = moe * (4 + 8 / 32) / 8 + other * 2 # experts in MXFP4, the rest in bfloat16
print(f"gpt-oss-120b estimate {gb:.1f} GB = {gb * 1e9 / 2 ** 30:.1f} GiB (published 60.8 GiB)")
Output:
8-bit: scale 0.00103, integers [127, -15, -36, 57, -58, 32, 29, 28], largest error 0.00044
4-bit: scale 0.01860, integers [7, -1, -2, 3, -3, 2, 2, 2], largest error 0.00830
gpt-oss-120b {16: 233.7, 8: 116.8, 4: 58.4} GB at 16/8/4 bits
Gemma 4 31B {16: 61.4, 8: 30.7, 4: 15.3} GB at 16/8/4 bits
gpt-oss-120b estimate 65.2 GB = 60.7 GiB (published 60.8 GiB)
What it shows: Eight bits keep every number within about 0.0005; four bits are about 18 times coarser, with errors up to about 0.0083, still small next to the numbers' own size. The size arithmetic reproduces gpt-oss-120b's published checkpoint (60.7 against 60.8 GiB), so the layout described is the right one.
Why fewer bits
In plain English: Memory is the bottleneck for running big models. The weights have to sit in a graphics card's fast memory, and the card has a fixed amount of it. Storing each weight in a quarter of the space lets four times as large a model fit.
Technically:
A parameter stored in bfloat16 takes 2 bytes, so gpt-oss-120b's 116.83B parameters would need about 234 GB, far more than one 80 GB GPU. At 4 bits it is under 60 GB. Because token generation is limited by reading all active weights from memory for every token, shrinking the bytes also raises tokens per second.
Training usually happens at higher precision, bfloat16 or FP8 for the forward pass, and quantization is applied afterwards (post-training quantization) or built in (quantization-aware training).
How rounding works
In plain English: Quantization picks a small set of allowed values and snaps each number to the nearest one. A shared scale decides how far apart the allowed values are. More bits means more allowed values and finer snapping.
Technically:
With b bits there are 2^b codes. Symmetric absmax quantization uses the largest absolute value in a group to set the scale, so the extreme weight is exact and the others are within half a step. One outlier large weight forces a large step for the whole group, which is why groups are small: 32 weights in MXFP4, 128 in many 4-bit integer schemes.
Choosing the rounding more cleverly improves accuracy. GPTQ adjusts remaining weights to compensate for each rounding error using second-order information; AWQ observes that not all weights matter equally and that protecting about 1% salient weights greatly reduces error; QLoRA adds a 4-bit NormalFloat data type designed for normally distributed weights.
What is post-training quantization?
Quantizing a finished model without retraining it, often with a small sample of data to calibrate the scales.
Formats in real models
In plain English: Modern open models are released already compressed. The format is a design decision made together with the hardware it is meant to run on.
Technically:
gpt-oss keeps its attention and embedding weights in higher precision and stores the mixture-of-experts weights, which are about 98% of the parameters, in MXFP4, a Microscaling format that pairs narrow floating-point elements with a per-block scale (Rouhani et al. 2023). That is how a 116.83B-parameter model fits a single 80 GB GPU and the 20B model runs in 16 GB.
DeepSeek-V3 was trained with FP8 and ships its weights as FP8 (E4M3) with 128×128 block scales, 641.3 GiB in total. FP8 halves the footprint of bfloat16 without needing a separate quantization step, but still needs several GPUs.
Everyday example: A model that fits
A card has 80 GB of memory and the model has 116.83 billion weights.
What it shows: At 16 bits each weight takes 2 bytes, 234 GB, which does not fit. At about 4.25 bits it takes roughly 60 GB, which does.
What it costs
In plain English: Squeezing too hard makes the model slightly worse: answers get less accurate, especially on hard reasoning, long contexts and rare facts. Most of the time 8-bit is invisible, 4-bit is hard to notice, and below 4 bits quality drops quickly without special methods.
Technically:
The error from rounding is roughly uniform within half a step, so the relative error doubles for every bit removed. Larger models usually tolerate quantization better than small ones, and weights tolerate it better than activations, which have outliers; LLM.int8() was built around the emergent outlier features in large transformers.
Quantization can also apply to the KV cache and to activations. Speed gains depend on kernels: some formats need hardware support to deliver more tokens per second, and a format without native support may save memory but not time.
Common misconceptions
Myth: A quantized model is a smaller, different model.
Reality: It is the same model with its numbers stored more coarsely. It has the same number of parameters and nearly the same behaviour.
Myth: 4-bit models are always much worse than 16-bit ones.
Reality: With block scales and careful methods the quality loss is often small for well-trained models, though it grows for harder tasks and smaller models.
Myth: Quantization and distillation do the same job.
Reality: Quantization rounds an existing model's numbers. Distillation trains a different, smaller model to imitate a larger one.
Where you'll see this
- gpt-oss architecture: gpt-oss stores expert weights in MXFP4, 4.25 bits per weight, so the 120B model fits one 80 GB GPU.
- DeepSeek-V3 architecture: DeepSeek-V3 ships FP8 (E4M3) weights with 128×128 block scales.
Key takeaways
- Quantization stores numbers in fewer bits, cutting memory in proportion: 16-bit to 4-bit is a four-fold saving.
- Per-block scales matter: one scale per 32 to 128 weights keeps outliers from ruining the precision of their neighbours.
- gpt-oss-120b (116.83B parameters) ships at 60.8 GiB by storing expert weights in 4.25-bit MXFP4; DeepSeek-V3's FP8 weights take 641.3 GiB.
- Quantization mainly speeds decoding by reducing bytes read per token, and it costs some accuracy that grows as bits shrink.
Frequently asked questions
What is quantization in LLMs?
Storing a model's weights, and sometimes its activations or cache, in fewer bits so it needs less memory and often runs faster.
How much memory does a 4-bit model save?
A quarter of 16-bit: about 0.5 bytes per parameter instead of 2, plus a small overhead for scales.
What is MXFP4?
A 4-bit floating-point format with one shared 8-bit scale per block of 32 values, 4.25 bits per weight in all, used by gpt-oss for its experts.
Does quantization reduce quality?
Slightly. 8-bit is usually indistinguishable, and 4-bit costs a little accuracy, with larger drops below 4 bits.
What is the difference between GPTQ and AWQ?
Both quantize after training. GPTQ compensates each rounding error using second-order information; AWQ protects the roughly 1% of weights that matter most.
Sources
Facts last verified November 23, 2026.
- Dettmers et al.: LLM.int8(), 8-bit Matrix Multiplication for Transformers at Scale (arXiv)
- Frantar et al.: GPTQ, Accurate Post-Training Quantization for Generative Pre-trained Transformers (arXiv)
- Lin et al.: AWQ, Activation-aware Weight Quantization (arXiv)
- Dettmers et al.: QLoRA, Efficient Finetuning of Quantized LLMs (arXiv)
- Rouhani et al.: Microscaling Data Formats for Deep Learning (arXiv)