ArticleslgStudy

computer science

Hopfield network

Hopfield network is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hopfield network rather than just read about it. In short: A Hopfield network (or associative memory) is a form of recurrent neural network, or a spin glass system, that can serve as a content-addressable memory. The Hopfield network, named for John Hopfield, consists of a single layer of neurons, where each neuron is connected to every other neuron except itself.

Hopfield network — main illustration
Hopfield network — illustration

Key takeaways

  • Hopfield network belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hopfield network to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hopfield network from memory before moving on to harder problems.

Reference excerpt

A Hopfield network (or associative memory) is a form of recurrent neural network, or a spin glass system, that can serve as a content-addressable memory. The Hopfield network, named for John Hopfield, consists of a single layer of neurons, where each neuron is connected to every other neuron except itself. These connections are bidirectional and symmetric, meaning the weight of the connection from neuron i to neuron j is the same as the weight from neuron j to neuron i. Patterns are associatively recalled by fixing certain inputs, and dynamically evolve the network to minimize an energy function, towards local energy minimum states that correspond to stored patterns. Patterns are associatively learned (or "stored") by a Hebbian learning algorithm. One of the key features of Hopfield networks is their ability to recover complete patterns from partial or noisy inputs, making them robust in the face of incomplete or corrupted data. Their connection to statistical mechanics, recurrent networks, and human cognitive psychology has led to their application in various fields, including physics, psychology, neuroscience, and machine learning theory and practice. Due to their binary-valued neurons (±1 or 0/1), limited scalability, and incompatibility with gradient-based learning, classical Hopfield networks are rarely used in modern machine learning.

History

One origin of associative memory is human cognitive psychology, specifically the associative memory. Frank Rosenblatt studied "close-loop cross-coupled perceptrons", which are 3-layered perceptron networks whose middle layer contains recurrent connections that change by a Hebbian learning rule.

Another model of associative memory is where the output does not loop back to the input. W. K. Taylor proposed such a model trained by Hebbian learning in 1956. Karl Steinbuch, who wanted to understand learning, and was inspired by watching his children learn, published the Lernmatrix in 1961. It was translated to English in 1963. Similar research was done with the correlogram of D. J. Willshaw et al. in 1969. Teuvo Kohonen trained an associative memory by gradient descent in 1974. Another origin of associative memory was statistical mechanics. The Ising model was published in 1920s as a model of magnetism, however it studied the thermal equilibrium, which does not change with time. Roy J. Glauber in 1963 studied the Ising model evolving in time, as a process towards thermal equilibrium (Glauber dynamics), adding in the component of time. The second component to be added was adaptation to stimulus. This component has been added independently by different sources, including Rosenblatt (1960), Kaoru Nakano (1971), and Shun'ichi Amari (1972). They proposed to modify the weights of an Ising model by Hebbian learning rule as a model of associative memory. The same idea was published by William A. Little in 1974, who was acknowledged by Hopfield in his 1982 paper. See Carpenter (1989) and Cowan (1990) for a technical description of some of these early works in associative memory. The Sherrington–Kirkpatrick model of spin glass, published in 1975, is the Hopfield network with random initialization. Sherrington and Kirkpatrick found that it is highly likely for the energy function of the SK model to have many local minima. In the 1982 paper, Hopfield applied this recently developed theory to study the Hopfield network with binary activation functions. In a 1984 paper he extended this to continuous activation functions. It became a standard model for the study of neural networks through statistical mechanics. A major advance in memory storage capacity was developed by Dimitry Krotov and Hopfield in 2016 through a change in network dynamics and energy function. This idea was further extended by Demircigil and collaborators in 2017. The continuous dynamics of large memory capacity models was developed in a series of papers between 2016 and 2020. Large memory storage capacity Hopfield Networks are now called Dense Associative Memories or modern Hopfield networks. In 2024, John J. Hopfield and Geoffrey E. Hinton were awarded the Nobel Prize in Physics for their foundational contributions to machine learning, such as the Hopfield network.

Structure

The units in Hopfield nets are binary threshold units, i.e. the units only take on two different values for their states, and the value is determined by whether or not the unit's input exceeds its threshold U i {\displaystyle U_{i}} . Discrete Hopfield nets describe relationships between binary (firing or not-firing) neurons 1 , 2 , … , i , j , … , N {\displaystyle 1,2,\ldots ,i,j,\ldots ,N} . At a certain time, the state of the neural net is described by a vector V {\displaystyle V} , which records which neurons are firing in a binary word of N {\displaystyle N} bits. The interactions w i j {\displaystyle w_{ij}} between neurons have units that usually take on values of 1 or −1, and this convention will be used throughout this article. However, other literature might use units that take values of 0 and 1. These interactions are "learned" via Hebb's law of association, such that, for a certain state V s {\displaystyle V^{s}} and distinct nodes i , j {\displaystyle i,j}

w i j = V i s V j s {\displaystyle w_{ij}=V_{i}^{s}V_{j}^{s}}

… excerpt ends here. Continue reading the full article.

Illustrations

Hopfield network: A Hopfield net with four units
A Hopfield net with four units
Hopfield network: Energy Landscape of a Hopfield Network, highlighting the current state of the network (up the hill), an attractor state to which it will eventually converge, a minimum energy level and a basin of attraction shaded in green. Note how the update of the Hopfield Network is always going down in Energy.
Energy Landscape of a Hopfield Network, highlighting the current state of the network (up the hill), an attractor state to which it will eventually converge, a minimum energy level and a basin of attraction shaded in green. Note how the update of the Hopfield Network is always going down in Energy.
Hopfield network illustration
Hopfield network illustration
Hopfield network: Fig. 1: An example of a continuous modern Hopfield network with 
  
    
      
        
          N
          
            f
          
        
        =
        5
      
    
    {\textstyle N_{f}=5}
  
  feature neurons and 
  
    
      
        
          N
          
            mem
          
        
        =
        11
      
    
    {\displaystyle N_{\text{mem}}=11}
  
 memory (hidden) neurons with symmetric synaptic connections between them.
Fig. 1: An example of a continuous modern Hopfield network with N f = 5 {\textstyle N_{f}=5} feature neurons and N mem = 11 {\displaystyle N_{\text{mem}}=11} memory (hidden) neurons with symmetric synaptic connections between them.

Worked examples

Example 1 — a first encounter with Hopfield network

Start with the simplest possible case. Write down what Hopfield network claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hopfield network before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hopfield network ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hopfield network

In research
Hopfield network appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hopfield network in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hopfield network is common in secondary-school and first-year university syllabi. It links to neighbouring topics Neural network architectures, so understanding it makes those chapters shorter.
In everyday life
Look for Hopfield network outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hopfield network” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Hopfield network in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hopfield network means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hopfield network out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hopfield network in simple terms?

A Hopfield network (or associative memory) is a form of recurrent neural network, or a spin glass system, that can serve as a content-addressable memory. The Hopfield network, named for John Hopfield, consists of a single layer of neurons, where each neuron is connected to every other neuron except…

Why does Hopfield network matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hopfield network?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hopfield network.

Tags

  • Neural network architectures

Keep exploring