ArticleslgStudy

computer science

Modern Hopfield network

Modern 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 Modern Hopfield network rather than just read about it. In short: Modern Hopfield networks (also known as Dense Associative Memories) are generalizations of the classical Hopfield networks that break the linear scaling relationship between the number of input features and the number of stored memories. This is achieved by introducing stronger non-linearities (either in the energy function or neurons’ activation functions) leading to super-linear (even an exponential) memory storag…

Modern Hopfield network — main illustration
Modern Hopfield network — illustration

Key takeaways

  • Modern 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 Modern Hopfield network to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Modern Hopfield network from memory before moving on to harder problems.

Reference excerpt

Modern Hopfield networks (also known as Dense Associative Memories) are generalizations of the classical Hopfield networks that break the linear scaling relationship between the number of input features and the number of stored memories. This is achieved by introducing stronger non-linearities (either in the energy function or neurons’ activation functions) leading to super-linear (even an exponential) memory storage capacity as a function of the number of feature neurons. The network still requires a sufficient number of hidden neurons. The key theoretical idea behind the modern Hopfield networks is to use an energy function and an update rule that is more sharply peaked around the stored memories in the space of neuron’s configurations compared to the classical Hopfield network.

Classical Hopfield networks Hopfield networks are recurrent neural networks with dynamical trajectories converging to fixed point attractor states and described by an energy function. The state of each model neuron i {\textstyle i} is defined by a time-dependent variable V i {\displaystyle V_{i}} , which can be chosen to be either discrete or continuous. A complete model describes the mathematics of how the future state of activity of each neuron depends on the known present or previous activity of all the neurons. In the original Hopfield model of associative memory, the variables were binary, and the dynamics were described by a one-at-a-time update of the state of the neurons. An energy function quadratic in the V i {\displaystyle V_{i}} was defined, and the dynamics consisted of changing the activity of each single neuron i {\displaystyle i} only if doing so would lower the total energy of the system. This same idea was extended to the case of V i {\displaystyle V_{i}} being a continuous variable representing the output of neuron i {\displaystyle i} , and V i {\displaystyle V_{i}} being a monotonic function of an input current. The dynamics became expressed as a set of first-order differential equations for which the "energy" of the system always decreased. The energy in the continuous case has one term which is quadratic in the V i {\displaystyle V_{i}} (as in the binary model), and a second term which depends on the gain function (neuron's activation function). While having many desirable properties of associative memory, both of these classical systems suffer from a small memory storage capacity, which scales linearly with the number of input features.

… excerpt ends here. Continue reading the full article.

Illustrations

Modern Hopfield network: Fig.2  Effective theory on the feature neurons for various common choices of the Lagrangian functions. Model A reduces to the models studied in[3][4] depending on the choice of the activation function, model B reduces to the model studied in,[1] model C reduces to the model of.[5]
Fig.2 Effective theory on the feature neurons for various common choices of the Lagrangian functions. Model A reduces to the models studied in[3][4] depending on the choice of the activation function, model B reduces to the model studied in,[1] model C reduces to the model of.[5]
Modern Hopfield network: Fig.3  The connectivity diagram of the fully-connected modern Hopfield network consisting of five neurons. The synaptic weights are described by a symmetric matrix 
  
    
      
        
          W
          
            I
            J
          
        
      
    
    {\displaystyle W_{IJ}}
  
.
Fig.3 The connectivity diagram of the fully-connected modern Hopfield network consisting of five neurons. The synaptic weights are described by a symmetric matrix W I J {\displaystyle W_{IJ}} .
Modern Hopfield network: Fig.4  The connectivity diagram of the layered Hierarchical Associative Memory network.[8] Each layer can have different number of neurons, different activation function, and different time scales. The feedforward weights and feedback weights are equal.
Fig.4 The connectivity diagram of the layered Hierarchical Associative Memory network.[8] Each layer can have different number of neurons, different activation function, and different time scales. The feedforward weights and feedback weights are equal.

Worked examples

Example 1 — a first encounter with Modern Hopfield network

Start with the simplest possible case. Write down what Modern 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 Modern 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 Modern 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 Modern Hopfield network

In research
Modern 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 Modern 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
Modern Hopfield network is common in secondary-school and first-year university syllabi. It links to neighbouring topics Artificial neural networks, so understanding it makes those chapters shorter.
In everyday life
Look for Modern 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 “Modern Hopfield network” →

Affiliate

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

How to study Modern Hopfield network in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Modern 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 Modern Hopfield network out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Modern Hopfield network in simple terms?

Modern Hopfield networks (also known as Dense Associative Memories) are generalizations of the classical Hopfield networks that break the linear scaling relationship between the number of input features and the number of stored memories. This is achieved by introducing stronger non-linearities (eit…

Why does Modern 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 Modern 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 Modern Hopfield network.

Tags

  • Artificial neural networks

Keep exploring