NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Neural Network-Based Score Estimation in Diffusion Models: Optimization and Generalization

Yinbin Han, Meisam Razaviyayn, Renyuan Xu

Introduction

Diffusion models have taken the generative AI world by storm, often outperforming Generative Adversarial Networks (GANs) in image and video synthesis. At the heart of these models lies the score function—the gradient of the log-density of the data at various noise levels. To generate new samples, models must estimate this score function using neural networks through a process called score matching.

While these models work exceptionally well in practice, theoretical understanding has lagged behind empirical success. Most existing theory assumes we already have a perfect score estimator or treats the neural network as a "black box." This paper tackles a fundamental question: Can a standard gradient-based algorithm actually train a neural network to learn the score function with provable accuracy?

By framing score matching as a regression problem with noisy labels and leveraging Neural Tangent Kernel (NTK) theory, the authors establish the first explicit sample complexity bounds for the generalization error of score estimation.

Methodology

The authors establish a mathematical framework to analyze the optimization and generalization of a two-layer, fully connected ReLU neural network. Their approach involves several key technical innovations to adapt standard learning theory to the unique demands of diffusion models.

1. Regression with Noisy Labels

The authors propose a novel parametric form that transforms the complex denoising score-matching objective into a more familiar regression task. In this setup, the initial data point ($X_0$) acts as a "noisy label," while the conditional expectation ($\mathbb{E}[X_0|X_t]$) is the "true label" the network aims to learn.

To formalize this regression task, the authors define a specific sample collection procedure that generates the training data points across different noise levels and time steps:

Sample Collection Procedure

2. Neural Tangent Kernels (NTK)

To track how the network evolves during training, the authors use NTK analysis. This allows them to model the training of a massive, overparameterized network as a series of simpler kernel regression tasks.

3. Handling "Non-Standard" Challenges

Unlike standard supervised learning, score matching involves several unique hurdles:

  • Unbounded Input: Data can technically exist anywhere in space. The authors use a truncation argument to manage the "tails" of the distribution.
  • Vector-Valued Output: The score is a gradient vector, not a single scalar number.
  • Time Variable: The score changes dynamically as noise is added over time.

4. Early Stopping

The authors prove that an early-stopping rule is essential. It prevents the network from overfitting to the noise inherent in the observations, ensuring better generalization to unseen data.

Theoretical Insights

  • The "Aha" Connection: The most significant insight is the formal mathematical connection between score matching and regression analysis. By showing that learning a score is mathematically equivalent to predicting the original data from its noisy version, the authors successfully apply advanced statistical tools to a generative modeling problem.
  • Universal Approximation in RKHS: The paper proves a universal approximation theorem for score functions within the Reproducing Kernel Hilbert Space (RKHS) induced by the NTK. This ensures that the "target" score function actually lives in a space the neural network can reach.
  • Implicit Regularization: The analysis highlights that gradient descent on overparameterized networks has an implicit regularization effect, keeping the weights close to their initialization and facilitating convergence.

Main Results

The primary result of the paper provides the first generalization error (sample complexity) bounds for score estimation using gradient-descent-trained neural networks.

Quantitatively, the authors demonstrate that the error between the estimated score and the true score decreases as the number of samples ($N$) increases, provided the network is sufficiently wide and training is stopped at the right time. They decompose the total error into four manageable parts:

  1. Coupling Error: How well the neural network tracks the idealized kernel regression.
  2. Label Mismatch: The gap between the noisy samples and the true conditional expectation.
  3. Early Stopping Error: The cost of stopping training before reaching a global minimum.
  4. Approximation Error: How well the chosen function class can represent the true score.

Limitations and Future Directions

As a purely theoretical work focused on establishing mathematical bounds, the authors do not perform empirical experiments on standard image datasets. They identify several areas where the theory can be further refined:

  • Dimension Dependence: The current convergence results suffer from the "curse of dimensionality." Future work could explore "manifold structures"—the idea that high-dimensional data (like images) actually lies on a much lower-dimensional "surface."
  • Architectural Complexity: This study focuses on simple two-layer networks. Real-world diffusion models use complex U-Nets and Transformers, which require more sophisticated analysis.
  • Advanced Optimizers: The proof assumes standard Gradient Descent. Analyzing stochastic (SGD) or adaptive (Adam) algorithms would bring the theory even closer to practical implementation.

Summary updated

BibTeX
@inproceedings{han2024neural,
  author = {Yinbin Han and Meisam Razaviyayn and Renyuan Xu},
  title = {{Neural Network-Based Score Estimation in Diffusion Models: Optimization and Generalization}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=h8GeqOxtd4},
}
Figure