Proc. Natl. Acad. Sci. USA · Vol. 79 · pp. 2554–2558 · Biophysics APR 15 1982

The paper that remembers itself

Scribble out any part of any of these five pages — a word, a line, the title. Let go.

A real paper from 1982, by the physicist John Hopfield, describing the kind of memory that brings back a whole song from two notes. The paper is now stored inside the memory it describes: every pixel position below, ink and blank paper alike, is one switch in a single network — the same 784,320 switches hold all five pages. The idea won the 2024 Nobel Prize in Physics.

the paper is loading — 0 of 5 pages
all five pages · one network of 784,320 switches · each pixel position is one switch, shared by all five

What you just did is where AI's memory comes from.

Give it a fragment, get the whole thing back. That one move — run on words instead of ink — is what a chatbot does to hold a conversation. Its name is attention.

the two changes that get there, precisely

The move is the same; two things change on the way, and they are not the same change.

A sharper energy. Equation [7] sums over pairs of pixels; that quadratic is what caps it near 0.15 N. Score each stored page as a whole instead, and capacity turns exponential — still in black and white:

E = −∑s exp(ξs⊤ x)

ξs is still stored page s; x is the page on screen — both written as ±1 per pixel. Each term scores how well the screen matches one stored page, and the exp lets the best match tower over the rest.

Then shades of grey, which buys differentiability — not capacity — so the whole thing can sit inside a trained network. Recall is now one line, with X the five stored pages set side by side as columns:

xnew = X softmax(β X x)

The softmax turns the five match scores into weights that sum to one — a gentler "pick the best" — and the new page is the stored pages blended by those weights. β sets how sharply the best match dominates.

Feed the fragment and the memories through three learned projections — query, key, value — set β = 1/√dk, and that same line is attention:

Z = softmax(QK/√dk) V

The fragment is the query; the stored pages are the keys and values. In a language model there is no fixed library — each word attends to the other words in the same sentence, so the memories are whatever it is reading.

The valley is still there — this energy has a floor too — but it lands in a single step, where the 1982 rule you just ran needed thousands of flips to reach it.

The four dates, with sources

  • 1982 — J. J. Hopfield, Neural networks and physical systems with emergent collective computational abilities, PNAS 79:2554–2558. The five pages above.
  • 1985 — Personnaz, Guyon & Dreyfus, the projection rule: the storage recipe this page actually runs, and the reason five near-identical pages stay apart.
  • 2020 — Ramsauer et al., Hopfield Networks is All You Need: the continuous version of the update above is transformer attention.
  • 2024 — Nobel Prize in Physics, Hopfield and Hinton.
The fine print — is this really the paper?
  • The memories are written in with a 1985 pen, not the 1982 one. Five pages this alike smudge together under the paper's own storage recipe (equation [2]) — the 1982 toggle in the panel shows it happening. A 1985 recipe keeps them apart. Everything the pen writes into — the network, the recall rule, the energy — is 1982.
  • The network sees the page as pure black-and-white dots at reduced detail, so tiny text looks rough — you are looking at the memory itself, not a photo of the paper.
  • Scribble out more than half a page and it heals into its own photographic negative — this kind of memory stores the exact opposite of every page just as deeply, free of charge. Wreck a page badly enough and it can land on a different page instead. The readout names which one happened.
  • Pixels-as-switches is the usual way to picture this network — the memory is a picture, not "understanding." It does not read the words as language.
  • "Holds exponentially more" above is a different test, not the same scoreboard. The 1982 limit — about 0.15 memories per switch — was measured on random patterns, allowing a few wrong pixels. The modern figure assumes memories already very unlike each other. The jump is real, but it is not one number rising on one chart.
  • This demo is a side branch, not a step toward chatbots. It runs the 1982 network, with the 1985 pen, in black and white, until it settles. Attention grew from the same 1982 root along a different branch — what they share is the move "start from a fragment, land on the nearest memory," not this exact machinery.
  • Related earlier work, for anyone tracing the theory: Shun'ichi Amari (1972) and William Little (1974). Both are cited on the last page above — Little's 1974 paper is ref. 8, Little & Shaw ref. 25, and Amari refs. 6–7 (his 1977–78 papers).

Fig. 2, re-run here

N = 100 switches, n random memories, the 1982 rule. Each memory is set in perfectly, then left alone — the bars count how many of its pixels drift away. Past 0.15 N memories it breaks down. The printed figure shows n = 5, 10, 15; the 25 here is one step further over the cliff.

Scribble across any page — ink comes off, specks land. Then let go.

where it landed

loading the page…

equation [1], firing

One pixel at a time asks the rest of the page what it should be. The intact print outvotes the scribble — that is the whole trick.
hopfield.js · updateOne() · idle
i = pick one pixel, at random —
the red ring marks it on the page
hi = ∑j Tij μj = the whole page votes on it,
through the wiring. this is the tally
Tij = ∑s,r ξis (G−1)sr ξjr the wiring · 1985 rule.
G is how much the five
pages overlap
Tij = ∑s ξis ξjs, Tii = 0 the wiring · Hopfield 1982, eq [2].
the 1985 line, once G says
the pages share nothing
Vi → 1  if hi > 0the page voted ink
Vi → 0  if hi < 0the page voted paper
Vi unchanged  if hi = 0a tie — stays as it is
V = the page right now · 1 = ink, 0 = paper μ = 2V−1 = that page as ±1 — the paper's own p. 2557 form, threshold 0 → = becomes ξs = stored page s, ±1 per pixel · s, r = 1…5 then pick another pixel. that is the whole rule.
0 switches flipped the ring stopped on 0 of them
see the "valley" it rolls into — this is equation [7]
page 2554 · energy
a cartoon — the real landscape has 784,320 dimensions
try Hopfield's original 1982 storage recipe
only T changes — then scribble a page. switching resets all five pages