Memory in Plain Sight: A Survey of the Uncanny Resemblances between Diffusion Models and Associative Memories

Benjamin Hoover, Hendrik Strobelt, Dmitry Krotov, Judy Hoffman, Zsolt Kira, Duen Horng Chau · DOI

Abstract

This survey explores the mathematical and conceptual convergence between Diffusion Models (DMs) and Associative Memories (AMs). By framing DMs as energy-minimizing systems, we demonstrate that the iterative denoising process is functionally equivalent to memory retrieval in brain-inspired architectures like Hopfield Networks. This unified perspective offers new avenues for improving the stability, interpretability, and biological plausibility of generative AI.

Introduction

Diffusion Models (DMs)—the engines behind tools like Midjourney and Stable Diffusion—have revolutionized image generation. However, they are often described through a fragmented lens of iterative denoisers, score-based models, or stochastic differential equations. While technically accurate, these descriptions lack a cohesive conceptual framework explaining why these models work so well as a form of memory.

Conversely, Associative Memories (AMs), such as Hopfield Networks, possess a rich theoretical history in brain-inspired computation dating back to the 1980s. Designed to store and retrieve information from partial or noisy queries, traditional AMs have historically struggled to scale to the complexity of modern image generation. This paper bridges this gap, arguing that DMs are essentially "unconstrained" Associative Memories that bypass traditional stability requirements to achieve state-of-the-art performance. The authors validate these theoretical links by referencing benchmarks on MNIST and large-scale image generation datasets, contrasting the empirical success of DMs with the theoretical constraints of traditional AMs.

Comparison of Diffusion and Associative Memory dynamics showing how both reconstruct signals by following energy gradients.

Theoretical Framework: The Energy Perspective

The authors perform a theoretical synthesis mapping DM mechanics onto Energy-Based Models (EBMs) and dynamical systems. A key insight is that the "score function" in Diffusion—the vector field guiding an image toward high-probability regions—is exactly the negative gradient of an underlying energy landscape.

By utilizing the "Probability Flow ODE" (PF-ODE) formulation, the stochastic elements of Diffusion are removed, revealing a deterministic path identical to the "memory retrieval" process in AMs. To illustrate this, the authors introduce the "TinyBrain" abstraction, a simplified model where neurons and synapses evolve to descend a total energy landscape.

The TinyBrain sandbox illustrates how memory and visible neurons interact via learnable synapses to minimize global energy.

Key Insights and Equivalence

The survey highlights several critical points of convergence:

  • Unconstrained Dynamics: Traditional AMs are bound by Lyapunov stability, requiring movement toward fixed points. DMs achieve similar results through "engineered dynamics"—noise and step-size schedules—without strict architectural constraints.
  • Retrieval as Generation: Image generation is reframed as an error-correction process where pure noise is iteratively refined until it settles into a "memory" (a high-probability region) of the training data.
  • The Transformer Connection: The attention mechanism in Transformers is identified as a differentiable form of Associative Memory, suggesting a broader convergence in AI toward memory-centric paradigms.
  • Mathematical Equivalence: Under specific conditions involving discrete patterns and temperature schedules, a DM's energy function is shown to be exactly equivalent to a Modern Hopfield Network.

Discussion and Future Directions

While DMs currently rely on rigid time-dependent noise schedules, traditional AMs do not. Removing this dependency could enhance DM flexibility. Furthermore, the authors suggest that the scaling laws observed in Large Language Models might be better understood through the lens of memory capacity in AM theory.

A significant opportunity lies in developing "Hierarchical Associative Memories." While DMs utilize complex architectures like U-Nets, most AM theory remains focused on shallow networks. Bridging this architectural gap could lead to more robust and biologically plausible generative models.

This summary is based on the paper "Memory in Plain Sight" by Hoover et al.

Summary updated

BibTeX
@inproceedings{hoover2023memory,
  author = {Benjamin Hoover and Hendrik Strobelt and Dmitry Krotov and Judy Hoffman and Zsolt Kira and Duen Horng Chau},
  title = {{Memory in Plain Sight: A Survey of the Uncanny Resemblances between Diffusion Models and Associative Memories}},
  booktitle = {AMHN @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=B1BL9go65H},
}
Figure