AI ENGVisual Encyclopedia

MODULE 8: ADVANCED CAPABILITIES & DEPLOYMENT · SCENE 23

Post-Training Quantization: GPTQ, AWQ, FP8

r-bit grouped weight error, quality retained, and the VRAM you actually need at bits-per-weight.

BITSGROUPQUALITY RETAINED · 98.9%
BF16 · 140 GB4-BIT · 35 GB (70B MODEL)err ≈ 2^−4 · √(1/128) → 98.9% RETAINED

GPTQ compensates rounding error through the inverse Hessian; AWQ scales salient channels. Quantize the final aligned model, then re-eval.

TECHNICAL BREAKDOWNModule 8: Advanced Capabilities & Deployment

Post-training quantization: GPTQ, AWQ, FP8

Trained weights are too fat to serve. Post-training quantization compresses them after training, using calibration data to choose rounding that preserves the layer's function: GPTQ via iterative second-order error compensation, AWQ via activation-aware scaling, FP8 via calibrated ranges.

GPTQ

Quantize columns one at a time, redistributing each column's rounding error into the not-yet-quantized weights via the inverse Hessian. 4-bit with group size 128 is the sweet spot.

AWQ

Protect the ~1% of salient weight channels (large activations) by per-channel scaling instead of mixed precision — hardware-friendly, no outliers stored separately.

FP8 Calibration

Dynamic ranges need a calibration pass; too few calibration samples inflates KL divergence against the bf16 reference.

MATHEMATICAL FORMULATION · QUANTIZATION ERROR & RETAINED QUALITY
err ≈ 2^(−r) · √(1/group) · 0.5; retained ≈ 1 − 4·err; VRAM = params_B · bits/8

4-bit, group 128: err ≈ 0.0028 → ~98.9% quality retained. A 70B model: 140 GB at bf16 vs 35 GB at 4-bit — the difference between a node and a laptop.

REAL-WORLD PRODUCTION ENGINEERING
  • Quantize the final aligned model, not an earlier checkpoint — alignment is where behavior lives, and PTQ after alignment preserves it.
  • Always eval the quantized model on your task suite: per-layer error compounds non-uniformly, and 4-bit can cost 1–3 points on reasoning-heavy sets.