AI Systems Reference/Deep Cuts (Inference Infra)

Quantization for Inference

INT8, FP8, AWQ, and GPTQ — when compression wins on cost and memory, and when quality regression forces you back to FP16.

4/5Overview: 25m

Why quantize

FP16/BF16 weights are memory-heavy. Quantization reduces bit width → fit larger models on fewer GPUs, higher batch size, lower cost per token.

This is inference compression, not training — aligns with our scope (we're not pretraining transformers).

Formats to name

MethodIdeaTrade-off
INT8 / INT4 (GPTQ, AWQ)Post-training weight quantization2–4× memory savings; possible quality loss on reasoning
AWQProtect salient weights using activation statsBetter quality than naive INT4
FP8Hardware-native on H100/HopperGood speed + quality on supported kernels
BF16 baselineNo quantizationBest quality, highest cost

Rule of thumb: quantize smaller models and high-volume classification/extraction first; be cautious quantizing frontier reasoning models without rigorous eval regression.

Quality validation (non-negotiable)

Before production cutover:

  1. Golden-set eval — same suite as Topic 6 (offline evals)
  2. Slice analysis — legal, code, multilingual subsets often degrade differently
  3. Latency A/B — confirm speedup is real on your context lengths (sometimes dequant overhead eats gains on short prompts)

Link to Topic 6 (Evaluation & Quality) — quantization is a deployment change that needs eval gates like prompt changes.

Vendor vs self-hosted quantization

PathNotes
Hosted APIVendor picks precision; you pick model tier
Self-hostedYou export AWQ/GPTQ artifacts, load in vLLM/TensorRT-LLM
Custom distillationTrain small model to mimic large — different technique, higher effort

Distillation is a Deep Cuts adjacent topic: train a 7B student on teacher outputs. Mention in interviews but it's more ML-research-leaning than AWQ deployment.

Link to Topic 7 (Cost & Capacity)

Quantization is often the first lever after semantic caching when GPU cost dominates unit economics.

Interview answer template

"We'd trial AWQ INT4 on the 13B summarizer — expect ~2× throughput. Gate on offline F1 within 1% of FP16 and a human spot-check on 200 legal docs before routing 10% canary traffic."

Further Reading

Hands-On Tasks (Optional)

Design drills and architecture sketches — gateway SLOs, eval gates, rollout plans. Assumes AI Engineering fundamentals are already in place.

  • Pick a quantization strategy

    A legal-doc summarization feature runs a 13B model; p95 latency is fine but GPU cost is 40% of infra. Compare AWQ vs FP8 vs staying FP16 — which you'd trial first and what eval you'd run before cutover.

    15m