PICTURE. Two horizontal rulers stacked. Top: the real weights, crowded near zero. Bottom: the 256 integer slots, evenly spaced. Our whole job is to glue the top ruler onto the bottom one.
PICTURE. The top ruler now has a green bracket around [rmin,rmax]. Only that bracket gets stretched to fit the 256 integer slots below. The far tails are greyed out — wasted if included.
PICTURE. A single straight red line on a graph: horizontal axis q (integers), vertical axis r (reals). Its slope is S; the point where it crosses r=0 sits at q=Z.
PICTURE. The line again, with a bright yellow dot at (Z,0) — the exact spot where the ruler passes through real zero — and Z read off the horizontal axis.
PICTURE. A real value r=0.5 shown as an arrow up to the line, snapping right onto integer q=64, then back down to r^=0.502. The tiny gap between r and r^ is the rounding error, capped at S/2.
PICTURE. The specific line for this example, with the real point 0.5, the snapped integer 64, and the recovered 0.502 marked, plus the shaded ±S/2 error band.
PICTURE. Three mini number lines side by side: (A) collapsed range, (B) one outlier dragging the ruler, (C) an off-centre range with Z snapped to the nearest tick.
Recall Feynman retelling — the whole walkthrough in plain words
Imagine you own a shelf with exactly 256 labelled boxes (that's int8). Your model's weights are a pile of numbers that mostly huddle near zero. First you find the smallest and largest number you actually own — that's your green bracket. You stretch that bracket evenly across all 256 boxes; the real-width of one box is the scale S. You make sure one special box sits exactly on the number zero — that box's label is the zero-point Z — because your model makes lots of zeros and you don't want to smudge them. To pack a number away, you round it to its nearest box; to use it later, you read the box's real value back. You lose at most half a box's worth of accuracy, so if you make the boxes narrow (a tight bracket) you barely lose anything. Special warnings: if all your numbers are the same, don't stretch anything (S=1); if one crazy number is far away, ignore it when choosing the bracket, or it wastes all your boxes; and if your numbers aren't centred on zero, just snap the zero-box to the nearest label. That's quantization — the trick that shrinks a model 4× so it runs on a phone.