Quantization

Quantization stores and computes a neural network in fewer bits — mapping high-precision FP32 weights and activations onto a small set of low-precision levels (INT8, INT4, FP8) so the model takes less memory and runs faster.

It is a mapping from a continuous range onto a discrete grid. A quantizer picks a scale s and a zero-point z, then represents each real value x as the integer q = round(x / s) + z and recovers an approximation x' = s(q - z). INT8 gives 256 levels, INT4 only 16. The art is choosing s — and whether to use one scale per tensor, per channel, or per block — so the grid lands where the weights actually cluster.

Why it pays off. Cutting FP32 to INT8 shrinks the model 4x and cuts memory traffic 4x, which — per the roofline — is exactly what helps a memory-bound LLM. The multiplies also become cheap integer or low-precision operations that tensor cores run several times faster. The cost is rounding error: too few levels, or a few outlier values stretching the scale, and accuracy drops.

ApproachWhen quantizedAccuracyCostTypical use
PTQ (post-training)after traininggood with careminutesmost INT8 deploys
QAT (quant-aware)during trainingbestfull retrainaggressive low-bit
Weight-onlyweights only, acts FP16highsimpleLLM inference (GPTQ, AWQ)
Dynamicactivations at runtimegoodslight overheadactivation-sensitive nets
Quantization — snap continuous FP32 values onto a small integer grid FP32 weights: continuous, 32 bits each 0 min max INT8 grid: 256 levels (16 shown), 8 bits each q = round(x / s) + z s = (max - min) / 255 x' = s(q - z) s = scale, z = zero-point. Dashed lines snap each value to its nearest level; the gap is rounding error. Fewer bits, less memory. INT8 is 4x smaller than FP32 and cuts memory traffic 4x -> big win for a memory-bound LLM. Cheaper math. Integer / low-precision multiplies run several times faster on tensor cores. The catch: outliers. A few large values stretch the scale and coarsen everything else - the hard part below INT8.

Bit-width is a spectrum, and outliers set the floor. INT8 is routine; INT4 and FP4 need care because a handful of outlier activations dominate the range and inflate the rounding error for everything else. Per-channel scales, group-wise quantization, and outlier-aware methods (SmoothQuant, AWQ, GPTQ) exist precisely to keep the grid useful as the bit-width shrinks.

Read quantization through a quant lens rather than an accuracy-table lens: it is a knob on arithmetic intensity and model footprint, not merely a compression trick. Every bit removed multiplies effective bandwidth and tensor-core throughput, so the real question is how far levels can drop before rounding error crosses the task's tolerance — a measured bytes-versus-error trade, not an assumed one.

Take quantization further

Ask the copilot about this term, or have our engineers assess it against your process.