It’s late, you’ve had a long day, and you’re probably wondering: when ChatGPT writes a poem or Stable Diffusion paints a sunset, is it actually creating something, or is it just a very sophisticated Xerox machine?
In his PhD thesis, Bao Pham argues that the answer lies in a concept from 1980s physics: Associative Memory. By looking at generative models through this lens, Pham suggests that memorization and generalization aren't two different things—they are just different points on the same "energy landscape."
TL;DR
Generative models are essentially memory systems that store data as "gravity wells" (basins of attraction). When a model has very little data, it memorizes perfectly; as it sees more data, these wells merge and create "spurious states"—new attractors that aren't in the training set—which are actually the first signs of creativity and generalization.
What Problem Does This Paper Address?
We know generative models work, but we don't fully understand the "why" of their intelligence. Specifically, there is a tension between memorization (copying the training data) and generalization (creating new, coherent samples).
Usually, researchers treat memorization as a bug or a "side effect" that goes away with more data. Pham flips this on its head. He uses the framework of Associative Memory (AM)—specifically Hopfield Networks—to show that the ability to create is actually built on the ability to remember. The paper seeks to find the exact point where a model stops being a mirror and starts being an artist.
Methods
Pham investigates two main types of models:
- Continuous Diffusion Models: These are the engines behind image generators. Pham mathematically links their "score functions" (the math that guides noise back into an image) to the energy functions of Dense Associative Memories.
- Discrete Diffusion Models (UDDMs): These are used for language. Pham shows that you don't even need a formal "energy function" for a model to act like an associative memory; simply maximizing conditional likelihood (the standard way we train language models) naturally creates "basins of attraction" around the data.
To "see" inside the models, he measures:
- Basin Volume: How much "noise" can you add to a sample before the model can no longer recover the original?
- Energy Curvature: How "sharp" is the landscape around a sample? (Think of a sharp needle-like hole vs. a wide, shallow bowl).
- Token Recovery Rates: In language, how reliably can the model fix a corrupted sentence?
Datasets
The study spans several standard benchmarks to see if these patterns hold across different levels of complexity:
- Images: MNIST (handwritten digits), Fashion-MNIST, CIFAR-10 (objects), and LSUN-Church (buildings).
- Large-Scale Images: A case study using Stable Diffusion trained on the massive LAION dataset.
- Language: The LM1B (One Billion Word) dataset, using "Tiny," "Small," and "Medium" versions of a Diffusion Transformer.
Key Insights and Ideas
- The "Spurious" Spark: In old-school memory theory, "spurious states" (getting a result that wasn't in your memory) were considered failures. Pham argues these are the "first signs of generative capability." They are attractors that blend stored samples into something new.
- The Geometry of Memory: Memorized samples live in deep, sharp "wells" (high curvature). As the model generalizes, the landscape flattens out into a "manifold"—a smooth surface where the model can slide between ideas to create novel outputs.
- The Transition Peak: There is a specific "Goldilocks zone" in training. As you add more data, the number of memorized samples drops, the number of generalized samples rises, and the "spurious states" hit a peak right at the boundary between the two.
- Language Margins: In language models, training doesn't just store words; it maximizes the "classification margin." This creates a "gravity well" around sequences, allowing the model to "pull" a broken sentence back into a coherent one.
Key Results
- Curvature Hierarchy: Across all datasets, Pham found a consistent ordering: Memorized samples have the highest curvature (sharpest wells), Spurious samples are in the middle, and Generalized samples have the lowest curvature (flattest landscapes).
- Scaling Laws: Larger models (more parameters) actually stay in the "memorization phase" longer. They need significantly more data to trigger the transition to generalization compared to tiny models.
- Entropy as a Diagnostic: Pham found that "conditional entropy" (a measure of the model's uncertainty) can act as a cheap, internal thermometer. It vanishes when the model is just copying and becomes finite when the model starts to create.
Limitations and Future Work
While the theory is elegant, Pham notes a few hurdles:
- Scale: Most experiments were on "Tiny" to "Medium" models. While the Stable Diffusion case study was promising, we don't yet know if these geometric signatures look the same in massive models like GPT-4.
- Semantic Equivalence: In the generalization phase, the model might "fail" to recover a sentence exactly but provide a perfect synonym. Current metrics count this as a "failure" of the basin, even though it's a success of intelligence.
- Design Tool: The goal is to turn this analysis into a design tool—allowing engineers to monitor "energy curvature" during training to ensure their model is learning to create rather than just memorizing the internet.
Summary updated