Hopfield network
A Hopfield network is a recurrent neural network that stores patterns as memories and recovers the closest one from a partial or noisy input, introduced by John Hopfield in 1982.
A Hopfield network is an associative memory, sometimes called a content-addressable memory. Show it part of a stored pattern, or a corrupted version, and it settles on the complete stored pattern that is most similar. It is a single layer of units, each connected to every other with symmetric weights. John Hopfield described it in a 1982 paper in the Proceedings of the National Academy of Sciences, Neural networks and physical systems with emergent collective computational abilities.
Hopfield, a physicist, borrowed from the physics of magnetic materials, in which each atom's spin makes it a tiny magnet that influences its neighbours. Each state of the network has an energy calculated from all the unit values and connection strengths. Storing a pattern means setting the connections so that pattern has low energy; a simple rule gives units that agree in a pattern a positive connection and units that disagree a negative one. To recall, the network checks its units one at a time and flips any whose change would lower the energy, until nothing improves. Hopfield likened this to a ball rolling into the nearest valley.
The original was tiny. Hopfield's 1982 network had 30 units and 435 connections, fewer than 500 parameters in all; he tried 100 units, but that was too much for his computer. Capacity is limited too. With the standard learning rule, a network can reliably recall only about 138 patterns per 1,000 units, and it can also fall into spurious memories that blend stored patterns. Similar ideas had appeared earlier in work by Amari in 1972 and Little in 1974, and Hopfield acknowledged Little's model.
The network's influence ran through Geoffrey Hinton and Terrence Sejnowski, who built the Boltzmann machine on it. On October 8, 2024 Hopfield and Hinton shared the Nobel Prize in Physics for foundational discoveries and inventions that enable machine learning with artificial neural networks.
The idea has had a second life. In 2016 Krotov and Hopfield introduced dense associative memories that break the old capacity limit. In 2020 Hubert Ramsauer, Sepp Hochreiter and colleagues published Hopfield Networks is All You Need, showing that a modern Hopfield network with continuous states can store exponentially many patterns and that its update rule is equivalent to the attention mechanism in transformers. Today's language models are not Hopfield networks, but that link is why researchers still study them to understand how attention retrieves information.
It works as an associative memory: given a partial or noisy pattern, it recovers the closest stored one, such as restoring a damaged image. Classic Hopfield networks are mostly teaching and research tools today, while modern versions are studied as memory and attention layers in deep learning. A classic Hopfield network with the standard learning rule can reliably store only about 0.14 patterns per unit, roughly 138 per 1,000 units. Modern Hopfield networks with different energy functions can store exponentially many patterns. A 2020 paper, Hopfield Networks is All You Need, showed that the update rule of a modern Hopfield network with continuous states is equivalent to the attention mechanism used in transformers. That lets researchers describe what attention does in terms of storing and retrieving patterns. Hopfield built it with tools from physics, describing the network's state as energy in the way physicists describe magnetic spin systems. The 2024 prize, shared with Geoffrey Hinton, recognised that work as a foundation of machine learning with neural networks.Common questions
What is a Hopfield network used for?
How many patterns can a Hopfield network store?
How are Hopfield networks related to transformers?
Why did the Hopfield network win a Nobel Prize in Physics?
Search for "Hopfield network", "associative memory neural network" or "modern Hopfield networks attention" to go further. The Nobel Prize site's background documents explain the physics plainly, and the 2020 paper on arXiv covers the link to transformers. University course notes on neural networks give worked examples of storage and recall.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.