In search of dispersed memories: Generative diffusion models are associative memory networks

Luca Ambrogioni · DOI

This paper provides a fascinating bridge between the world of state-of-the-art generative AI and the classical neuroscience of memory. Author Luca Ambrogioni demonstrates that the very models we use to generate photorealistic images are, at their core, sophisticated versions of the associative memory networks first proposed in the 1980s.

TL;DR

This research proves that generative diffusion models (DMs) are mathematically equivalent to Modern Hopfield Networks (MHNs) when trained on discrete data. By showing that the denoising process in a DM is essentially a memory recall operation, the author provides a new framework for understanding how deep neural networks store, retrieve, and even "reconstruct" memories.

The Problem: Bridging AI and Neuroscience

In neuroscience and AI, explaining how the brain stores "episodic" memories (specific events) versus "semantic" memories (general knowledge) has been a long-standing challenge.

Classical Hopfield Networks (1982) modeled memory as "fixed points" in an energy landscape—analogous to a ball rolling into a valley. However, they suffered from low storage capacity. Modern Hopfield Networks (MHNs) addressed capacity issues using non-linearities but lacked a biologically plausible learning mechanism; they required patterns to be explicitly stored.

Conversely, Generative Diffusion Models have revolutionized AI by learning to transform noise into data, yet they were primarily viewed as statistical tools. This paper bridges the gap: Can diffusion models explain the mechanics of biological memory?

Methodology

The author links the two fields through several mathematical steps:

  1. Energy-Based Interpretation: The "score function" (the gradient used by diffusion models to remove noise) is formulated as the negative gradient of an energy function.
  2. Asymptotic Equivalence: Analyzing "variance-exploding" diffusion models reveals that as noise approaches zero, the energy landscape of a DM trained on discrete patterns becomes identical to that of an MHN.
  3. Generalization: This equivalence is shown to be a fundamental property of diffusion-based denoising across a wide class of Stochastic Differential Equations (SDEs).
  4. Simulation: The theory is validated by comparing denoising trajectories of trained deep neural networks against iterative MHN updates.

Datasets

The study primarily uses synthetic datasets of discrete binary patterns.

  • Randomly generated $D$-dimensional binary vectors (e.g., 5D and 10D) were used to test memory storage and recall.
  • These patterns were corrupted with Gaussian noise or partial masking to simulate "noisy" or "incomplete" memory cues.

Key Insights

  • Denoising is Recall: Turning a noisy image into a sharp one is mathematically equivalent to a Hopfield network "recalling" a stored memory from a partial cue.
  • Weights as Memory: Unlike MHNs, diffusion models encode memories into synaptic weights via standard gradient descent (SGD), offering a more biologically plausible model for physical information storage.
  • The Semantic-Episodic Continuum: The paper suggests "episodic" and "semantic" memories are ends of a single spectrum. Frequent sampling leads to localized episodic memory, while learning a continuous distribution results in semantic knowledge.
  • Reconstructive Memory: The model explains the "reconstructive" nature of human memory. Diffusion fills in missing details based on learned semantic structures, potentially leading to plausible but "false" details.

Key Results

The study found a near-perfect correlation (~0.99) between the outputs of diffusion models and MHNs in denoising tasks. Furthermore, diffusion models exhibited massive storage capacity, far exceeding the limits of classical Hopfield networks.

Comparison of denoising trajectories and energy landscapes showing smooth paths toward memory fixed-points.

Qualitative analysis (see figure above) shows that while Hopfield updates are "jumpy," diffusion trajectories are smooth paths toward the same memory fixed-points.

Limitations and Future Directions

While promising, the model relies on backpropagation, which remains a point of contention in neuroscience. The author suggests "noise-injection" learning as a possible biological alternative. Additionally, forming stable episodic memories from single events requires "re-sampling," aligning with hippocampal replays observed during sleep. Scaling these proofs from discrete patterns to complex, high-dimensional manifolds remains a theoretical challenge.

Summary updated

BibTeX
@article{ambrogioni2024search,
  author = {Luca Ambrogioni},
  title = {{In search of dispersed memories: Generative diffusion models are associative memory networks}},
  journal = {Entropy},
  year = {2024},
  doi = {10.3390/e26050381},
}
Figure