Losing dimensions: Geometric memorization in generative diffusion

Beatrice Achilli, Enrico Ventura, Gianluigi Silvestri, Bao Pham, Gabriel Raya, Dmitry Krotov, Carlo Lucibello, Luca Ambrogioni · DOI

Abstract

Generative diffusion models are renowned for their ability to generalize, yet they often memorize training data in low-data regimes. This paper investigates the geometric nature of this memorization, framing it as a systematic loss of dimensions in the learned data manifold. By leveraging statistical physics and Jacobian analysis, the authors demonstrate that memorization is not a binary state but a progressive collapse where high-variance features are often the first to be "locked away."

Introduction: The Geometry of Forgetting

Diffusion models have become the standard for high-fidelity content generation. However, their tendency to memorize training samples poses significant risks to privacy and copyright. While previous studies often treat memorization as a simple binary transition, this research explores the underlying manifold structure. If natural data resides on a low-dimensional manifold within a high-dimensional space, how does this structure degrade during memorization? The authors propose that the model's understanding of data geometry crumbles piece by piece, leading to a "selective loss of dimensionality."

Methodology: Bridging Physics and Deep Learning

The study treats the diffusion process as a physical system undergoing a glassy phase transition.

1. The Random Energy Model (REM)

The authors map the empirical score function (the gradient of the log-probability) to a version of the Random Energy Model from statistical mechanics. In this framework, memorization is viewed as "condensation," where the model’s output is dominated by specific training points rather than the broader distribution.

2. Jacobian and Spectral Analysis

To quantify geometric collapse, the researchers analyze the Jacobian of the score function. The singular values of this matrix reveal "spectral gaps," which distinguish the "tangent space" (directions of valid data variation) from the "orthogonal space" (forbidden directions).

Geometric interpretation of memorization versus generalization and the role of the Jacobian in identifying tangent spaces.

3. Local Intrinsic Dimensionality (LID)

By counting the number of vanishing singular values in the Jacobian, the authors estimate the dimensionality of the learned manifold. This allows them to track how many dimensions the model "perceives" as it moves from generalization to memorization.

Key Insights: The Variance Paradox

A counterintuitive finding of this work is the Variance Paradox: subspaces with higher variance—typically considered the most important signals—are often the first to be memorized. Because these prominent features emerge earlier in the diffusion process, they are more susceptible to "condensation" as noise levels decrease.

The authors also identify a Critical Time ($t_c$), a specific moment during generation when the model transitions from generalizing to memorizing. This threshold depends on the dataset size ($N$) and local data variance.

Experimental Results

The theory was validated across synthetic linear manifolds, MNIST, CIFAR-10, and CelebA-HQ.

  • Manifold Saturation: In MNIST, the learned manifold dimensionality remains near zero until a critical threshold of approximately 400 training points is reached. Dimensionality peaks at around 4,000 points, suggesting a saturation point for geometric richness.
  • Partial Memorization in CIFAR-10: Unlike MNIST, CIFAR-10 dimensionality did not fully saturate at maximum dataset sizes, indicating that state-of-the-art models may exist in a state of partial geometric memorization.
  • Spectral Gap Closure: Experiments confirmed that as dataset size decreases, spectral gaps in the Jacobian close, marking the transition of dimensions into the memorized phase.
Spectral analysis of the Jacobian showing the gap between tangent and orthogonal spaces across latent dimensions.

Conclusion and Future Directions

This research provides a rigorous geometric framework for understanding memorization in diffusion models. While the current analysis focuses on ideal, non-parametric score functions, it sets the stage for investigating how specific neural architectures influence these phase transitions. Future work could lead to models with mathematical guarantees for generalization, ensuring they respect the boundaries of training data manifolds.

Summary updated

BibTeX
@misc{achilli2024losing,
  author = {Beatrice Achilli and Enrico Ventura and Gianluigi Silvestri and Bao Pham and Gabriel Raya and Dmitry Krotov and Carlo Lucibello and Luca Ambrogioni},
  title = {{Losing dimensions: Geometric memorization in generative diffusion}},
  year = {2024},
  eprint = {2410.08727},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.08727},
}
Figure