
Alex Wang (@heyyalexwang) published a blog post, "You could have invented transformers from memory". It treats each transformer layer as a memory store and asks how much each can hold. The post comes with code and interactive figures.
Recalling the character 記 from an outer-product store, a ReLU MLP, a gated MLP and self-attention. @heyyalexwang
The setup. A memory is a key-value pair. Recalling one means querying with a key, which returns the target value plus interference from every other stored memory with a similar key. Wang defines a store's capacity as the number of memories it can hold before interference grows as large as the signal.
The progression, per the post:
v kᵀ terms. With random unit keys, interference-to-signal scales as roughly √(M/d), so capacity is about d.
Linear memories with d = 64: the outer product fails near M = 64; the least-squares store is exact up to M = d. Alex Wang

Sharper nonlinearities push the failure point right: ReLU², SwiGLU and ReLU³ hold far more memories than a linear score. Alex Wang

Adding terms of the exponential series lowers interference; the full exponential (self-attention) stays far below the failure line. Alex Wang
Caveats from the post and replies.
Related work. Wang points to prior work on feedforward layers as memories (Sukhbaatar et al.; Geva et al.). A recent paper on associative-memory views of transformers, and one on fine-tuning-induced hallucination, both frame forgetting as interference between overlapping facts.
The post gives a compact, checkable intuition for why MLPs and attention look the way they do. It frames memory capacity as a question of suppressing interference. That view also bears on interpretability and on why adding new facts can degrade old ones.
Alex Wang on XAlex Wang: You could have invented transformers from memoryarXiv 2505.19488arXiv 2604.15574