1MAD
QTIP's first computed codebook: one multiply-add on the state, then the sum of the four bytes. No lookup table.
Why compute the codebook
A trellis code maps each L-bit state to a value. With L = 16 a lookup table has 65,536 entries, too large to keep close to the tensor cores. QTIP's idea is to compute the value from the state with a few integer instructions, so decoding needs no memory at all. The hash only has to make the values look Gaussian (because rotated weights are Gaussian) and make neighbouring states look independent (so the K new bits per step reach a spread of values).
What the figure shows
Top: the state register. Each step shifts in K new bits, chosen greedily here to track a random Gaussian target (a real encoder uses Viterbi, see tail-biting). Middle left: every state's value. A byte sum can only take 1021 values (0 … 1020), and 908 of them occur over the 65,536 states. The histogram is a sum of four uniforms, close to a Gaussian. Middle right: the 2K values the next step can reach.
Things to try
- Set
b = 0ora = 1and watch the distribution and the walk fall apart. - Sum only two bytes and see the histogram turn into a triangle.