Home Knowledge Base Post-Training Quantization (PTQ)

Post-Training Quantization (PTQ) is the model compression technique that reduces the numerical precision of neural network weights and activations after training is complete — without requiring retraining or fine-tuning, converting float32/bfloat16 models to int8, int4, or lower precision to reduce memory footprint by 2–8× and increase inference throughput by 1.5–4× on hardware with quantized compute support, at a small accuracy cost that modern algorithms minimize through careful calibration.

Why LLMs Need Specialized PTQ

GPTQ (Frantar et al., 2022)

from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig

quantize_config = BaseQuantizeConfig(
    bits=4,           # int4
    group_size=128,   # quantize in groups of 128 weights
    desc_act=False,   # disable activation order for speed
)
model = AutoGPTQForCausalLM.from_pretrained(model_path, quantize_config)
model.quantize(calibration_data)  # Calibrate on ~128 samples

AWQ (Activation-aware Weight Quantization)

SmoothQuant

Quantization Granularity

GranularityDescriptionAccuracyOverhead
Per-tensorSingle scale for entire tensorLowestMinimal
Per-channelScale per output channelGoodSmall
Per-groupScale per 64/128 weightsBetterModerate
Per-token (act)Scale per activation tokenBestRuntime

Key Metrics and Trade-offs

Calibration Data

Post-training quantization is the practical gateway to deploying state-of-the-art LLMs on accessible hardware — by compressing 70B parameter models from 140GB in FP16 to 35GB in INT4 without costly retraining, PTQ methods like GPTQ and AWQ have made it possible to run frontier-scale models on single workstation GPUs, democratizing LLM inference and enabling the local AI ecosystem that powers privacy-preserving, offline-capable AI applications.

post training quantizationptqgptqawqsmoothquantllm quantizationweight only quantization

Explore 500+ Semiconductor & AI Topics

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