Deep Networks as Denoising Algorithms: Sample-Efficient Learning of Diffusion Models in High-Dimensional Graphical Models

Mei Song, Yuchen WuIEEE Trans. Information Theory 2023

Introduction

Diffusion models have revolutionized generative AI, powering state-of-the-art systems like DALL-E and Stable Diffusion. These models operate by learning a "score function"—the gradient of the log-density of the data—to reverse a noise-injection process. However, a fundamental theoretical mystery remains: why can these models learn high-dimensional score functions so efficiently? Standard statistical theory suggests that learning such functions should be subject to the "curse of dimensionality," where the required sample size grows exponentially with the number of features.

In "Deep Networks as Denoising Algorithms," the authors provide a theoretical framework to resolve this paradox. They demonstrate that for data following high-dimensional graphical models, neural networks can approximate score functions with polynomial sample efficiency. By reframing Residual Networks (ResNets) as "unrolled" variational inference algorithms, the paper bridges the gap between deep learning practice and statistical physics.

The Denoising Challenge

The primary task of a diffusion model is to learn a map that moves noisy data back toward the clean data manifold. Mathematically, this is achieved through Tweedie’s Formula, which relates the score function of a Gaussian-perturbed distribution to the posterior expectation of the original data. In essence, learning the score function is equivalent to learning an optimal denoising function.

In high dimensions ($d$), the complexity of this denoising task is typically daunting. Most theoretical guarantees for function approximation rely on "smoothness" priors, which are insufficient to explain the success of diffusion models on structured data like images or text. These data types are better represented as high-dimensional graphical models (e.g., Markov Random Fields), where dependencies are complex but often local or structured.

Neural Networks as Unrolled Algorithms

The authors' key insight is to treat neural networks not merely as black-box function approximators, but as iterative algorithms. They focus on the relationship between Variational Inference (VI) and network architecture:

  1. Tweedie’s Formula: The authors use this mathematical identity to show that the score function is directly related to the posterior expectation of the clean data given the noisy version.
  2. Variational Inference (VI): For complex graphical models, calculating the exact posterior expectation is intractable. Instead, researchers use iterative algorithms like the Thouless-Anderson-Palmer (TAP) equations or mean-field updates to approximate the denoiser.
  3. Algorithm Unrolling: The authors prove that these iterative updates can be mathematically mapped onto the architecture of a Residual Network (ResNet). In this view, each residual block in the network performs a single step of an inference algorithm.
  4. Structural Mapping: By showing that a ResNet can mimic the behavior of a VI solver, the authors establish that the network's capacity is naturally suited to the structure of the denoising problem.

Sample Efficiency and the "Blessing" of Dimensionality

The paper evaluates this theory using synthetic mathematical models that capture the essence of complex data: Ising models, Restricted Boltzmann Machines (RBMs), and sparse coding models.

Polynomial Complexity

The central result is a proof of polynomial sample efficiency. The authors show that the number of samples ($n$) required to learn the score function scales polynomially with the dimension $d$. This is a significant departure from the exponential scaling predicted by general-purpose approximation theories, explaining why diffusion models remain effective even as data dimensionality increases.

The Blessing of Dimensionality

Interestingly, the research highlights a "blessing" of dimensionality. In many of the graphical models studied, the approximation error of the denoising algorithm actually decreases as the dimension $d$ approaches infinity. High dimensionality can provide a form of concentration that makes the denoising task more stable and predictable, provided the underlying model remains in a "high-temperature" or stable regime.

Limitations and Future Directions

While the paper provides a robust foundation for understanding diffusion models, it also identifies critical boundaries. The theoretical guarantees primarily hold in "high-temperature" regimes where the data dependencies are not overly chaotic. In "low-temperature" regimes—such as those found in spin glasses—the denoising algorithms can become unstable, potentially leading to an "algorithmic hard phase" where score approximation fails.

Furthermore, while sparse coding and Ising models are proxies for structured data, extending these proofs to the specific manifolds of natural images remains an open challenge. The authors also suggest that the U-Net architectures common in diffusion models might be implementing a form of hierarchical variational inference, a hypothesis that invites further investigation.

Conclusion

By viewing deep networks as unrolled denoising algorithms, this work provides a compelling explanation for the sample efficiency of diffusion models. It suggests that the success of deep learning is not just a matter of "more data and more layers," but a fundamental alignment between the architecture of neural networks and the iterative nature of probabilistic inference in high dimensions.

Summary updated

BibTeX
@misc{song2023deep,
  author = {Mei Song and Yuchen Wu},
  title = {{Deep Networks as Denoising Algorithms: Sample-Efficient Learning of Diffusion Models in High-Dimensional Graphical Models}},
  year = {2023},
  eprint = {2309.11420},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.11420},
}
Figure