Starting

…

Energy · each memory is a valley · the ball is the network now
neuron onoffdamagedswitches back

Surriworks Science · 1982 → today

Hopfield networks

1982 · Caltech and Bell Labs

A physicist looks for memory

In April 1982 John Hopfield, a physicist working at Caltech and Bell Labs, published a five-page paper: Neural networks and physical systems with emergent collective computational abilities. He had left solid-state physics for biology about a decade earlier.

His question: could memory appear by itself when many simple neurons act together, the way magnetism appears when billions of tiny atomic magnets line up? He combined the on/off neuron of McCulloch and Pitts, a learning rule like Hebb’s, and the physics of magnetic “spin glasses”, and showed that it could. Unlike the perceptrons of the time, every neuron fed back to every other, and no shared clock was needed.

  • PNAS 79: 2554–2558
  • his most cited paper
  • earlier memories: Longuet-Higgins, Amari
On the right: a small Hopfield network of 81 neurons, drawn as a 9 × 9 picture. It stores three pictures, then is handed damaged copies and repairs them by itself.

The mechanism

Memories are valleys

  • Neurons: each is either on (+1) or off (−1), and each is wired to every other neuron, equally strongly both ways.
  • Storing: for each picture, strengthen the links between neurons that agree and weaken those that disagree (Hebb’s rule).
  • Recalling: pick one neuron at a time. It adds up the weighted votes of all the others and turns to whichever side wins.
  • Why it stops: every flip lowers one number, the network’s energy. So the network rolls downhill and comes to rest in a valley: the stored picture closest to where it started.
wij = ¹⁄ₙ Σμ ξiμξjμ  ·  si ← sign(Σj wijsj)  ·  E = −½ Σ wijsisj

On the right, the landscape under the picture is the network’s energy. Storing a picture carves a valley; a damaged copy starts on a slope; every neuron that switches lowers the energy, so the ball rolls down into the nearest memory.

What it does, and its limits

The whole from a fragment

A Hopfield network is a content-addressable memory: give it part of a memory, or a damaged copy, and it returns the whole. Hopfield also showed it can sort inputs into categories and keeps working when some of its neurons fail.

But memory space runs out. In 1985 Amit, Gutfreund and Sompolinsky used spin-glass physics to show that a large network holds about 0.138 random memories per neuron. Push past that and recall collapses all at once. Even below it there are false valleys: blends of memories it never learned.

  • capacity ≈ 0.138 N
  • 1,000 neurons → ~138 memories
  • spurious “mixture” states

One way out, proposed in 1986 (Nadal, Toulouse, Changeux & Dehaene; Parisi): let every link shrink a little each time something new is learned. Old memories then fade instead of jamming the network, a “palimpsest” that can keep learning forever.

On this step the network on the right is overloaded with seven pictures in 81 neurons. The valleys crowd and merge, and a damaged house settles into a blend that nobody stored.

1984–1988 · From memory to problem-solving

Solving puzzles by rolling downhill

In 1984 Hopfield showed that neurons with smooth, graded responses behave the same way, so the network could be built from ordinary analog electronics. In 1985 he and David Tank turned it around: write the cost of a problem as the network’s energy, and let it settle.

Their showcase was the travelling salesman: a grid of neurons where each row is a city and each column a place in the tour. They reported good tours for 30 cities. In 1988 Wilson and Pawley could not reliably reproduce this, and enthusiasm cooled.

The idea survives in hardware that settles into low-energy states (“Ising machines”). In a 2023 design, a memristor-based Hopfield solver with higher-order links was estimated to solve 150-variable logic puzzles 48× faster and with 72× less energy than standard Ising machines.

  • Hopfield & Tank, 1985
  • TSP: 30 cities
  • Hizzani et al., 2023

2016–2020 · The comeback

Back as attention

In 2016 Dmitry Krotov and Hopfield made the energy valleys much steeper by letting neurons interact in groups rather than pairs. This dense associative memory can store far more memories than it has neurons.

