Stanford PhD blog: deriving Transformers from memory, revisiting a clue from the 2017 paper
Start here
Stanford PhD Alex Wang published a blog post proposing to view linear layers, MLPs, and self-attention uniformly as associative memory stores, and deriving Transformers from the perspective of memory interference. In a 64-dimensional Key experiment, the linear memory store holds about 64 items, the squared ReLU GLU-style MLP about 2,700 items, and self-attention with a fixed scaling coefficient has a theoretical capacity of about 1.2 million items. He also said that an early arXiv version of "Attention Is All You Need" described the feed-forward layer as a kind of attention.
Generated by AI from reports · Updated 2026-10-18
Progress timeline
- WeChat · Synced (Jiqizhixin)Stanford PhD Alex Wang's blog: Deriving Transformer from Memory, Revisiting Early Clues in the 2017 Paper
Alex Wang published a blog post proposing to unify linear layers, MLPs, and self-attention as associative memory stores, and deriving the Transformer from the perspective of memory interference. In the 64-dimensional Key experiment, the linear memory capacity is about 64 entries, the squared ReLU GLU-style MLP about 2700 entries, and the theoretical capacity of Self-Attention with a fixed scaling coefficient about 1.2 million entries. He also said that the early arXiv version of "Attention Is All You Need" described the feed-forward layer as a kind of Attention, and that discussion later disappeared from the paper.
- X@ziziran2· DiscussionIn Chinese, as written同一个“記”字,存的记忆越多,线性层越先把它读成噪点。 Alex Wang 用这张动画解释 Transformer:其他记忆会干扰当前检索;非线性和注意力能把不相关项压下去。 最值得一起看的,是原文的前提:随机键值、单层、拿存过的原键…(opens the original post in a new tab)
Related discussion
- Older than 72 hours · Not included in the 72-hour figures
- WebSynced (Jiqizhixin)Could you have invented Transformer? A paper from 9 years ago had clues? This blog post by a Stanford PhD went viral.(opens the original post in a new tab)
- X@LifanBuilds · Lifan | Builder6/ Alex Wang derives linear layers, MLPs, and attention as memory stores. The key is interference during recall. Code a…(opens the original post in a new tab)
1 comments·Oct 18 19:33Collect
- X@ziziran2 · ziziranIn Chinese, as written同一个“記”字,存的记忆越多,线性层越先把它读成噪点。 Alex Wang 用这张动画解释 Transformer:其他记忆会干扰当前检索;非线性和注意力能把不相关项压下去。 最值得一起看的,是原文的前提:随机键值、单层、拿存过的原键…(opens the original post in a new tab)