OPTIMIZATION

Full Precision vs Quantized LLMs

Quantization compresses LLM weights to use less memory and run faster — but how much quality do you lose?

Full Precision vs Quantized

The same model, two different representations

FULL PRECISION

Standard Weights

Each weight stored as a full 32-bit floating-point number, preserving maximum precision and accuracy.

Data Type
FP32
Bits per Weight
32
7B Model Size
~28 GB
GPU Memory
~32 GB
QUANTIZED

Compressed Weights

Weights are mapped to fewer bits, dramatically reducing memory usage while maintaining acceptable quality.

Data Type
INT4 / INT8
Bits per Weight
4 – 8
7B Model Size
~4 – 8 GB
GPU Memory
~6 – 10 GB

Weight Representation: Same Model, Different Sizes

FP32 (Full Precision)
32 bits per value
INT8 (8-bit Quantized)
8 bits per value (4× smaller)
INT4 (4-bit Quantized)
4 bits per value (8× smaller)

Model Size by Quantization Level

Based on a 7-billion parameter model

FP32 (Full Precision) 28 GB
100%
FP16 (Half Precision) 14 GB
50%
INT8 (8-bit) 7 GB
25%
INT4 (4-bit) 3.5 GB
12.5%

Quantization Methods

Different approaches to compressing model weights

FP16 / BF16

Half-precision or brain-float 16. Simple reduction from FP32 with minimal quality loss. Widely supported.

Near Lossless

INT8 Quantization

Maps weights to 256 discrete levels. 4× compression from FP32 with minimal quality degradation.

Minimal Loss

INT4 Quantization

Maps weights to 16 discrete levels. 8× compression. Some quality loss but still highly usable.

Moderate Loss

GPTQ / AWQ

Advanced methods that calibrate quantization per-layer using a small dataset. Better quality at same bitwidth.

Smart Loss

Quality vs Compression Trade-off

FP32
FP16
INT8
GPTQ-4
INT4
← Maximum Quality Maximum Compression →

Try It: Watch Precision Disappear

The curve is a slice of a weight tensor. Drag the slider to round it onto fewer and fewer levels, and watch where the error actually shows up.

234568FP16
Original weight values against their quantized reconstruction
original weights after quantization available levels
256Distinct values
0.00RMS error
13.0GB for 7B
1.0xSmaller than FP16

Next in Series

KV Cache

Speed, memory trade-offs, and inference optimization