Modern Methods in Associative Memory: Modern Methods in Associative Memory

Dmitry Krotov (Research Staff · MIT IBM Watson AI Lab), Benjamin Hoover, Parikshit Ram

International Conference on Machine Learning 2025 · Tutorial

Overview

This article delves into the "Modern Methods in Associative Memory" tutorial presented at ICML 2025 by Dmitry Krotov, Benjamin Hoover, and Parikshit Ram. The talk addresses a critical challenge facing contemporary AI models: enhancing their factuality and reliability by improving their ability to remember and retrieve information. The speakers propose a return to brain-inspired computational paradigms, specifically associative memories, as a potential solution. The core of their presentation revolves around dense associative memories, a significant advancement over classical Hopfield networks, which were co-developed by Krotov and the legendary John Hopfield.

Watch on SlidesLive

Visual summary for Modern Methods in Associative Memory: Modern Methods in Associative Memory by Dmitry Krotov, Benjamin Hoover, Parikshit Ram
Visual summary for Modern Methods in Associative Memory: Modern Methods in Associative Memory by Dmitry Krotov, Benjamin Hoover, Parikshit Ram

Key moments

  1. 0:00 Introduction: AI limitations and human brain inspiration
  2. 2:00 Meet the speakers and their tutorial topics
  3. 4:00 Tutorial resources: lecture notes, notebooks, and website
  4. 5:00 Defining associative memory with real-world examples
  5. 8:00 Exploring energy-based associative memories and energy landscapes
  6. 10:00 Energy landscape minima and use cases: pattern completion

Modern Methods in Associative Memory

Speakers: Dmitry Krotov, Research Staff, MIT IBM Watson AI Lab; Benjamin Hoover, PhD Student, Georgia Tech & AI Research Engineer, IBM; Parikshit Ram, Principal Research Staff, IBM Research

Conference: ICML 2025

YouTube: https://slideslive.com/39043831

Overview

This article delves into the "Modern Methods in Associative Memory" tutorial presented at ICML 2025 by Dmitry Krotov, Benjamin Hoover, and Parikshit Ram. The talk addresses a critical challenge facing contemporary AI models: enhancing their factuality and reliability by improving their ability to remember and retrieve information. The speakers propose a return to brain-inspired computational paradigms, specifically associative memories, as a potential solution. The core of their presentation revolves around dense associative memories, a significant advancement over classical Hopfield networks, which were co-developed by Krotov and the legendary John Hopfield.

The tutorial, led by Dmitry Krotov, a physicist whose work bridges physics, neuroscience, and AI, lays the theoretical and practical groundwork for understanding and implementing these sophisticated memory systems. Benjamin Hoover, an expert in making AI more understandable, promises a hands-on session, while Parikshit Ram, with deep expertise in machine learning, will connect these concepts to classical ML algorithms. This article focuses primarily on Dmitry Krotov's foundational segment, which introduces the concepts, limitations of prior work, and the breakthrough of dense associative memories.

The talk highlights that while modern AI models exhibit "magic-like" power, they often struggle with fundamental limitations related to memory and factual recall. Associative memories, defined as content-addressable information storage systems capable of error correction, offer a compelling alternative. The key innovation presented is the ability of dense associative memories to overcome the severe storage capacity constraints of classical Hopfield networks, thereby making brain-inspired models more relevant and scalable for building powerful and reliable AI systems.

Background

▶ Watch: Introduction: AI limitations and human brain inspiration (0:00)

The current landscape of artificial intelligence, despite its rapid advancements and powerful models, faces persistent challenges in areas like factuality and reliability. This problem often stems from how these models process and retain information. To address this, researchers are revisiting fundamental computational models inspired by the human brain, which excels at memory and association. Central to this exploration are associative memories, systems designed to store and retrieve information based on content rather than explicit addresses, inherently providing a form of error correction. For example, recognizing a "stop sign" from its red octagonal shape or recalling a movie from a few emojis demonstrates the brain's associative power. Similarly, the brain's ability to decipher jumbled text highlights its robust error correction mechanisms.

Within the class of associative memories, energy-based associative memories are particularly significant. These models are conceptualized as recurrent neural networks where the network's state evolves over time, traversing a sophisticated energy landscape. When a query is posed, the network is initialized in a high-energy state. It then computes by "rolling down the hill" of this landscape until it reaches a local minimum, which represents a stored memory. This process, known as memory recall, allows for tasks like pattern completion (reconstructing a full image from a partial one) and denoising (cleaning a corrupted image). The association occurs between the initial, incomplete, or noisy input and the final, recalled memory.

