Click a stage (or use the buttons) to light it up.
Where the memory sits
Example: 16-layer model, memory layers 6 and 12 (as described in the episode). Memory replaces the FFN in those layers only.
Toy product-key searchIllustrative values
3 sub-keys per codebook → 9 implied keys. Sub-key vectors are made up for the demo; the procedure is the paper’s. Rotate each query half.
left half angle
right half angle
keep k per half
Why top-k of each half is enough
A key’s score = left score + right score. If a true winner used a left sub-key outside the left top-k, then k better left sub-keys paired with the same right partner would all beat it — contradiction.
Scope: exact over product-structured (Cartesian) keys only, not a million freely chosen vectors.
Search cost: flat vs product keys
Cost in full-query-dimension comparison units, from the formula in the episode: flat = N; product ≈ √N + k² (two codebooks of n half-size sub-keys ≈ n full-size, plus k² pairs). N = n².
sub-keys per codebook n = 2^
k
Implied keys vs stored sub-keys
Hover a cell: key (i, j) = left sub-key i ⊕ right sub-key j. First 16×16 of the grid shown.
Reported numbers
Values as stated in the episode. Single runs, no variance reported. Lower perplexity is better.
Main setup & training recipe
What the comparison leaves out
Hover or tap a row. Statuses summarize the episode’s critique.
Back-of-envelope parameter billAssumption
The paper reports no parameter count. Value dimension is not confirmed in the text; slide to see what 262,144 slots × dim would imply.