Abstract
Deep generative models (DGMs), particularly diffusion models, frequently memorize and reproduce training data, presenting significant legal and privacy challenges. We introduce the Manifold Memorization Hypothesis (MMH), a geometric framework that characterizes memorization as a reduction in the local intrinsic dimension (LID) of the learned data manifold. By quantifying LID, we can distinguish between overfitting-driven memorization and data-driven memorization inherent in the training set. Our framework provides a unified explanation for the effects of classifier-free guidance and data duplication on model behavior, offering new tools for detecting data leakage without requiring access to original training sets.
Introduction
The tendency of deep generative models to "leak" training samples—reproducing copyrighted or private images—is a primary obstacle to their widespread deployment. Traditional metrics for memorization often rely on pixel-level similarity or probability density, which fail to capture "reconstructive memory" where layouts or styles are copied without exact pixel matches. Furthermore, a theoretical understanding of why certain samples are memorized while others are not has remained elusive. This paper proposes a geometric perspective to bridge this gap.
The Manifold Memorization Hypothesis
We propose that data resides on a low-dimensional manifold embedded within a high-dimensional space. Memorization occurs when the model learns a manifold with an unnaturally low dimensionality at specific points. This is quantified using the Local Intrinsic Dimension (LID), which represents the "degrees of freedom" available to the model at a given point on the manifold.
Under the MMH, we identify two primary types of memorization:
- Overfitting-driven Memorization (OD-Mem): The model learns a manifold with a lower dimension than the ground truth ($LID_\theta < LID_*$), effectively "constraining" the output to a narrow region.
- Data-driven Memorization (DD-Mem): The ground truth data itself possesses a low dimension (e.g., due to duplicates or simple patterns), which the model correctly captures ($LID_\theta \approx LID_* \approx 0$).
Methodology
To validate this hypothesis, we utilize several LID estimators tailored to different model architectures:
- FLIPD and Normal Bundle (NB): Specialized estimators for diffusion models.
- Jacobian Rank: Employed for GAN-based architectures.
- Local PCA: Used to estimate the dimensionality of the raw training data for comparison.
Experiments were conducted across synthetic datasets (von Mises mixtures), CIFAR-10 (using iDDPM and StyleGAN2-ADA), and large-scale models like Stable Diffusion v1.5. We specifically analyzed 86 "matching verbatim" images from the LAION dataset identified in previous research.
Key Insights and Results
Dimensionality as a Predictor
In CIFAR-10 experiments, memorized samples—both exact and reconstructive—consistently exhibited lower LID values than non-memorized samples. This confirms that memorization is fundamentally linked to a loss of local diversity in the model's output space.
The Impact of Classifier-Free Guidance (CFG)
A significant finding is the relationship between CFG and manifold dimensionality. High CFG values, often used to increase prompt adherence, "explode" the score norm and force the model into low-LID regions. This explains why aggressive guidance frequently leads to memorized or "fried" outputs.
Complexity Normalization
Simple images (e.g., logos on plain backgrounds) naturally have low LID. To isolate true memorization, we normalized LID estimates by image complexity, using PNG compression length as a proxy. This allowed for a more robust discrimination between "simple" data and "memorized" data.
Mitigation Strategies
By calculating LID gradients, we identified specific prompt tokens that drive the model toward low-dimensional (memorized) regions. Using GPT-4 to perturb only these high-risk tokens, we successfully reduced memorization while maintaining high image quality, outperforming random token replacement strategies.
Conclusion
The Manifold Memorization Hypothesis provides a robust geometric foundation for understanding how and why generative models reproduce training data. By treating memorization as a property of the learned manifold's dimensionality, we can detect potential data leakage even without access to the original training set. Future work will explore extending this geometric framework to discrete data types, such as those found in large language models.
Summary updated