The foundational model in this domain is the Hopfield network, introduced by John Hopfield. These networks operate on vectors of binary variables, typically represented as +1 or -1, akin to firing or silent neurons. The energy function of a classical Hopfield network is defined by the dot product between the network's state vector and a set of memory vectors, squared and summed. While elegant, classical Hopfield networks suffer from a critical limitation: their memory storage capacity. A well-known scaling law states that the maximum number of memories (K) that can be reliably stored and retrieved in a Hopfield network scales linearly with the number of neurons (D), specifically K_max ≈ 0.14D. This means a network with 1,000 neurons can only store around 140 memories, a tiny amount of information for meaningful AI applications. This severe constraint effectively "kills" the utility of classical Hopfield networks for building large-scale, practical AI models, necessitating a fundamental rethinking of how associative memories are designed.

Key Findings

▶ Watch: Tutorial resources: lecture notes, notebooks, and website (4:00)

The central discovery and contribution highlighted in this talk is the development and analysis of dense associative memories, which dramatically overcome the crippling storage capacity limitations of classical Hopfield networks. Dmitry Krotov demonstrated that by introducing higher-order non-linearities into the energy function, the memory storage capacity can be increased from a linear scaling (K_max ≈ 0.14D) to a polynomial scaling of D^(n-1), where D is the number of neurons and 'n' is the order of interaction in the network's energy function. This represents a monumental leap, allowing for the storage of vast amounts of information.

Specifically, the talk showcased that for a network with a power-law interaction of order n=3, the capacity scales quadratically with D (D^2). For n=6, the capacity scales as D^5, enabling the network to store "pretty much as much as you want" – effectively an "entire universe of Pokemons" – without breaking down. This exponential increase in capacity is attributed to the ability to densely pack more local minima (memories) into the configuration space.

Crucially, despite this dense packing, each stored memory retains a substantial basin of attraction. This means the network's powerful error correction capabilities are preserved. Even when starting from a highly corrupted or incomplete input, the network can still reliably converge to the correct stored memory. The shape of the separation function (F), which modifies the influence of overlaps between the network state and individual memories, and its derivative, the activation function (f), are identified as critical factors in determining both the memory storage capacity and the structure of the energy landscape. Sharper activation functions generally lead to higher memory capacity.

The general framework for binary dense associative memories further formalizes these findings, delineating three key functional components: a similarity function (S), a separation function (F), and a monotone function (Q). This modularity allows for flexible design choices that can be tailored to specific applications, enabling diverse forms of associative recall and information processing. The ability to store generic, trainable memories, rather than requiring meticulously engineered ones, is also a key finding, opening the door for integrating these models with modern machine learning paradigms like backprop and contrastive learning.

Technical Deep Dive

▶ Watch: Defining associative memory with real-world examples (5:00)

The technical foundation of this work rests on a generalization of the Hopfield network architecture. In classical Hopfield networks, the network state is represented by a D-dimensional vector sigma, where each element sigma_i is a binary variable (either +1 or -1). The network stores K memories, denoted by vectors xi_mu (where mu runs from 1 to K). The energy function for such a network is typically written as:

E = - Σ_{i,j} T_{ij} sigma_i sigma_j

The connection weights T_{ij} are computed from the memory vectors using the outer product rule: T_{ij} = Σ_mu xi_mu_i xi_mu_j. This energy function can be rewritten in a more insightful form: E = - Σ_mu (sigma · xi_mu)^2, which emphasizes the overlap between the current state and each memory. The dynamics of the network involve iteratively updating each neuron sigma_i to minimize this energy, typically following an update rule like sigma_i(t+1) = sign(Σ_{j!=i} T_{ij} sigma_j(t)). As discussed, this elegant model is severely limited by a memory storage capacity of K_max ≈ 0.14D.

Dense associative memories address this limitation by introducing higher-order interactions. Instead of products of two sigmas, the energy function incorporates products of 'n' sigmas. The generalized energy function takes the form:

E = - Σ_mu F(sigma · xi_mu)

Here, F is the separation function, which modulates the contribution of the overlap between the current state and each memory. For the specific case discussed, F(x) = x^n, where 'n' is an integer parameter greater than or equal to 2. This implies the underlying tensor T is now of rank 'n', contracting a product of 'n' binary variables. The connection tensor T in this generalized case would be T_{i1...in} = Σ_mu xi_mu_i1 ... xi_mu_in.

