The Memorization Puzzle in Diffusion Models
Diffusion models have become the gold standard for generating high-quality images, video, and audio. However, their success masks a significant theoretical puzzle: if a diffusion model is trained and sampled perfectly, mathematical theory suggests it should simply "memorize" and return the exact training data.
As illustrated above, using the "empirical score function"—the mathematically optimal fit for a finite dataset—leads to the exact recovery of training images. Yet, in practice, these models produce novel, diverse samples. Existing theories often rely on "uniform convergence," which evaluates the complexity of the model architecture but ignores the actual algorithms used during training and sampling. This paper bridges that gap by developing an algorithm-dependent analysis to explain why diffusion models generalize rather than overfit.
A New Framework: Score Stability
To explain this phenomenon, the authors borrow from the classical learning theory concept of algorithmic stability to introduce score stability. This metric quantifies how sensitive a score-matching algorithm is to small changes in the training dataset (e.g., swapping out one image for another). If an algorithm is stable, it does not over-rely on any single data point, which is a fundamental hallmark of good generalisation.
Using this framework, the researchers identify three distinct sources of "implicit regularisation" across the diffusion pipeline that prevent memorization:
1. Denoising Regularisation
The first source of regularisation occurs during the forward noising process. The authors demonstrate the benefit of "early stopping" in this phase. By retaining a small amount of noise, the process acts as a natural regularizer. It prevents the score function from becoming overly irregular, which would otherwise lead directly to the memorization of training data.
2. Sampler Regularisation
The sampling phase reveals a surprising trade-off. While very fine discretisation (taking many small steps during generation) reduces numerical error, coarser discretisation (taking fewer, larger steps) can actually improve generalisation. The coarseness acts as a form of implicit regularisation, preventing the model from perfectly tracing back to specific training examples.
3. Optimisation Regularisation
Finally, the authors examine the role of Stochastic Gradient Descent (SGD). In diffusion training, gradients inherently possess high variance (noise). The analysis shows that this noise induces "contractive" behavior in the training dynamics. Consequently, stability bounds do not explode even with a high number of training iterations, allowing SGD to provide tighter generalisation guarantees than standard optimization theory would normally suggest.
Key Insights and Theoretical Results
Beyond identifying these regularisation sources, the paper provides several rigorous mathematical insights:
- Manifold-Adaptivity: The derived generalisation bounds depend on the intrinsic dimension of the data ($d^*$) rather than the high-dimensional ambient space ($d$). This suggests that diffusion models automatically adapt to the underlying structure of the data, such as the lower-dimensional "manifold" of natural images.
- ERM Generalisation: For Empirical Risk Minimization (ERM), the generalisation gap decays at a near-linear rate relative to the number of samples $N$, heavily influenced by the early stopping time $\epsilon$.
- Convergence Rates: The analysis provides statistical guarantees for the expected KL divergence between the true data distribution and the model's generated samples, showing rates that scale with $1/\sqrt{N}$ or better under certain conditions.
Limitations and Future Directions
While score stability offers a powerful new lens for understanding diffusion models, the authors note areas for future exploration. The current approach is largely "model-agnostic" and does not fully exploit specific properties of neural network architectures, such as smoothness. Additionally, the results focus on expected generalisation gaps; deriving "high-probability" bounds remains an open challenge. Finally, extending this stochastic (SDE-based) analysis to the deterministic "probability flow ODE" used in many modern samplers represents a promising next step for the field.
Summary updated