Log inStart free
LESSON 30.05 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Activation quantization

Watch a layer turn its live inputs into INT8 codes and multiply integers.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 30.05 · QUANT BAYX 4×8 · W 8×4 · OUTLIER ON
01
Stage 1 of 6 · The layer
The layer multiplies the activations X by the weights W. Channel 3 is an outlier channel: large in every token.
Explain it simply

Each row of X is one token, and each column is one channel, one input to the layer. The weights W are fixed after training, but X is new for every request. Look at channel 3: it is large in every token, like one loud voice in a quiet room.

X has 4 tokens by 8 channels. W has 8 inputs by 4 outputs. Y is 4 by 4. Channel 3 holds large values in every token.

activations Xweights W, scalesoutlier, erroroutput Y
the layerX · activationsW · weightsY · output×=c1c2c3c4c5c6c7c8t1t2t3t41.10.217.50.70.20.10.4−1.10.20.07.2−0.1−0.10.2−0.40.22.70.841.10.73.83.61.11.20.8−0.315.40.60.8−0.70.30.6−0.68−0.200.370.21−0.310.460.45−0.49−0.11−0.01−0.11−0.14−0.980.35−0.700.140.94−1.080.370.35−0.481.190.72−0.11−1.06−1.410.180.310.210.980.100.25−3.94−1.75−1.80−2.33−0.520.88−0.64−1.07−6.43−0.490.69−3.95−1.76−1.68−2.12−1.14outlier: channel 3the layerX · activationsW · weightsY · output×=c1c2c3c4c5c6c7c8t1t2t3t41.10.217.50.70.20.10.4−1.10.20.07.2−0.1−0.10.2−0.40.22.70.841.10.73.83.61.11.20.8−0.315.40.60.8−0.70.30.6−0.68−0.200.370.21−0.310.460.45−0.49−0.11−0.01−0.11−0.14−0.980.35−0.700.140.94−1.080.370.35−0.481.190.72−0.11−1.06−1.410.180.310.210.980.100.25−3.94−1.75−1.80−2.33−0.520.88−0.64−1.07−6.43−0.490.69−3.95−1.76−1.68−2.12−1.14outlier: channel 3
Toy: 4 tokens × 8 channels, seeded random weights
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Y=X W\sy{y}{out}{Y} = \sy{x}{data}{X}\,\sy{w}{param}{W}
y11=1.09⋅(−0.68)+0.23⋅(−0.31)+⋯=−3.94y_{11} = 1.09\cdot(-0.68) + 0.23\cdot(-0.31) + \dots = -3.94

Each output adds 8 activations times 8 weights.

Common mix-ups

MYTHA per-token scale protects the small channels.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01If the outlier channel is off, does the output error go up or down?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.