Log inStart free
LESSON 30.06 · 6 STAGES · 3 CONTROLS · 2 CHECKSPRO · PREVIEW

GPTQ

Watch GPTQ round one column of weights and push its error into the next columns.


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

Go Pro · $8.25/mo
EXPLAINER · 30.06 · QUANT BAY64 WEIGHTS · INT4 · 16 CALIBRATION TOKENS
01
Stage 1 of 6 · The layer
GPTQ turns the 64 weights of W into INT4 codes. It keeps the outputs W x close on 16 calibration tokens.
Explain it simply

The grid holds the 64 weights, and each row makes one output. The second panel shows 16 sample inputs, the calibration tokens. Channel 6 is about 7 times larger, so its column has the strongest shade. GPTQ stores each weight as a small code, and it uses these inputs to pick the codes.

An 8 by 8 grid of weights, and a 16 by 8 grid of calibration inputs. Column 6 of the inputs is much stronger. All 16 tokens are used.

weights, codesinputs, Herror, weights it movedoutlier channel
0.21−0.32−0.07−0.210.470.340.05−0.50−0.110.25−0.11−0.460.00−0.140.50−0.340.120.09−0.370.26−0.15−0.230.200.09−0.160.24−0.290.010.281.24−0.630.130.110.02−0.38−0.05−0.36−0.01−0.100.260.030.01−0.170.110.190.300.440.09−0.58−0.31−0.27−0.140.00−0.06−0.080.23−0.270.08−0.04−0.04−0.060.31−0.13−0.62rows = tokens · channel 6 is about 7× largerthe layerweights W: row = output, column = input channelcalibration batch X: 16 × 81234567812345678y = W x: GPTQ keeps W x close on 16 calibration tokens0.21−0.32−0.07−0.210.470.340.05−0.50−0.110.25−0.11−0.460.00−0.140.50−0.340.120.09−0.370.26−0.15−0.230.200.09−0.160.24−0.290.010.281.24−0.630.130.110.02−0.38−0.05−0.36−0.01−0.100.260.030.01−0.170.110.190.300.440.09−0.58−0.31−0.27−0.140.00−0.06−0.080.23−0.270.08−0.04−0.04−0.060.31−0.13−0.62rows = tokens · channel 6 is about 7× largerthe layerweights W: row = output, column = input channelcalibration batch X: 16 × 81234567812345678y = W x: GPTQ keeps W x close on 16 calibration tokens
Toy: the 8 × 8 layer and 16 calibration tokens of 30.C1
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
min⁡W^∥WX⊤−W^X⊤∥2\min_{\sy{q}{param}{\hat W}} \|\sy{w}{param}{W}\sy{x}{data}{X}^\top - \sy{q}{param}{\hat W}\sy{x}{data}{X}^\top\|^2
X:16×8, W:8×8X: 16 \times 8,\ W: 8 \times 8

GPTQ picks codes that keep the outputs on X close.

Common mix-ups

MYTHGPTQ brings each weight closer to its original value.

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

Predict, then reveal
2 CHECKS · PRO
Q01At INT4 with 16 tokens, left to right puts column 6 sixth. Does GPTQ gain more or less?

Make your guess, then test it in the diagram. All 2 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 2 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.