CMU Introduction To Deep Learning 11-785, Fall 2026: Lecture 26
Overview
Hopfield networks turn a recurrent neural network with symmetric weights and binary activations into an energy-minimizing system: sequential neuron updates descend an energy landscape until reaching stable patterns. The lecture connects John Hopfield’s model to the Ising model and content-addressable memory, then covers Hebbian storage, the roughly 0.14N classical capacity for random patterns, spurious attractors, and a training strategy that raises energy around target memories.
Key takeaways
- With symmetric weights, binary states, and sequential updates, a Hopfield network descends a bounded energy function and reaches a stable configuration in finitely many updates.
- A Hopfield network is a content-addressable memory: a noisy or partial pattern can cue recall by moving the state toward a stored energy minimum.
- Hebbian learning can store one pattern as a stable minimum, but storing many random patterns with the classical rule gives a capacity of about 0.14N and can create spurious attractors.
- A symmetric N-dimensional weight matrix can be designed to stabilize up to N selected patterns through its eigenstructure, while substantially larger numbers of stable states may include unwanted memories.
- A training objective can combine Hebbian target outer products with anti-Hebbian contributions from nearby non-target states, sampled by running short network rollouts from each target.
Chapters
- The opening minutes include projector, laptop, and clicker setup before the lecture begins.
- The final two class topics are Hopfield networks and auto-associative memory, followed by Boltzmann machines.
- John Hopfield and Geoffrey Hinton received the 2024 Nobel Prize in Physics for foundational work connected to neural networks.
- Unlike feed-forward networks, a recurrent network feeds outputs back as inputs; unrolling its repeated updates gives an infinitely deep network with shared weights.
- A Hopfield network connects each neuron to the others with symmetric weights, so the weight from neuron i to j equals the weight from j to i.
- Each neuron has a binary state of +1 or -1, determined by a threshold applied to its weighted input field.
- A neuron flips when its current sign disagrees with the sign of its weighted input field.
- A flip changes the fields at other neurons, which can trigger further updates and produce a sequence of changing network states.
- The lecture tracks a bounded scalar based on neuron states and local fields; each flip increases it by a positive amount.
- Because the quantity has a finite maximum and each change is bounded away from zero under the stated assumptions, the number of flips is finite.
- The flip-based convergence argument is recast as descent in a network energy, with each update lowering that energy.
- The energy is bounded below, so the network reaches a stable state rather than evolving indefinitely.
- In the Ising model, magnetic dipoles take states of +1 or -1 and tend to align with the field produced by other dipoles and any external field.
- The system’s Hamiltonian sums pairwise interactions and external-field contributions, with a factor of -1/2 to account for symmetric pair counting.
- Hopfield neurons play the role of dipoles, and network weights and biases represent their interactions and external fields.
- Each neuron configuration has an energy; updates move the network downhill until it reaches a local minimum.
- A stable minimum functions as a stored memory: initializing the network with a noisy or incomplete pattern can recover the corresponding configuration.
- This is content-addressable recall, unlike ordinary computer memory, which retrieves data using an explicit address.
- Recall repeatedly applies the update y = sign(Wy + b), where y is the neuron-state vector and W is the weight matrix.
- The process continues until the state and energy stop changing, ideally recovering a stored pattern from a degraded initialization.
- Although the Hopfield energy is quadratic in y, each component is restricted to +1 or -1 rather than any real value.
- The valid configurations are the 2^N corners of an N-dimensional hypercube, making the discrete landscape difficult to characterize by ordinary differentiation.
- Local minima at unintended corners create spurious memories.
- A stationary pattern satisfies sign(Wy + b) = y, so a network update leaves it unchanged.
- A stable pattern returns to the same state after a small perturbation, such as flipping one bit.
- The goal is to set weights so intended patterns are stable minima without introducing unwanted attractors.
- For one target pattern, Hebbian learning sets pairwise weights from products of the corresponding neuron values, following “neurons that fire together wire together.”
- The target becomes stationary because its weighted input has the same sign as each target bit.
- The lecture shows that the pattern reaches the lowest possible energy for this construction, making it stable.
- For multiple patterns, the classical Hopfield rule averages the outer products of the stored patterns into one weight matrix.
- For N neurons and random patterns, the lecture gives a practical capacity of about 0.14N patterns with low recall error.
- Adding more patterns can produce parasitic attractors, including unintended combinations of stored patterns.
- A pattern is stationary when applying W and then the sign function returns the same binary corner; eigenvectors with suitable eigenvalues provide one way to construct such patterns.
- A symmetric N-by-N matrix has at most N orthogonal eigenvectors, supporting a reliable construction for up to N selected patterns.
- The hypercube has 2^N possible corners, and many can become stationary or stable, but storing more than order N patterns risks numerous spurious memories.
- The proposed objective minimizes energy for target patterns while increasing energy for non-target patterns, rather than minimizing all configurations indiscriminately.
- The weight gradient has an outer-product form: Hebbian contributions for targets and anti-Hebbian contributions for patterns to repel.
- Because enumerating all 2^N non-target states is impractical, the lecture proposes sampling unwanted states from the local neighborhoods of target memories.
- To find nearby unwanted states, initialize the network at a target pattern and let it evolve for only a few steps.
- Raising the energy of these sampled neighbors can limit the width of the target’s attraction basin; more rollout steps correspond to a broader neighborhood.
- This sampling approach trades computation against how much of the surrounding energy landscape is shaped.
- The lecture closes by emphasizing that practical reliable capacity is on the order of N patterns, while larger theoretical counts come with parasitic memories.
- The next class will address how to store more patterns than the size of an individual memory.
Transcript excerpt
0:07 I have a situation. Do you have your laptop? >> This thing is not projecting anymore. >> Mhm. >> So, let me just drop this in Slack. I have nothing to do. >> You pull it up >> because this is [snorts] this should work because it's defaulting to this guy. Yeah, it's it's when I when I
1:01 stick it in when I put it here, it's [snorts] nothing. Shut up, right? >> Okay. Let's uh let me just drop this drop this in slack. Sorry guys,
1:49 I have a minute but Thanks. You get it? >> Okay. >> Yeah. Yeah. One sec. Yeah, there it is. Let me just put this here. I'll have it here for my reference.
2:36 But something the heck has happened to my laptop. Can we also put this clicker in somewhere? Regular USB. >> Put in the adapter. >> Yeah. Okay. Check if it works. might want to get a new battery for this. I >> have two lectures to go. So, perfect. >> Just made it on time. >> Morning everybody. I hope you had a nice Thanksgiving break. >> Morning. All right, the last two classes. Uh, the usual stuff. Shut your laptop. Why is this SL screen showing? Okay,
3:27 sometimes you know the H. >> Yeah, I mean the last two classes have to be a bit more dramatic. So, you got to see me twice and my slides twice. Anyway, uh we're going to the last topic of this series is going to be Hopfield networks and uh Bsman mach auto associators and Bolsman machines. Today we'll talk about Hopfield nets and auto associators. And on Wednesday, we're going to speak about Bsman machines. Now, why is this topic interesting? you're unlikely to encounter hopfield nets and bullsman machines in your
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Carnegie Mellon University Deep Learning.