In 2020 Sepp Hochreiter’s group in Linz (Ramsauer et al., Hopfield Networks is All You Need) built a version with continuous values. It can hold exponentially many memories, usually finds the right one in a single update, and that update is mathematically the same as the attention step inside transformers, the engine of today’s language models.

  • Krotov & Hopfield, NeurIPS 2016
  • Ramsauer et al., ICLR 2021
  • update = attention
On this step the network on the right uses the modern update: it compares the damaged picture with every memory at once, and all neurons jump in one step.

Today

Where it is used, and where it worked

  • Nobel Prize in Physics 2024, shared by Hopfield and Geoffrey Hinton, whose Boltzmann machine was built on Hopfield’s network.
  • Immunology: DeepRC (NeurIPS 2020) uses modern Hopfield attention to read a person’s immune receptors, a huge bag of sequences, and outperformed other methods on simulated and real virus-infection data.
  • Drug discovery: Hopfield layers set records on two drug-design datasets (2020); MHNfs (2023) links each new molecule to a large library of known ones and leads the FS-Mol few-shot benchmark.
  • Neuroscience: the hippocampus area CA3, densely wired back onto itself, is widely modelled as a Hopfield-like memory; mice lacking NMDA receptors there struggle to recall a place from partial cues (Nakazawa et al., 2002).
  • Hardware: analog and memristor “Ising machines” for scheduling and logic problems.

The 1982 network itself is rarely used as-is in industry; its descendants are. The lasting result is the idea: memory and computation as a system rolling downhill.

Sources

  1. J. J. Hopfield (1982). Neural networks and physical systems with emergent collective computational abilities. PNAS 79(8): 2554–2558. doi:10.1073/pnas.79.8.2554
  2. J. J. Hopfield (1984). Neurons with graded response have collective computational properties like those of two-state neurons. PNAS 81: 3088–3092. PMC345226
  3. Guggenheim Foundation: John J. Hopfield (career, move from physics to biology). gf.org
  4. D. J. Amit, H. Gutfreund, H. Sompolinsky (1985). Storing infinite numbers of patterns in a spin-glass model of neural networks. Phys. Rev. Lett. 55: 1530.
  5. Overview of capacity and the projection (pseudo-inverse) rule: arXiv:2412.05501
  6. J.-P. Nadal, G. Toulouse, J.-P. Changeux, S. Dehaene (1986). Networks of formal neurons and memory palimpsests. Europhysics Letters 1: 535–542.
  7. G. Parisi (1986). A memory which forgets. J. Phys. A 19: L617. doi:10.1088/0305-4470/19/10/011
  8. J. J. Hopfield, D. W. Tank (1985). “Neural” computation of decisions in optimization problems. Biological Cybernetics 52: 141–152. doi:10.1007/BF00339943
  9. K. A. Smith (1999). Neural networks for combinatorial optimization: a review (on Wilson & Pawley 1988). PDF
  10. M. Hizzani et al. (2023). Memristor-based hardware and algorithms for higher-order Hopfield optimization solver outperforming quadratic Ising machines. arXiv:2311.01171
  11. D. Krotov, J. J. Hopfield (2016). Dense associative memory for pattern recognition. NeurIPS. arXiv:1606.01164
  12. H. Ramsauer et al. (2020). Hopfield networks is all you need. ICLR 2021. arXiv:2008.02217
  13. M. Widrich et al. (2020). Modern Hopfield networks and attention for immune repertoire classification. NeurIPS. NeurIPS
  14. J. Schimunek et al. (2023). Context-enriched molecule representations improve few-shot drug discovery (MHNfs). arXiv:2305.09481
  15. E. T. Rolls (2007). An attractor network in the hippocampus: theory and neurophysiology. Learning & Memory 14: 714–731 (with Nakazawa et al. 2002). PDF
  16. Nobel Prize in Physics 2024 announcement coverage: Research Live, Ca’ Foscari