Quantization maps FP16 weights
W to low-bit integers
xq=round(x/s)+z with scale
s=(xmax−xmin)/(2b−1) and zero-point
z aligned to the b-bit range. PTQ (Post-Training Quantization) calibrates an already-trained model with a small calibration set, no retraining needed; QAT (Quantization-Aware Training) simulates quantization error during training via STE (straight-through estimator: quantized forward, approximate straight-through backward), making the model adapt to quantization.