Home Knowledge Base Model Quantization

Model Quantization is the inference optimization technique that reduces the numerical precision of neural network weights and activations from 32-bit or 16-bit floating-point to lower bit-widths (8-bit, 4-bit, or even 2-bit integers) — shrinking model memory footprint by 2-8x, accelerating computation on hardware with integer execution units, and enabling deployment of large models on resource-constrained devices with minimal quality degradation.

Why Quantize

A 70B parameter model in FP16 requires 140 GB of memory — exceeding the capacity of any single consumer GPU. Quantizing to 4-bit reduces this to ~35 GB, fitting on a single 48GB GPU. Beyond memory, integer arithmetic is 2-4x faster than floating-point on most hardware, and reduced memory bandwidth (the primary bottleneck for LLM inference) directly increases tokens-per-second.

Post-Training Quantization (PTQ)

Quantize a pre-trained model without retraining:

Quantization-Aware Training (QAT)

Simulate quantization during training by inserting fake-quantization nodes that round weights/activations during the forward pass but pass gradients through using the straight-through estimator. The model learns to be robust to quantization noise, consistently outperforming PTQ at the same bit-width but requiring a full training run.

Quantization Formats

FormatBitsMemory RatioQuality ImpactUse Case
FP16/BF16161x (baseline)NoneTraining, high-quality inference
INT8 (W8A8)80.5xNegligibleProduction serving
INT4 (W4A16)4 weights, 16 activations0.25x weightsSmall (<1% accuracy)Consumer GPU deployment
GGUF Q4_K_M4-6 mixed~0.3xSmallCPU/edge inference (llama.cpp)
INT2-32-30.12-0.19xModerateResearch/extreme compression

Mixed-Precision and Group Quantization

Rather than quantizing all weights to the same precision, modern methods use group quantization (quantize in blocks of 32-128 weights with per-group scale factors) and mixed precision (keep sensitive layers at higher precision). This provides fine-grained control over the accuracy-compression tradeoff.

Model Quantization is the compression technique that made billion-parameter AI accessible on consumer hardware — proving that neural networks are massively over-precise and that most of their intelligence survives dramatic precision reduction.

model quantization inferenceweight quantization llmint8 int4 quantizationgptq awq quantizationquantization aware training

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.