Table of Contents
Fetching ...

From Score Matching to Diffusion: A Fine-Grained Error Analysis in the Gaussian Setting

Samuel Hurault, Matthieu Terris, Thomas Moreau, Gabriel Peyré

TL;DR

This work provides an explicit error-analysis framework for end-to-end score-based sampling in the Gaussian setting, decomposing biases from score estimation (DSM) and from diffusion or Langevin discretization and noise. By focusing on linear scores and Gaussian data, it derives closed-form expansions showing the final Wasserstein error equals a kernel norm of the data power spectrum, revealing how data geometry and algorithmic parameters (N, tau, gamma, sigma) jointly govern accuracy. The study delivers precise characterizations for SGD-induced generalization and optimization errors, and parallels for Langevin and diffusion samplers, including optimal trade-offs and the potential for kernel-based performance guarantees. Numerical validations corroborate the theoretical expansions and illustrate practical implications for parameter tuning and stopping times in diffusion models. Overall, the results lay a principled foundation for understanding sampling accuracy in score-based pipelines and guide extensions to nonlinear, real-world data distributions.

Abstract

Sampling from an unknown distribution, accessible only through discrete samples, is a fundamental problem at the core of generative AI. The current state-of-the-art methods follow a two-step process: first, estimating the score function (the gradient of a smoothed log-distribution) and then applying a diffusion-based sampling algorithm -- such as Langevin or Diffusion models. The resulting distribution's correctness can be impacted by four major factors: the generalization and optimization errors in score matching, and the discretization and minimal noise amplitude in the diffusion. In this paper, we make the sampling error explicit when using a diffusion sampler in the Gaussian setting. We provide a sharp analysis of the Wasserstein sampling error that arises from these four error sources. This allows us to rigorously track how the anisotropy of the data distribution (encoded by its power spectrum) interacts with key parameters of the end-to-end sampling method, including the number of initial samples, the stepsizes in both score matching and diffusion, and the noise amplitude. Notably, we show that the Wasserstein sampling error can be expressed as a kernel-type norm of the data power spectrum, where the specific kernel depends on the method parameters. This result provides a foundation for further analysis of the tradeoffs involved in optimizing sampling accuracy.

From Score Matching to Diffusion: A Fine-Grained Error Analysis in the Gaussian Setting

TL;DR

This work provides an explicit error-analysis framework for end-to-end score-based sampling in the Gaussian setting, decomposing biases from score estimation (DSM) and from diffusion or Langevin discretization and noise. By focusing on linear scores and Gaussian data, it derives closed-form expansions showing the final Wasserstein error equals a kernel norm of the data power spectrum, revealing how data geometry and algorithmic parameters (N, tau, gamma, sigma) jointly govern accuracy. The study delivers precise characterizations for SGD-induced generalization and optimization errors, and parallels for Langevin and diffusion samplers, including optimal trade-offs and the potential for kernel-based performance guarantees. Numerical validations corroborate the theoretical expansions and illustrate practical implications for parameter tuning and stopping times in diffusion models. Overall, the results lay a principled foundation for understanding sampling accuracy in score-based pipelines and guide extensions to nonlinear, real-world data distributions.

Abstract

Sampling from an unknown distribution, accessible only through discrete samples, is a fundamental problem at the core of generative AI. The current state-of-the-art methods follow a two-step process: first, estimating the score function (the gradient of a smoothed log-distribution) and then applying a diffusion-based sampling algorithm -- such as Langevin or Diffusion models. The resulting distribution's correctness can be impacted by four major factors: the generalization and optimization errors in score matching, and the discretization and minimal noise amplitude in the diffusion. In this paper, we make the sampling error explicit when using a diffusion sampler in the Gaussian setting. We provide a sharp analysis of the Wasserstein sampling error that arises from these four error sources. This allows us to rigorously track how the anisotropy of the data distribution (encoded by its power spectrum) interacts with key parameters of the end-to-end sampling method, including the number of initial samples, the stepsizes in both score matching and diffusion, and the noise amplitude. Notably, we show that the Wasserstein sampling error can be expressed as a kernel-type norm of the data power spectrum, where the specific kernel depends on the method parameters. This result provides a foundation for further analysis of the tradeoffs involved in optimizing sampling accuracy.

Paper Structure

This paper contains 75 sections, 17 theorems, 406 equations, 7 figures.

Key Result

Theorem 1

Under Assumption ass:gaussian, for fixed stepsize $\tau < \frac{2}{\max\left( \lambda_{max} + \sigma^2, 1 \right)},$ the SGD iterates eq:score_matching_SGD_emp converge to a stationary distribution on the parameters $A$ and $b$. At stationarity, $b = \kappa + A \mu_\mathrm{data}$, with $\kappa$ and and covariances (denoting $P_\sigma \coloneqq C_\sigma^{-1} C_\mathrm{data}$ and $Q_\sigma \coloneq

Figures (7)

  • Figure 1: $W_2$ error, w.r.t $\tau$ (top) and $N$ (bottom), between the theoretical (Theorem \ref{['thm:SGD_error']}) and the empirical Gaussian approximations of the stationary distribution of the SGD algorithm \ref{['eq:score_matching_SGD_emp']}.
  • Figure 2: Theoretical vs Empirical Langevin sampling $W_2$ error as a function of $\sigma$, for various score training parameters $\tau$ (top) and $N$ (bottom).
  • Figure 3: Theoretical and empirical $W_2$ errors of discretized diffusion at step $k$, w.r.t. $T-t_k$, with constant stepsize $\gamma$ and (exponentially) decreasing stepsize $\gamma_k$.
  • Figure 4: Power spectrum of $C_{\mathrm{data}}$ for different values of the power law coefficient $\zeta$.
  • Figure 5: $k^\tau_{0,0}(\lambda_i, \lambda_j)$ for $\lambda_i, \lambda_j \in [0,1]$
  • ...and 2 more figures

Theorems & Definitions (37)

  • Theorem 1: Optimization and generalization errors in SGD for denoising score matching
  • Lemma 1: ULA solution with linear score, proof in Appendix \ref{['app:lemma_langevin_1']})
  • Theorem 2: ULA sampling error with inexact linear score, proof in Appendix \ref{['app:langevin_distance_general']}
  • Corollary 1: ULA sampling error with linear score trained by SGD, proof in Appendix \ref{['app:langevin_final']}
  • Proposition 1: Discretized diffusion with linear score, proof in Appendix \ref{['app:diffusion_discretization_1']}
  • Theorem 3: Diffusion sampling error with inexact linear score, proof in Appendix \ref{['app:distance_general_diff']}
  • Corollary 2
  • proof
  • Proposition 2: Optimization error of SGD
  • proof
  • ...and 27 more