You could have invented transformers from memory

A blog post that derives MLP and attention layers by improving a simple key-value memory.

Author
Alex Wang
Published
15 October 2026
Kind
Personal blog post with derivations, simulations and interactive widgets
Original
alexwang.ai/posts/associative-memory/
Subject
Language models and training
Themes
Getting good, What lasts

What it is

Alex Wang writes an explainer on transformers as memory systems. It starts from an outer-product key-value store. It adds fixes that reduce interference until MLP and attention layers appear.

What it says

What evidence it gives

The post gives algebraic derivations and simulations with random unit keys and random values. A summary table lists the capacity of each store at key dimension 64. Interactive widgets let readers vary the settings.

Interests and limits

This is a personal blog post. Capacity counts recall of random vectors before interference equals signal. The post says it ignores training data, which shapes real keys and values. Results come from simulations at key dimension 64.