Abstract: We study the memorization and generalization capabilities of Diffusion Models (DMs) when data lies on a structured latent manifold. Specifically, we consider a set of $P$ data points in $N$ dimensions confined to a latent subspace of dimension $D = α_D N$, following the Hidden Manifold Model (HMM). We analyze the reverse diffusion process using the empirical score function as a proxy, and characterize it in the high-dimensional limit $P = \exp(αN)$, $N \gg 1$, by exploiting a connection with the Random Energy Model (REM). We show that a characteristic time $t_o$ marks the emergence of traps in the time-dependent potential, which however do not affect typical trajectories. The size of their basins of attraction is computed at all times. We derive the collapse time $t_c < t_o$, at which trajectories fall into the basin of a training point, signaling memorization. An explicit formula for $t_c$ as a function of $P$ and $α_D$ shows that the curse of dimensionality is avoided for structured data ($α_D \ll 1$), even with nonlinear manifolds. We also prove that collapse corresponds to the condensation transition in the REM. Generalization is quantified via the Kullback-Leibler divergence between the exact distribution and the reverse one at time $t$. We find a distinct time $t_g < t_c < t_o$ minimizing this divergence. Surprisingly, the best generalization occurs inside the memorization phase. We conclude that generalization in DMs improves with data structure, as $t_g \to 0$ faster than $t_c$ when $α_D \to 0$.
Introduction
Generative diffusion models (DMs) have achieved remarkable success in synthesizing complex data like images and audio. However, a theoretical gap remains in understanding how these models balance the memorization of training samples with the ability to generalize to new data. Previous theoretical work often assumed unstructured data, but real-world datasets typically satisfy the Manifold Hypothesis, residing on low-dimensional latent surfaces within high-dimensional ambient spaces. This study investigates how this latent structure influences the dynamics of memorization and generalization.
Methodology and Theoretical Framework
The authors employ the Hidden Manifold Model (HMM) to represent structured data. In this framework, $P$ data points are generated in a $D$-dimensional latent space and projected into an $N$-dimensional ambient space. To analyze the diffusion process, the study uses the empirical score function as a mathematical proxy for a perfectly trained model.
The analysis leverages tools from statistical mechanics, specifically the Random Energy Model (REM) and the replica method from spin-glass theory. By treating the reverse diffusion process as a particle navigating a time-dependent energy landscape, the authors identify critical phase transitions in the generative process.
Dynamical Phases of Diffusion
The reverse diffusion process, which transforms noise into data as time $t$ goes from $\infty$ to $0$, exhibits three distinct milestones:
- Onset time ($t_o$): Local minima (traps) begin to form around training data points in the potential landscape, though they do not yet capture typical trajectories.
- Collapse time ($t_c$): The memorization transition. Trajectories are inevitably pulled into the basin of attraction of a specific training point.
- Generalization time ($t_g$): The point at which the generated distribution most closely matches the true underlying data distribution, as measured by minimized Kullback-Leibler divergence.
A key finding is the ordering $t_g < t_c < t_o$. Counter-intuitively, this implies that the optimal time for generalization occurs after the model has entered the memorization phase. In the reverse process, as $t$ decreases, the trajectory is first trapped by a training point ($t_c$) before reaching the state of maximum generalization ($t_g$).
Scaling Laws and the Curse of Dimensionality
A significant contribution of this work is the proof that DMs can circumvent the "curse of dimensionality." The authors derived an explicit formula for the collapse time $t_c$, showing that it scales with the latent dimension $D$ rather than the ambient dimension $N$. Specifically, for small latent dimensions, $t_c \approx \frac{\sigma^2}{2} \frac{N}{D} e^{-\frac{2 \log P}{D}}$.
This result explains why DMs are effective even for ultra-high-dimensional data: the required number of training points $P$ scales exponentially with the intrinsic complexity (latent dimension) of the data, not the raw pixel count. Furthermore, as data becomes more structured (smaller $D/N$), the window for generalization widens, as $t_g$ approaches zero faster than $t_c$.
Conclusion and Future Directions
This research provides a rigorous statistical physics foundation for understanding diffusion models. It demonstrates that latent structure is the primary driver of both memorization and generalization performance. While the use of the empirical score function provides clear theoretical insights, future work is needed to incorporate the inductive biases of specific neural network architectures and to explore data models with distinct class separations to study hierarchical feature learning.
Summary updated