AlgoViz

What quantization does to a weight

medium 7 min

A trained layer contains real-valued parameters represented at finite precision.

Trace the example

Follow the evidence through each stage, then test a change in the case.

Fit a small weight and an outlier on four bits

Fit a small weight and an outlier on four bits. Selected component: Weight sample inside Model weights.
Open full-size diagram

Model weights

Inspect 0.26 and 1.04

These two weights share a toy group. The first lies inside the fine codebook range and the second exceeds it.

Increasing the toy scale reduces outlier clipping but what can it cost?

Fit two weights into sixteen levels

0.26 → code 3 → 0.30 (error 0.04) · 1.04 → code 7 → 0.70 (error 0.34)

Both weights share one signed four-bit codebook and zero point 0. Move the scale from 10 to 20 hundredths to compare clipping with rounding.