The network's dynamics are governed by an update rule for each neuron sigma_i:

sigma_i(t+1) = sign( Σ_mu xi_mu_i * f'(sigma · xi_mu) )

where f' is the derivative of the separation function F, acting as the activation function. For F(x) = x^n, f'(x) = n*x^(n-1).

The derivation of the new scaling law for memory capacity is a critical technical contribution. It involves analyzing the stability of a stored memory. If the network is initialized in a specific memory (say, xi_1), the update rule can be decomposed into two main components:

  1. Signal term: This comes from the overlap with the target memory xi_1 itself.
  2. Noise term: This arises from the overlaps with all other K-1 memories (mu from 2 to K).

Assuming random memory vectors (where each element xi_mu_i is +1 or -1 with 50% probability), the noise term, being a sum of many independent random variables, can be approximated as a Gaussian random variable due to the Central Limit Theorem. The mean of this Gaussian is 0, and its variance is proportional to K (the number of memories). A memory is considered stable if the signal term is strong enough to resist the noise, preventing spin flips. The probability of a spin flip error is calculated by integrating the tail of this Gaussian distribution, starting from the magnitude of the signal term.

By setting a threshold for acceptable error probability (e.g., less than one percent), the condition for stable memory retrieval can be translated into a relationship between the signal magnitude and the noise variance. This analysis reveals the fundamental scaling law for dense associative memories: K_max scales as D^(n-1).

  • For n=2 (classical Hopfield), K_max ~ D^(2-1) = D, recovering the linear scaling.
  • For n=3, K_max ~ D^(3-1) = D^2, yielding quadratic capacity.
  • For n=6, K_max ~ D^(6-1) = D^5, demonstrating a highly rapid growth in capacity.

This dramatic increase in capacity is achieved by making the activation function f' sharper, which effectively "carves out" deeper and more numerous local minima in the energy landscape, allowing for a denser packing of memories while maintaining large basins of attraction for robust error correction.

The talk generalizes this further by defining a comprehensive energy function for binary dense associative memories: E = -Q(Σ_mu F(S(sigma, xi_mu))). This framework introduces:

  • Similarity function (S): Measures the resemblance between the network state and a memory (e.g., dot product, negative Euclidean distance).
  • Separation function (F): The core non-linearity (e.g., power law x^n, exponential, softmax, L-p norms). Its shape is critical for capacity.
  • Monotone function (Q): A scalar function, typically identity or logarithm, applied globally.

This modular design offers significant flexibility for future research and application development.

Experimental Setup & Results

▶ Watch: Exploring energy-based associative memories and energy landscapes (8:00)

The experimental validation of dense associative memories focused on demonstrating their superior storage capacity compared to classical Hopfield networks, particularly when dealing with "real-world" (albeit simplified) data.

Dataset: The experiments utilized a dataset of Pokemon images. Specifically, the examples shown included images of Eevee and Pichu, and later, a set of 100 distinct Pokemon images. The speaker noted that these Pokemon images are "heavily correlated," unlike the perfectly random memory vectors assumed in the theoretical derivation, which might lead to a slightly lower effective capacity than the theoretical bounds.

Baselines and Models:

  1. Classical Hopfield Network (n=2): This served as the baseline, representing the conventional approach with a linear scaling capacity.
  2. Dense Associative Memory (n=6): This model incorporated a higher-order interaction (n=6) in its energy function, theoretically providing a capacity scaling as D^5.

Metrics: The primary metric for success was the network's ability to perform pattern completion and denoising by converging to the correct stored memory from an incomplete or noisy initial state. The dynamics of the energy function over time were visualized, showing a decrease in energy until it plateaued, indicating convergence to a fixed point (a memory).

Headline Numbers and Results:

  • Classical Hopfield Network (n=2) with 2 memories: The network was successfully encoded with two Pokemon images, Eevee and Pichu. When initialized with a partial image of Eevee (a "seed"), the network's energy decreased, plateaued, and beautifully reconstructed the full image of Eevee. This demonstrated the network's basic functionality for a small number of memories.
  • Classical Hopfield Network (n=2) with 6 memories: The same network was then loaded with six Pokemon images. When initialized with the same partial Eevee seed, the network initially showed some activity, but then rapidly became "confused." Instead of recalling Eevee or any of the other five stored memories, it converged to "something completely bizarre that does not have any correlation or any significant correlation with any of the six memories." This dramatic failure explicitly demonstrated the severe capacity limitation of classical Hopfield networks (K_max ≈ 0.14D), which was even more pronounced due to the correlated nature of the Pokemon data.
  • Dense Associative Memory (n=6) with 6 memories: While not explicitly shown in a video, the speaker stated that this model "works beautifully for six Pokemons," highlighting its immediate superiority over the classical Hopfield network.
  • Dense Associative Memory (n=6) with 100 memories: In a more ambitious demonstration, 100 distinct Pokemon images were encoded into the dense associative memory. Starting with the same Eevee seed, the network ran its dynamics, and successfully reconstructed the full image of Eevee, despite the presence of 99 other stored memories. The speaker confidently asserted that this model is "so capable of storing this information that you can write pretty much as much as you want inside this neural network," and could "easily store the entire universe of all Pokemons."

Ablations: The comparison between the n=2 and n=6 networks with increasing numbers of memories directly serves as an ablation study. It clearly illustrates how increasing the order of interaction 'n' and thus the sharpness of the activation function, leads to a polynomial increase in memory storage capacity, validating the theoretical scaling law D^(n-1). The experiments effectively translate the abstract mathematical derivations into concrete, observable improvements in a practical pattern recognition task.

Practical Implications

▶ Watch: Energy landscape minima and use cases: pattern completion (10:00)

The advancements in dense associative memories carry profound practical implications for the development and deployment of future AI systems, influencing practitioners, infrastructure teams, and model builders alike.

For Practitioners: The most significant implication is the ability to overcome the severe memory bottleneck of classical Hopfield networks. This means practitioners can now build neural networks that can store and retrieve a vastly larger number of patterns or pieces of information. This could lead to more factual and reliable AI models that can draw upon a much richer internal knowledge base, reducing instances of hallucination or factual errors seen in current large language models. The robust error correction capabilities, maintained even with dense memory packing, mean these systems can function effectively with noisy or incomplete inputs, which is a common characteristic of real-world data.

For Infrastructure Teams: The technical deep dive revealed that dense associative memories, especially with high orders of interaction 'n', involve complex, high-rank tensors (T). If these tensors were stored explicitly, they would be "exponentially large" and quickly exhaust computer memory. However, the speaker clarified that the tensor T does not necessarily need to be stored explicitly; instead, only the original memory vectors (xi's) are required, from which the necessary computations can be derived. Furthermore, future sections of the tutorial by Parikshit Ram are expected to discuss distributed representations and compression techniques, which could enable more efficient storage of these memories, potentially even allowing explicit storage of compressed tensors. This suggests that while there are computational challenges, clever software and algorithmic approaches can mitigate the memory footprint, potentially paving the way for specialized hardware accelerators if these models gain widespread adoption.

For Model Builders: A crucial advantage of this framework is its compatibility with modern machine learning training paradigms. The speaker emphasized that these networks can be trained using techniques like backprop and contrastive learning, where the memory vectors themselves become trainable parameters. This means memories do not need to be meticulously hand-engineered or pre-selected for non-interference; they can be generic and adapt during training. This flexibility allows model builders to integrate dense associative memories into larger, end-to-end learning systems, enabling them to learn complex associative patterns from data rather than relying on brittle, fixed representations.

Tradeoffs and Limitations:

  • Computational Cost: While the memory capacity increases dramatically with 'n', the computational complexity of the update rule also increases, as it involves higher-order tensor contractions. This dynamic computation, while an advantage for exploring the energy landscape, adds steps compared to a simple nearest-neighbor search.
  • Generalizability of Capacity Bounds: The theoretical capacity bounds are derived assuming random, uncorrelated memories. As demonstrated with the "heavily correlated" Pokemon images, real-world data might yield a slightly lower practical capacity than the theoretical maximum.
  • Balance of Capacity and Error Correction: While dense associative memories offer huge capacity, there's an implicit tradeoff. Pushing 'n' too high or storing too many memories could, in principle, shrink the basin of attraction around each memory, compromising error correction capabilities. The goal is to achieve both high capacity and robust error correction, which the current approach seems to manage.
  • Engineered vs. Generic Memories: The talk explicitly stated that the goal is to store "generic memories." While sparsifying classical Hopfield networks can achieve exponentially large capacities, it typically requires memories to be specifically engineered to avoid interference, which limits their applicability to real-world, diverse datasets. Dense associative memories circumvent this by fundamentally altering the network's capacity for generic memories.

In summary, dense associative memories provide a powerful tool for building AI systems with enhanced memory and reliability. While challenges related to computational efficiency and memory representation of high-rank tensors exist, the foundational breakthrough in storage capacity, coupled with compatibility with modern training methods, makes this a highly promising area for future AI development.

Key Takeaways

  • Classical Hopfield networks suffer from a severe memory storage capacity limitation, scaling only linearly with the number of neurons (K_max ≈ 0.14D), making them impractical for large-scale AI.
  • Dense associative memories overcome this limitation by incorporating higher-order interactions and a separation function in their energy landscape, achieving a memory capacity that scales polynomially as D^(n-1), where 'n' is the order of interaction.
  • This exponential increase in capacity allows these networks to store vastly more information (e.g., hundreds of images) while maintaining robust error correction capabilities, crucial for handling noisy or incomplete inputs.
  • The design of dense associative memories involves three key functional components: a similarity function, a separation function, and a monotone function, offering flexibility in tailoring the network's properties.
  • Unlike simple content-addressable memory systems, energy-based associative memories perform computation through dynamic evolution on an energy landscape, allowing for complex recall processes like pattern completion and denoising.
  • These advanced associative memory models are designed to store generic, trainable memories, making them compatible with modern machine learning techniques like backprop and contrastive learning, thereby broadening their applicability in AI development.

About the Speaker(s)

Dmitry Krotov is a distinguished physicist whose research is at the exciting intersection of neural networks and machine learning. He is currently a research staff member at the MIT IBM Watson AI Lab and previously held a position at the prestigious Institute for Advanced Study in Princeton. Dmitry's work is notable for bridging the fields of physics, neuroscience, and artificial intelligence. He has made significant contributions to the foundational understanding of neural networks, particularly in the domain of associative memories. Notably, he co-developed dense associative memories with the legendary John Hopfield, a breakthrough that massively increased the storage capacity of these brain-inspired systems beyond the binary limitations of original Hopfield networks.

Benjamin Hoover is a machine learning PhD student at Georgia Tech and an AI research engineer with IBM. He is passionate about enhancing the understandability and efficiency of machine learning and AI models, drawing inspiration from the principles of associative memories. Benjamin is recognized for his unique talent in visualizing the internal workings of complex "black box" AI models, a skill he often shares through platforms like Twitter. His segment of the tutorial focuses on providing hands-on experience in building associative memories.

Parikshit Ram serves as a principal research staff member at IBM Research. He brings deep and extensive expertise across various domains of machine learning, ranging from similarity search techniques to automated data science. In his role within the tutorial, Parikshit is tasked with connecting the theoretical and practical aspects of associative memories with established classical machine learning algorithms, illustrating their relevance and potential for integration into broader ML ecosystems.

Reviews

Maya Iyer (Theoretical ML Researcher) — SOLID

A competent tutorial survey of dense associative memories, presenting Krotov and Hopfield's well-known capacity scaling results in pedagogically accessible form. The core theoretical contribution — that replacing quadratic energy functions with degree-n polynomials lifts capacity from O(D) to O(D^{n-1}) — is real and non-trivial, and the modular (S, F, Q) framework is a useful organizing lens. However, this is a tutorial, not a new result: the foundational dense associative memory work dates to Krotov and Hopfield (2016) and the modern Hopfield network reformulation by Ramsauer et al. (2020). The experimental demonstrations are illustrative rather than controlled, the capacity derivation…

Chen Zhao (Applied ML Researcher & Empiricist) — SOLID

A well-organized tutorial on dense associative memories covering the theoretical progression from classical Hopfield networks to higher-order interaction models with polynomial capacity scaling. Krotov presents the core theoretical machinery clearly, and the D^(n-1) capacity result is a genuine contribution to the field with real mathematical content. However, evaluated as an empirical contribution rather than a pedagogical exercise, this tutorial rests on a thin experimental base — Pokemon image demos with no error bars, no seeds, no quantitative capacity measurements, and no comparison against relevant modern baselines like product-key memories, modern Hopfield networks with continuous…

→ Top-rated talks at International Conference on Machine Learning 2025

All talks from International Conference on Machine Learning 2025