Model quantization reduces the numeric precision of model weights or activations, typically replacing floating-point values with lower-bit representations. It trades some quantization error for lower memory use, potentially faster inference, and deployment on more constrained hardware. section 6.2 section 6.5
The main choices are precision format, quantization scheme, timing, and execution hardware. Post-training quantization (PTQ) modifies a trained model, while quantization-aware training (QAT) accounts for quantization during training; PTQ is especially practical for pretrained models that need only adaptation. section 6.1 section 6.2
Operational tradeoffs shape the deployment choice:
- Use lower bit widths to reduce model memory requirements; 8-bit values can store roughly four times as many numbers as 32-bit floats in the same memory. section 6.2
- Expect a balance among precision, memory footprint, inference speed, hardware support, and output quality rather than a universally best format. section 4.2 section 6.2
- Choose domain-specific methods when ordinary quantization cannot satisfy the target environment; GPTQ supports efficient 3- or 4-bit weight quantization, while CPU and edge runtimes offer their own formats. section 6.4.1 section 11.4.2
- Validate quality and serving behavior after conversion using measures such as perplexity, latency, throughput, and memory consumption. section 4.2 section 6.2.1
Absmax quantization
For an FP32 tensor X, calculate a scale as 127 divided by the tensor’s absolute maximum. Multiply X by that scale and round to obtain INT8 values; divide the rounded values by the scale to dequantize them. Applying this procedure layer by layer creates a dequantized model copy for comparison with the original. A GPT-2 example inspects weight histograms, generates text from both models, and compares perplexity; the quantized weights visibly differ, demonstrating that the method is lossy. section 6.2.1
Quantization fits into broader deployment pipelines. Models can be converted to ONNX, optimized or quantized, and then executed by a compatible runtime; specialized libraries such as AutoGPTQ, BitsAndBytes, and mllm target different model sizes and hardware environments. section 5.1 section 6.4.1 section 8.3












