A Hopfield network is a recurrent neural network in which every unit is connected to every other unit and whose dynamics drag it, step by step, toward stable states. Those states are its memories. John Hopfield introduced it in 1982 as a physical model of "content-addressable" memory: a system that retrieves a whole memory from a large enough part of it (Hopfield, 1982).
How it works
Each unit is binary, like the McCulloch–Pitts neuron (Hopfield used 0 and 1; today it is usually written ±1). At random moments a unit adds up its incoming signals, hᵢ = Σⱼ wᵢⱼ sⱼ, and switches on if the sum exceeds the threshold. Updates are asynchronous, with no global clock (Hopfield, 1982, p. 2555).
To store a set of patterns, the weights are set in one go: wᵢⱼ adds up, over all patterns, the product of the values of units i and j, with wᵢᵢ = 0 (1982, p. 2555). This is Hebb's idea that neurons that fire together strengthen their connection (Hebb, 1949; Buckner, 2024, p. 183). There is no gradient descent and no backpropagation: learning is adding up correlations.
The decisive point is that, if the weights are symmetric (wᵢⱼ = wⱼᵢ), the quantity E = −½ Σᵢⱼ wᵢⱼ sᵢ sⱼ never increases with an update. The network must come to rest in a local minimum of this "energy," and Hopfield noted that the system is isomorphic to an Ising model, the physics of magnets, with the weights playing the role of the coupling between spins (1982, p. 2556). Stored patterns are valleys in the energy landscape (attractors): if the network starts near one, it falls into it. The paper's example is a bibliographic reference, "H. A. Kramers & G. H. Wannier Phys. Rev. 60, 252 (1941)," which should be retrievable from "& Wannier, (1941)" or even from "Vannier, (1941)" (1982, p. 2554).
Capacity is modest: about 0.15 N patterns for N units before recall becomes badly flawed (1982, p. 2556); later analysis with the physics of spin glasses put it at ≈ 0.138 N (Ramsauer et al., 2021, sec. 1). If one keeps loading the network, it does not forget gradually: all memories become irretrievable (Hopfield, 1982, p. 2557).
What changed
The unit is almost the 1943 one; what is new is the wiring. Hopfield set his model apart from the Perceptron, with its forward-only connections and synchronized neurons: "all our interesting results arise as consequences of the strong back-coupling" (1982, p. 2555). Computation stops being a sequence of instructions and becomes the relaxation of a physical system, a collective or emergent property. With David Tank, Hopfield used an analog version of the network to find good solutions to the traveling-salesman problem (Hopfield & Tank, 1985).
Its stochastic relative is the Boltzmann machine of Ackley, Hinton and Sejnowski: units change state with a probability that depends on a temperature, hidden units are added, and the goal is no longer to store individual patterns but to learn the distribution of the data, as a generative model (Ackley et al., 1985; Witten et al., 2017, pp. 449–450). In 2024 Hopfield and Hinton received the Nobel Prize in Physics "for foundational discoveries and inventions that enable machine learning with artificial neural networks" (The Royal Swedish Academy of Sciences, 2024b).
Modern form: memory and attention
Ramsauer et al. (2021) proposed a Hopfield network with continuous states and an exponential energy, which stores a number of patterns exponential in the dimension and usually retrieves them in a single step. Its update rule, ξ′ = X softmax(β Xᵀ ξ), is the attention of the Transformer with β = 1/√dₖ: the partial cue acts as the query and the stored patterns as keys and values (2021, sec. 2). The equivalence is formal and should not be overstated: in a transformer the "memories" are the other tokens in the context, and each layer takes a single retrieval step (see queries, keys and values).
Limits
Besides capacity, the network has spurious minima that nobody stored (Ramsauer et al., 2021, sec. 1), and memories that are too similar get confused and tend to merge (Hopfield, 1982, p. 2557). As a practical memory it has been superseded; as a model of how a network can remember without addresses, it is still current.