In one line: An explainer (about 19 minutes, derivations, a NumPy script and an in-page slider) that reads a linear layer, an MLP and softmax attention as stores of key-value memories and ranks them by how much the other memories leak into a recall. For random unit keys and values at key dimension 64, queried with a stored key, the leak equals the recalled value at about 64 memories for an outer-product matrix, 128 for a least-squares matrix or ReLU MLP, about 2,700 for a squared ReLU and about 1.2 million for softmax at the usual sharpness; our independent run and the author's 5-seed data agree with each.
How far to trust it: Believe the derivations and every number: we recomputed them from scratch and they agree with the author's released data. Read "capacity" as how many rows one readout can hold before crosstalk equals the signal, for random vectors queried exactly, not as how much a layer stores per parameter: the matrix holds its 64 memories in 4,096 numbers, while the MLP's 2,700 and attention's 1.2 million each take their own 128-number row. The evidence, judged.
The idea in one sentence: a linear layer, an MLP and softmax attention all recall a stored value by weighting every stored value by its key's similarity to the query, so the leftover weight on all the wrong memories (interference) grows like √M; each step from the matrix to the MLP to attention shrinks the weight on keys that are only slightly similar, which lets one readout hold about d, then about d², then about e2√d random memories before the interference is as large as the value it recalls.
What this page is for. The layers themselves are owned elsewhere (The transformer from zero; the outer-product state on Beyond attention). No page of ours has the article's single yardstick applied to all three layers, so this page follows that argument, recomputes every capacity live (section 10), and says how far "capacity" carries.
You need: what attention and the FFN compute (The transformer from zero); outer products and least squares (Linear algebra for ML, sections 3 and 7). The rest is built here.
New terms: memory store (a function holding M key-value pairs that, queried with x, returns a mix of values weighted by how similar their keys are to x); signal and interference (the target value's share of a recall, and everything the other M − 1 memories add to it); interference-to-signal ratio (the length of the second over the length of the first); capacity (the M at which that ratio reaches 1, for random unit keys and values queried with a stored key); sharpness β (the factor on similarities inside the exponential; standard attention's 1/√dk scaling is β = √dk for unit-length keys).
The article judges every layer by the interference-to-signal ratio: the length of what the wrong memories add to a recall, over the length of the right value. A store holds M pairs (key ki, value vi) and, queried with kj, should return vj; its capacity is the M at which the ratio reaches 1. Everything is run at key dimension dk = 64 with random unit keys and values, and the promised ladder is a jump from about 64 memories to about 2,700 to over a million.
The simplest store is one matrix, W = Σi viki⊤, read as Wx = Σi vi(ki·x). So recall is a lookup by similarity. A gradient step on a linear layer, W ← W − η ȳx⊤, is such a write, and the same matrix is linear attention's state, which Beyond attention animates (its Fig. 2). Queried with a stored unit key, the answer is vj (signal) plus Σi≠j vi(ki·kj) (interference). Random keys have similarities of about ±1/√dk, and M − 1 such terms add like a random walk, so the ratio is about √(M/dk) and capacity is dk = 64: past that we cannot get perfect recall once we store more. The article's bar figure shows one recall's weights piling up as M passes 64.
Short of a bigger key dimension, store more carefully (cancel the keys' overlap: section 4) or recall more selectively (damp keys that barely match: sections 5 to 7).
Fit every memory at once, minW Σ‖Wki − vi‖², and W = VᵀK(KᵀK)−1: the same store with the query first multiplied by the inverse key covariance. This whitens the keys, so the store stops over-weighting shared directions (least squares and the pseudo-inverse: Linear algebra for ML, section 7). It is exact up to M = dk; past that the article derives, from the projection P = K(KᵀK)−1Kᵀ (trace dk, P² = P), a ratio of √(M/dk − 1), so its capacity is twice as large as before: 128. The online form of this fit is the delta rule, owned by Beyond attention (section 3, Fig. 3).
Weight by σ(ki·x) instead, f(x) = Vᵀσ(Kx), and We just rediscovered a two-layer MLP from first principles: one hidden unit per key, the output matrix's columns as values. ReLU zeroes negative similarities (capacity 128); squared ReLU also crushes small positive ones (A similarity of 0.1 becomes 0.01). Squared ReLU is ReLU(Kx) ⊙ Kx, a GLU whose gate shares the input weights; SwiGLU, as in our transformer from zero, gives the gate its own weights and a Swish. Trained FFNs behaving this way is Geva et al.'s measurement, which the architecture root cites; the article adds that real MLPs store facts in superposition, which the one-memory-per-unit picture does not cover. Its aside that the Transformer paper said this first, then cut it (the passage is gone from every later version), is correct (closed block).
arXiv v2 (19 June 2017) and v3 (20 June) of Attention Is All You Need end with "Two Feed-Forward Layers = Attention over Parameters": the FFN is "a kind of attention" with ReLU for softmax and the rows of W1 and W2 as keys and values. Replacing every FFN with attention over 1,536 or 512 learned key-value pairs per head, at matched parameters (65M), gave in Table 5: base perplexity 4.92 and BLEU 25.8 (newstest2013, development), AOP1 4.92 and 25.5, AOP2 4.86 and 25.9, both trained 16 hours against 12. v4 (30 June 2017), v5 and v7 have no such appendix; our paper page reads v7. One slip in it: the text gives the second model 8 heads, Table 5 gives 16.
With σ = ReLUp the target keeps weight 1 while a typical other key falls to about dk−p/2, so capacity is about dkp. With the half-normal moments the constants are 2dk (ReLU), 2dk2/3 ≈ 2,731 (squared) and 2dk3/15 ≈ 34,953 (cubed). The shared-gate SwiGLU, s²/(1 + e−s), lands at about 2,900: its capacity nearly matches the squared ReLU, for a reason the article does not give (closed block).
Near s = 0 the sigmoid is about ½ on both sides, so the curve acts like s²/2 for negative similarities too instead of zeroing them. The crowd's mean-square weight is then 3/(4dk2), half the squared ReLU's 3/(2dk2), while the target's weight is 1/(1 + e−1) = 0.73, a factor 0.73² = 0.53; the two nearly cancel. Gaussian estimate 2,864, measured 2,961 here, 2,901 in the author's data.
Use the exponential, a weighted sum of every power, eβs = Σp(βs)p/p!, and capacity becomes e2β(1 − β/dk), exponential in β. The derivation uses E[ets] = et²/(2dk) for a normal similarity, giving the ratio √M · eβ²/dk − β. At attention's β = √dk = 8 that is e14 ≈ 1.2 million, nearly 20,000 times the linear store (the author's run crosses 1 at about 1.23 million). Truncated series show the ladder from inside: with 2 terms, the capacity is about 40, with 3 about 450, with 4 about 3,100. Normalising the weights changes no ratio, and the result is Vᵀ softmax(βKx). Unlike an MLP, its keys and values come from the context, one per token, so M is the context length (what makes self-attention non-parametric); the price is the KV cache that Long context sizes. Standard attention's division by √dk, with q and k of length about √dk, is β = √dk for unit vectors (footnotes 6 and 7).
Since capacity is exponential in β, a longer context needs only a slowly growing β. A huge β would make softmax a hard argmax that picks only the most similar key, with no gradient to the rest, so the rules scale the attention logits with log M against a reference length L: Su (2021) by log M / log L everywhere (Scalable-Softmax learns the factor), the original Qwen's LogN only past L, Qwen2.5-1M by YaRN's (0.1 ln(M/L) + 1)² (YaRN's temperature: Positional Encodings). In the author's simulation (β = 8 at L = 1,024) plain softmax passes 1 near 1.2 million memories; Su's and Qwen's rules hold the ratio at about 0.004 at 2 million, YaRN's at 5.9 × 10−5 (rounded in the article to "about 10−4").
The article ends on the ladder as a table (64, 128, 128, about 2,700, 2,900, 35,000, 1.2 million, and more than 2 million with log M scaling) and on two caveats: Our capacity estimate only counts how many random vectors one layer recalls, and we haven't actually considered the training data at all. For trained models it points to bits per parameter (Morris et al. about 3.6, Allen-Zhu and Li about 2 for facts; quoted, not checked here), then a reading list that seeds our Further reading.
The figure repeats the article's experiment from scratch: M random unit keys and values in d dimensions, 48 stored-key queries, the median ratio (as the author's code takes it), three seeds, M = 4 to 16,384; solid lines measured, dashed lines the article's Gaussian estimate continued to 2 million, open circles where a measured line crosses 1. It opens on curves recorded by this page's src/recompute.py (the same code and random numbers); the button or another d computes live.
At d = 64 the defaults reproduce the article independently (our code, our seeds): 67 against 64, 128, 124 against 128, 2,853 against about 2,700 and 2,961 against about 2,900; cubed ReLU and softmax stay below 1 in range (0.65 and 0.11 at 16,384). The medians sit a little above the estimates for the sharp stores because a few large terms dominate their sums.
Predict, then switch d from 64 to 32. Which capacity falls furthest: the matrix's, the squared ReLU's or softmax's? Then try 16.
The matrix halves (64 to 32), the squared ReLU quarters (2,731 to 683 by the estimate; 768 measured), and softmax falls about a hundredfold, from e14 ≈ 1.2 million to e2√32 − 2 ≈ 11,000 (11,553 measured), because its capacity is exponential in √d. At d = 16 softmax holds about 400 (563 measured), fewer than the cubed ReLU's 546 to 838: the ladder's order is not fixed, it depends on the head size. Small heads lose most where attention is strongest.
The mathematics and the numbers hold. Every capacity comes out of our independent run, out of the Gaussian estimates and out of the author's released five-seed data (closed block below). The derivations are standard (random-walk sums, projection identities, the Gaussian moment generating function), the code is public and runs in under a minute, the post is unchanged since its first archived copy (16 October 2026), and the one historical claim, the Transformer appendix, is right in every detail.
What "capacity" measures is narrower than the ladder suggests. It is the number of memories one readout can sum over before the crosstalk from random wrong memories is as long as the right one, and the stores spend very different amounts of storage to get there:
| store at dk = dv = 64 | memories at capacity | numbers it keeps | numbers per memory |
|---|---|---|---|
| outer product, one 64 × 64 matrix | 64 | 4,096 | 64 |
| optimal linear, one 64 × 64 matrix | 128 | 4,096 | 32 |
| squared-ReLU MLP, one hidden unit per memory | about 2,731 | about 349,600 | 128 |
| softmax attention, one cached key and value per token | about 1.2 million | about 154 million | 128 |
Derived: an MLP or cache row holds one key and one value, 64 + 64 numbers; 2,731 × 128 and 1,202,604 × 128 (inputs/recompute.json).
Verdict. Believe the derivations and every number, and use the article as the clearest single argument for why softmax attention can recall one item among a million and why sharper activations help MLPs. Read its capacities as rows read cleanly from random vectors with exact queries, not as storage per parameter, and not as a description of trained layers.
No rebuttal, replication or blog response was found (web search, 27 November 2026); a Chinese translation appeared on 机器之心, linked from the post. The Hacker News thread had 670 points and 152 comments on 27 November 2026 (submitted 16 October 19:01 UTC; a dated reading); most of it is praise or an argument about mathematical notation. The substantive points:
Layers act on deep representations shaped by a loss, so treating Q, K and V as a lookup table says little about what trained layers do; attention is better seen as a kernel method. The author agreed the post is an intuition that ignores what gets written into the weights and the learning dynamics, and pointed to the papers in his closing list.
The capacities hold for random keys and values; real keys are correlated and real values are structured, which both helps (compression) and hurts (correlated keys interfere more). A second commenter adds that truly random key-value pairs would be served better by an exact associative array. The post states the first limit itself in its closing section.
If higher powers suppress interference better, the limit is argmax over keys. The answer, already in the post: argmax is not differentiable, and a very large β saturates the softmax so the gradients to other keys vanish; hence β grows only as fast as M requires.
The largest sub-thread: readers without linear algebra found d_k, ℝ^{d_k}, M and "similarity" not defined at first use and asked for a worked example with real data structures; others answered that the terms paragraph defines them. A reading-level complaint, not an error.
It contradicts nothing on our pages; it gives three of them a quantitative reason they lack.
Read on 27 November 2026: the post (fetched that day; dated 15 October 2026 in its page data; 4,276 words with formulas and figure labels, 19 minutes at 230 words a minute), its footnotes and three collapsed asides; the code repository (README, crosstalk.py and data/crosstalk.json at commit 5defb8d, 15 October 2026; no licence file, so its data is cited, not copied); all 152 Hacker News comments through the item API; arXiv 1706.03762 v1 to v5 (the appendix is in v2 and v3) and its submission history; the Qwen2.5-1M report (arXiv 2501.15383, section 5.1) for the YaRN rule's definition; the arXiv titles of the papers in Further reading. The two earliest Wayback copies (16 October 2026, 18:16 and 19:06 UTC) carry the same text as the current post.
Not checked: the 1% hidden-unit activation figure (Li et al.), and the bits-per-parameter estimates of Morris et al. and Allen-Zhu and Li, all quoted from the article. Hacker News commenters are not named here; they are readers, not authors of published responses.
Every link opens in a new tab; links checked 27 November 2026. Reading time of the resources below: 5h 38m.
Alex Wang (independent; Stanford PhD, formerly Cartesia): The post itself (alexwang.ai, published 15 October 2026). The interactive bar figure (one recall's weights, with a slider for the number of memories and the sharpness) is in the post under "Recall picks up interference".
(19 min)
Alex Wang (independent; Stanford PhD, formerly Cartesia): The same argument as a talk, titled "Associative memory as a fuzzy perspective on architecture design".
(15 min)
the authors: crosstalk.py (about 150 lines of NumPy; uv run, under a minute) and data/crosstalk.json, the five-seed curves behind every chart in the post (commit 5defb8d, 15 October 2026; no licence file).
(10 min)
a Hacker News commenter, with the author's reply, 17 October 2026, objection: Layers act on deep representations shaped by a loss, so treating Q, K and V as a lookup table says little about what trained layers do; attention is better seen as a kernel method. The author agreed the post is an intuition that ignores what gets written into the weights and the learning dynamics, and pointed to the papers in his closing list.
(3 min)
two Hacker News commenters, 17 October 2026, objection: The capacities hold for random keys and values; real keys are correlated and real values are structured, which both helps (compression) and hurts (correlated keys interfere more). A second commenter adds that truly random key-value pairs would be served better by an exact associative array. The post states the first limit itself in its closing section.
(2 min)
a Hacker News commenter, answered in the thread, 17 October 2026, question: If higher powers suppress interference better, the limit is argmax over keys. The answer, already in the post: argmax is not differentiable, and a very large β saturates the softmax so the gradients to other keys vanish; hence β grows only as fast as M requires.
(2 min)
several Hacker News commenters, 17 October 2026, reader comment: The largest sub-thread: readers without linear algebra found d_k, ℝ^{d_k}, M and "similarity" not defined at first use and asked for a worked example with real data structures; others answered that the terms paragraph defines them. A reading-level complaint, not an error.
(2 min)
Vaswani et al. (maker): The passage the article cites: the FFN as attention with ReLU for softmax, and Table 5's two attention-over-parameters models (PPL 4.92 and 4.86, BLEU 25.5 and 25.9 against the base model's 4.92 and 25.8). In v2 and v3 only; gone from v4 (30 June 2017) on.
(5 min)
Geva, Schuster, Berant, Levy, 2021 (maker): The measurement behind the MLP-as-memory reading: keys in trained FFNs fire on recognisable input patterns, values push the next-token distribution.
(40 min)
Nichani, Lee, Bietti, 2024 (maker): The article's footnote 3: when recall only has to pick the right answer from a fixed set (argmax), a d by d matrix holds about d² facts, not d.
(45 min)
Ramsauer et al., 2020 (maker): Softmax attention as the update rule of a modern Hopfield network with exponential storage capacity: the older form of the article's self-attention section.
(60 min)
Wang, Shi, Fox, 2025 (the author's own paper): The regression objective of the article's optimal-store section, used to derive linear attention, the delta rule and softmax attention as memories written during the forward pass.
(60 min)
Schlag, Irie, Schmidhuber, 2021 (maker): The outer-product store as the state of linear attention, its capacity limit when the sequence outgrows the key dimension, and the delta rule as the fix (footnote 2).
(45 min)
The owner of the outer-product store as a sequence model's state: Fig. 2 writes keys and values into it, Fig. 3 overfills it at small key sizes and fixes it with decay and the delta rule.
The block the article rebuilds: attention, the FFN and SwiGLU, and why scores are divided by √d (measured on random vectors).
What real models change about the softmax store: shared keys and values, compressed caches, windows and sinks.
Outer products, least squares and the pseudo-inverse behind the optimal linear store.
YaRN's attention temperature, one of the long-context sharpness rules the article tests.
The paper page; it reads v7, which no longer has the attention-over-parameters appendix.
ReLU, squared ReLU and Swish as activations; this article gives squared ReLU a reason.
This page is one of the Articles: articles worth a page of their own, each with its argument, its evidence judged and what others replied.