Convergence for score-based generative modeling with polynomial complexity

Holden Lee, Jianfeng Lu, Yixin Tan

Introduction

A key task in machine learning is to learn a probability distribution from data, in a way that allows efficient generation of additional samples from the learned distribution. Score-based generative modeling (SGM) is one empirically successful approach that implicitly learns the probability distribution by learning how to transform white noise into the data distribution, and gives state-of-the-art performance for generating images and audio [SE19, Dat+19, Gra+19, SE20, Son+20a, Men+21, Son+21a, Son+21, Jin+22]. It also yields a conditional generation process for inverse problems [DN21]. The basic idea behind score-based generative modeling is to first estimate the score function from data [Son+20] and then to sample the distribution based on the learned score function. Other approaches for generative modeling include generative adversarial networks (GANs) [Goo+14, ACB17], normalizing flows [DSB16], variational autoencoders [KW19], and energy-based models [ZML16]. While score-based generative modeling has achieved great success, its theoretical analysis is still lacking and is the focus of our work.

The score function of a distribution PP with density pp is defined as the gradient of the log-pdf, ∇ln⁡p\nabla\ln p. Its significance arises from the fact that knowing the score function allows running a variety of sampling algorithms, based on discretizations of stochastic differential equations (SDE’s), to sample from pp. SGM consists of two steps: first, learning an estimate of the score function for a sequence of “noisy” versions of the data distribution PdataP_{\textup{data}}, and second, using the score function in lieu of the gradient of the log-pdf in the chosen sampling algorithm. We now describe each of these steps more precisely.

First, a method of adding noise to the data distribution is fixed; this takes the form of evolving a (forward) stochastic differential equation (SDE) starting from the data distribution. We fix a sequence of noise levels σ1<⋯<σN\sigma_{1}<\cdots<\sigma_{N}. For σ∈{σ1,…,σN}\sigma\in\{\sigma_{1},\ldots,\sigma_{N}\}, let the resulting distributions be Pσ2P_{\sigma^{2}} and the distributions conditional on the starting data point be Pσ2(⋅∣x)P_{\sigma^{2}}(\cdot|x). Typically, σ1\sigma_{1} is chosen so that Pσ12≈PdataP_{\sigma_{1}^{2}}\approx P_{\textup{data}} and PσN2P_{\sigma_{N}^{2}} is close to some “prior” distribution that is easy to sample from, such as N(0,σN2Id)N(0,\sigma_{N}^{2}I_{d}). While the score ∇ln⁡pσ2\nabla\ln p_{\sigma^{2}} cannot be estimated directly, it turns out that a de-noising objective that is equivalent to the score-matching objective can be calculated [SE19]. This de-noising objective can be estimated from samples (X,X~)(X,\widetilde{X}) where X~∼Pσ2(⋅∣x)\widetilde{X}\sim P_{\sigma^{2}}(\cdot|x). The objective is represented and optimized within an expressive function class, typically neural networks, to obtain a L2L^{2}-estimate of the score, that is, sθ(x,σ2)s_{\theta}(x,\sigma^{2}) such that

The reason we estimate the score function ∇ln⁡pσ2\nabla\ln p_{\sigma^{2}} is that there are a variety of sampling algorithms—based on simulating SDE’s—that can sample from pp given access to ∇ln⁡p\nabla\ln p, including Langevin Monte Carlo and Hamiltonian Monte Carlo. The second step is then to use the estimated score function sθ(x,t)s_{\theta}(x,t) in lieu of the exact gradient in the sampling algorithm to successively obtain samples from pσN2,…,pσ12p_{\sigma_{N}^{2}},\ldots,p_{\sigma_{1}^{2}}. This sequence interpolates smoothly between the prior distribution (e.g., N(0,σN2Id)N(0,\sigma_{N}^{2}I_{d})) and the data distribution PdataP_{\textup{data}}; such an “annealing” or “homotopy” method is required in practice to generate good samples [Son+20a].

Examples of SGM’s.

There have been several instantiations of this general approach. [SE19] add gaussian noise to the data and then use Langevin diffusion at a discrete set of noise levels σN>⋯>σ1\sigma_{N}>\cdots>\sigma_{1} as the sampling algorithm. [Son+20a] take the continuous perspective and consider a more general framework, where the forward process can be any reasonable SDE. Then a natural reverse SDE evolves the final distribution pσN2p_{\sigma_{N}^{2}} back to the data distribution; this process can be simulated with the estimated score. They consider methods based on two different SDE’s: score-matching Langevin diffusion (SMLD) based on adding Gaussian noise and denosing diffusion probabilistic models (DDPM) [Soh+15, HJA20], based on the Ornstein-Uhlenbeck process. Note that a difference with MCMC-based methods is that these SDE’s are evolved for a fixed amount of time, rather than until convergence. However, they can be combined with MCMC-based methods such as Langevin diffusion in the predictor-corrector approach for improved convergence. [DVK21] include Hamiltonian dynamics: they augment the state space with a velocity variable and consider a critically-damped version of the Ornstein-Uhlenbeck process. Finally, we note the work of [De ̵+21], who introduce the Diffusion Schrödinger Bridge method to learn a diffusion that more quickly transforms the prior into the data distribution.

We will give a general analysis framework for SGM’s that applies to the algorithms in both [SE19] and [Son+20a].

2 Prior work and challenges for theory

Although the literature on convergence for Langevin Monte Carlo [DM17, CB18, Che+18, Dal17, DK19, MMS20, EHZ21] and related sampling algorithms is extensive, prior works mainly consider the case of exact or stochastic gradients. In contrast, by the structure of the loss function (1), the score function learned in SGM is only accurate in L2(p)L^{2}(p). This poses a significant challenge for analysis, as the stationary distribution of Langevin diffusion with L2(p)L^{2}(p)-accurate gradient can be arbitrarily far from pp (see Appendix D). Hence, any analysis must be utilizing the short/medium-term convergence, while overcoming the potential issue of long-term behavior of convergence to an incorrect distribution.

[BMR20] give the first theoretical analysis of SGM, and in particular, Langevin Monte Carlo with L2(p)L^{2}(p)-accurate gradients. First, they show using uniform generalization bounds that optimizing the de-noising autoencoder (DAE) objective does in fact give a L2(p)L^{2}(p)-accurate score function, with sample complexity depending on the complexity of the function class. They analyze convergence of LMC in Wasserstein distance. However, the error they obtain (Theorem 13) only decreases as ε1/d\varepsilon^{1/d} where ε\varepsilon is the accuracy of the score estimate—so it suffers from the curse of dimensionality—and increases exponentially in the time that the process is run, the dimension, and the smoothness of the distribution, as in ODE/SDE discretization arguments that do not depend on contractivity.

[De ̵+21] give an analysis for [Son+20a] in TV distance that requires a L∞L^{\infty}-accurate score function and depends exponentially on the amount of time the reverse SDE is run. Although exponential dependence is bad in general, it is mollified using their Diffusion Schrödinger Bridge (DSB) approach, as it allows running for a shorter, fixed amount of time, before the forward SDE converges to the prior distribution. However, this supposes that a good solution can be found for the DSB problem, and theoretical guarantees may be difficult to obtain.

We overcome the challenges of analysis with a L2(p)L^{2}(p)-accurate gradient, and give the first analysis with only polynomial dependence on running time, dimension, and smoothness of the distribution, with rates that are a fixed power of ε\varepsilon. Our convergence result is in TV distance. We assume only smoothness conditions and a bounded log-Sobolev constant of the data distribution, a weaker condition than the dissipativity condition required by [BMR20]. We introduce a general framework for analysis of sampling algorithms given L2L^{2}-accurate gradients (score function) based on constructing a “bad set” with small measure and showing convergence of the discretized process conditioned on not hitting the bad set. We use our framework to give an end-to-end analysis for both the algorithms in [SE19] and [Son+20a], and illuminate the relative performance of different methods in practice.

3 Notation and organization

In Section 2 we explain our main results for Langevin Monte Carlo with L2(p)L^{2}(p)-accurate score estimate and use it to derive convergence bounds for the annealed LMC method of [SE19]. In Section 3, we give our main results for the predictor-corrector algorithms of [Son+20a] based on simulating reverse SDE’s. Our proofs are based on a common framework which we introduce in Section 4. Full proofs are in the appendix.

Results for Langevin dynamics with estimated score

We make the following assumptions on the density pp and the score estimate ss, which we will use throughout this paper.

ln⁡p\ln p is C1C^{1} and LL-smooth, that is, ∇ln⁡p\nabla\ln p is LL-Lipschitz. We assume L≥1L\geq 1.

pp satisfies a log-Sobolev inequality with constant CLSC_{\textup{LS}}. We assume CLS≥1C_{\textup{LS}}\geq 1.

We note that the uniform Lipschitzness assumption (1) helps ensure a unique strong solution to the Langevin diffusion, as in [BMR20]. One special case where one can prove Lipschitzness for all tt is when p0p_{0} is strongly log-concave [Lee+21, Lemma 28]. Although satisfying a log-Sobolev inequality (3) is a significant assumption, it is standard for analysis of Langevin Monte Carlo [VW19]. It is much weaker than assumptions in previous works [BMR20], including log-concave distributions and distributions satisfying strong dissipativity, and is stable under bounded perturbations. See Section E.1 for background on functional inequalities.

ss is a C1C^{1} function that is LsL_{s}-Lipschitz. We assume Ls≥1L_{s}\geq 1.

The error in the score estimate is bounded in L2L^{2}:

Our first main result gives an error bound between the sampled distribution and pp, assuming L2L^{2}-accurate score function estimate.

then running (LMC-SE) with score estimate ss, step size h=\Theta\Bigl{(}\frac{\varepsilon_{\chi}^{2}}{dL^{2}C_{\textup{LS}}}\Bigr{)}, and time T=\Theta\Bigl{(}C_{\textup{LS}}\ln\bigl{(}\frac{2K_{\chi}}{\varepsilon_{\chi}^{2}}\bigr{)}\Bigr{)} results in a distribution pTp_{T} such that pTp_{T} is εTV⁡\varepsilon_{\operatorname{TV}}-far in TV distance from a distribution p‾T\overline{p}_{T}, where p‾T\overline{p}_{T} satisfies χ2(p‾T∣∣p)≤εχ2.\chi^{2}(\overline{p}_{T}||p)\leq\varepsilon_{\chi}^{2}. In particular, taking εχ=εTV⁡\varepsilon_{\chi}=\varepsilon_{\operatorname{TV}}, we have the error guarantee that TV⁡(pT,p)≤2εTV⁡\operatorname{TV}(p_{T},p)\leq 2\varepsilon_{\operatorname{TV}}.

Note that the error bound is only achieved when running LMC for a moderate time; this is consistent with the fact that the stationary distribution of LMC with a L2L^{2}-score estimate can be arbitrarily far from pp. Note also that we need a warm start in χ2\chi^{2}-divergence: to obtain fixed errors εTV⁡,εχ\varepsilon_{\operatorname{TV}},\varepsilon_{\chi}, the required accuracy for the score estimate is inversely proportional to KχK_{\chi}. Intuitively, we must suffer from such a dependence because if the starting distribution is very far away, then there is no guarantee that ∥∇ln⁡p(xt)−s(xt)∥2\|\nabla\ln p(x_{t})-s(x_{t})\|^{2} is small on average during the sampling algorithm. Finally, although we can state a result purely in terms of TV distance, we need this more precise formulation to prove a result for annealed Langevin dynamics.

2 Annealed Langevin dynamics with estimated score

In light of the warm start requirement in Theorem 2.1, we typically cannot directly sample from pdatap_{\textup{data}} or its approximation. Hence, [SE19] proposed using annealed Langevin dynamics: consider a sequence of noise levels σN>⋯>σ1≈0\sigma_{N}>\cdots>\sigma_{1}\approx 0 giving rise to a sequence of distributions pσN2,…,pσ12≈pdatap_{\sigma_{N}^{2}},\ldots,p_{\sigma_{1}^{2}}\approx p_{\textup{data}}, where pσ2=p∗φσ2p_{\sigma^{2}}=p*\varphi_{\sigma^{2}}, φσ2\varphi_{\sigma^{2}} being the density of N(0,σ2Id)N(0,\sigma^{2}I_{d}). For large enough σN\sigma_{N}, φσN2≈pσN2\varphi_{\sigma_{N}^{2}}\approx p_{\sigma_{N}^{2}} provides a warm start to pσN2p_{\sigma_{N}^{2}}. We then successively run LMC using score estimates for pσk2p_{\sigma_{k}^{2}}, with the approximate sample for pσk2p_{\sigma_{k}^{2}} giving a warm start for pσk−12p_{\sigma_{k-1}^{2}}. We obtain the following algorithm and error estimate.

then x(1)x^{(1)} is a sample from a distribution qq such that TV⁡(q,pσ12)≤εTV⁡\operatorname{TV}(q,p_{\sigma_{1}^{2}})\leq\varepsilon_{\operatorname{TV}}.

Note that we assume a score estimate with error ε\varepsilon at all noise scales; this corresponds to using an objective function that is a maximum of the score-matching objective over all noise levels, rather than an average over all noise levels as more commonly used in practice. However, these two losses are at most a factor of MM apart.

The proof shows that the noise levels σk\sigma_{k} can be chosen as a geometric sequence, which matches the choice used in practice [SE20]. The additional dependence on dd and εTV⁡\varepsilon_{\operatorname{TV}} in Theorem 2.2 compared to Theorem 2.1 comes from requiring a sequence of O~(d)\widetilde{O}(\sqrt{d}) noise levels and an additional factor in χ2\chi^{2}-divergence we suffer at the beginning of each level mm. In the next section, we will find that using a reverse SDE to evolve the samples between the noise levels—called a predictor step—will improve the rate and time complexity.

Results for reverse SDE’s with estimated score

To improve the empirical performance of score-based generative modeling, [Son+20a] consider a general framework where noise is injected into a data distribution pdatap_{\textup{data}} via a forward SDE,

where x~0∼p~0:=pdata\widetilde{x}_{0}\sim\widetilde{p}_{0}:=p_{\textup{data}}. Let p~t\widetilde{p}_{t} denote the distribution of x~t\widetilde{x}_{t} (p~t\widetilde{p}_{t} is used instead of ptp_{t} to distinguish with the Gaussian-convolved distribution used in Annealed Langevin dynamics as in §2.2). Remarkably, x~t\widetilde{x}_{t} also satisfies a reverse-time SDE,

The case where f≡0f\equiv 0 and g≡1g\equiv 1 recovers the simple case of convolving with a Gaussian as used in §2.2; note, however that the reverse-time SDE differs from Langevin diffusion in having a larger (and time-varying) drift relative to the diffusion. [Son+20a] highlight the following two special cases. We will focus on DDPM while noting that our analysis applies more generically.

Score-matching Langevin diffusion: f≡0f\equiv 0. In this case, p~t=p~0∗φ∫0tg(s)2 ds\widetilde{p}_{t}=\widetilde{p}_{0}*\varphi_{\int_{0}^{t}g(s)^{2}\,ds}, so [Son+20a] call this a variance-exploding (VE) SDE. As is common for annealing-based algorithms, [SE19, Son+20a] suggest choosing an exponential schedule, so that g(t)=abtg(t)=ab^{t} for constants a,ba,b. We take pprior=N(0,∫0Tg(s)2 ds⋅Id)p_{\textup{prior}}=N(0,\int_{0}^{T}g(s)^{2}\,ds\cdot I_{d}).

Denoising diffusion probabilistic modeling: f(x,t)=−12g(t)2xf(x,t)=-\frac{1}{2}g(t)^{2}x. This is an Ornstein-Uhlenbeck process with time rescaling, p~t=M−12∫0tg(s)2 ds♯p~0∗φ1−e−∫0tg(s)2 ds\widetilde{p}_{t}=M_{-\frac{1}{2}\int_{0}^{t}g(s)^{2}\,ds\sharp}\widetilde{p}_{0}*\varphi_{1-e^{-\int_{0}^{t}g(s)^{2}\,ds}}, where Mα(x)=αxM_{\alpha}(x)=\alpha x. [Son+20a] call this a variance-preserving (VP) SDE, as the variance converges towards IdI_{d}. Because it displays exponential convergence towards N(0,Id)N(0,I_{d}), it can be run for a smaller amount of normalized time ∫0tg(s)2 ds\int_{0}^{t}g(s)^{2}\,ds. [Son+20a] suggest the choice g(t)=b+αtg(t)=\sqrt{b+\alpha t}. We take pprior=N(0,(1−e−∫0tg(s)2 ds)Id)≈N(0,Id)p_{\textup{prior}}=N(0,(1-e^{-\int_{0}^{t}g(s)^{2}\,ds})I_{d})\approx N(0,I_{d}).

To obtain an algorithm, we consider the following discretization and approximation of (4); note that in all cases of interest the integrals can be analytically evaluated. We reverse time so that tt corresponds to T−tT-t of the forward process. As we are free to rescale time in the SDE, we assume without loss of generality that the step sizes are constant. The predictor step is

running (4) starting from ppriorp_{\textup{prior}} for time T=Θ(ln⁡(CLSd)∨CLSln⁡(1εTV⁡))T=\Theta\left({\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}}\ln\left({\frac{1}{\varepsilon_{\operatorname{TV}}}}\right)}\right) and step size h=Θ(εTV⁡2CLS(CLS+d)(L∨Ls)2)h=\Theta\left({\frac{\varepsilon_{\operatorname{TV}}^{2}}{C_{\textup{LS}}(C_{\textup{LS}}+d)(L\vee L_{s})^{2}}}\right) results in a distribution qTq_{T} so that TV⁡(qT,pdata)≤εTV⁡\operatorname{TV}(q_{T},p_{\textup{data}})\leq\varepsilon_{\operatorname{TV}}.

A more precise statement of the Theorem can be found in the Appendix. Although we state our theorem for DDPM, we describe in Appendix C how it can be adapted to other SDE’s like SMLD and the sub-VP SDE; the primary SDE-dependent bound we need is a bound on ∇ln⁡p~tp~t+h\nabla\ln\frac{\widetilde{p}_{t}}{\widetilde{p}_{t+h}}. Because the predictor is tracking a changing distribution ptp_{t}, we incur more error terms and worse dependence on parameters (CLS,LC_{\textup{LS}},L) than in LMC (Theorem 2.1). Motivated by this, we intersperse the predictor steps with LMC steps—called corrector steps in this context—to give additional time for the process to mix, resulting in improved dependence on parameters.

Keep the setup of Theorem 3.1. Then for εTV⁡3=O(1(1+Ls/L)2(1+CLS/d)(ln⁡(CLSd)∨CLS))\varepsilon_{\operatorname{TV}}^{3}=O\left({\frac{1}{(1+L_{s}/L)^{2}(1+C_{\textup{LS}}/d)(\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}})}}\right), if

then Algorithm 2 with appropriate choices of T=Θ(ln⁡(CLSd)∨CLSlog⁡(1εTV⁡))T=\Theta\left({\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}}\log\left({\frac{1}{\varepsilon_{\operatorname{TV}}}}\right)}\right), NmN_{m}, corrector step sizes hmh_{m} and predictor step size hh, produces a sample from a distribution qTq_{T} such that TV⁡(qT,pdata)<εTV⁡\operatorname{TV}(q_{T},p_{\textup{data}})<\varepsilon_{\operatorname{TV}}.

The assumption on εTV⁡\varepsilon_{\operatorname{TV}} is for convenience in stating our bound. In comparison to using the predictor step alone (Theorem 3.1), note that in the bound on ε\varepsilon, we obtain the improved rate of the corrector step as in Theorem 2.1; this is because the predictor step only needs to track the actual distribution in χ2\chi^{2}-divergence with error O(1)O(1), and the final corrector steps are responsible for decreasing the error to εTV⁡\varepsilon_{\operatorname{TV}}. In comparison to the Annealed Langevin sampler (Algorithm 1, Theorem 2.2), which can be viewed as using the corrector step alone, adding a predictor step provides a better warm start for the distribution at the next smaller noise level, resulting in better dependence on parameters. Thus the predictor-corrector algorithm combines the strengths of the predictor and corrector steps. For real-world data, it can be challenging to estimate TV-distance between distributions given only samples, and hence difficult to check consistency with empirical observations. However, our claim that using a corrector can improve the convergence rate of DDPM/SMLD is consistent with the simulation results in Section 4.2 of [Son+20a].

Theoretical framework and proof sketches

The main idea of our analysis framework is to convert a L2L^{2} error guarantee to a L∞L^{\infty} error guarantee by excluding a bad set, formalized in the following theorem.

If Zk∈BkcZ_{k}\in B_{k}^{c} for all 0≤k≤n−10\leq k\leq n-1, then Zn=Z‾nZ_{n}=\overline{Z}_{n}. (For n=0n=0, this says Z0=Z‾0Z_{0}=\overline{Z}_{0}.)

χ2(q‾n∣∣pn)≤Dn2\chi^{2}(\overline{q}_{n}||p_{n})\leq D_{n}^{2}.

For our setting, we will take the “bad sets” BnB_{n} to be the set of xx where ∥sθ(x)−∇ln⁡p∥\left\|{s_{\theta}(x)-\nabla\ln p}\right\| is large, qnq_{n} to be the discretized process with estimated score, and q‾n\overline{q}_{n} to be the discretized process with estimated score except in BnB_{n} where the error is large. Because q‾n\overline{q}_{n} uses an L∞L^{\infty}-accurate score estimate, we can use existing techniques for analyzing Langevin Monte Carlo [VW19, EHZ21, Che+21] to bound χ2(q‾n∣∣pn)\chi^{2}(\overline{q}_{n}||p_{n}).

First note that if some Zk∈BkZ_{k}\in B_{k} for 0≤k≤n−10\leq k\leq n-1, then for the smallest such kk, we have Z‾k=Zk∈Bk\overline{Z}_{k}=Z_{k}\in B_{k}; the same is true if Z‾k∈Bk\overline{Z}_{k}\in B_{k} for some 0≤k≤n−10\leq k\leq n-1. We then bound using condition 1 and Cauchy-Schwarz:

The second inequality then follows from the triangle inequality and Cauchy-Schwarz:

It now remains to give χ2\chi^{2} convergence bounds under L∞L^{\infty}-accurate score estimate. The following theorem may be of independent interest.

Following [Che+21], we prove this by first defining a continuous-time interpolation qtq_{t} of the discrete process, and then deriving a differential inequality for χ2(qt∣∣p)\chi^{2}(q_{t}||p) using the log-Sobolev inequality for pp. Compared to [Che+21], we incur an extra error term arising from the inaccurate gradient.

This allows us to sketch the proof of Theorem 2.1; a complete proof is in Section B.

We first define the bad set where the error in the score estimate is large,

for some ε1\varepsilon_{1} to be chosen. Then by Chebyshev’s inequality, P(B)≤(εε1)2=:δP(B)\leq\left({\frac{\varepsilon}{\varepsilon_{1}}}\right)^{2}=:\delta. Let q‾nh\overline{q}_{nh} be the discretized process, but where the score estimate is set to be equal to ∇ln⁡p\nabla\ln p on BB; note it agrees with qnhq_{nh} as long as it has not hit BB. Because q‾nh\overline{q}_{nh} uses a score estimate that has L∞L^{\infty}-error ε1\varepsilon_{1}, Theorem 4.2 gives a bound for χ2(q‾Nh∣∣p)\chi^{2}(\overline{q}_{Nh}||p). Then Theorem 4.1 gives

The theorem then follows from choosing parameters so that χ2(q‾T∣∣p)≤εχ2\chi^{2}(\overline{q}_{T}||p)\leq\varepsilon_{\chi}^{2} and TV⁡(qT,q‾T)≤εTV⁡\operatorname{TV}(q_{T},\overline{q}_{T})\leq\varepsilon_{\operatorname{TV}}. ∎

We remark that the main inefficiency in the proof comes from the use of Chebyshev’s inequality, and a LpL^{p} bound on the error for p>2p>2 will improve the bound.

Choosing the sequence σ1<⋯<σM\sigma_{1}<\cdots<\sigma_{M} to be geometric with ratio 1+1d1+\frac{1}{\sqrt{d}} ensures that the χ2\chi^{2}-divergence between successive distributions pσm2p_{\sigma_{m}^{2}} is O(1)O(1). Then, choosing σM2=Ω(CLSd)\sigma_{M}^{2}=\Omega(C_{\textup{LS}}d) ensures we have a warm start for the highest noise level: χ2(pprior∣∣pσM2)=O(1)\chi^{2}(p_{\textup{prior}}||p_{\sigma_{M}^{2}})=O(1). This uses O(dlog⁡(dCLSσmin⁡2))O\left({\sqrt{d}\log\left({\frac{dC_{\textup{LS}}}{\sigma_{\min}^{2}}}\right)}\right) noise levels. Chebyshev’s inequality can be used to show that the distribution of the final sample x(m)x^{(m)} for pσm2p_{\sigma_{m}^{2}} is O(εTV⁡/M)O(\varepsilon_{\operatorname{TV}}/M) close to a distribution that is O(M/εTV⁡)O(M/\varepsilon_{\operatorname{TV}}) in χ2\chi^{2}-divergence from pσm+12p_{\sigma_{m+1}^{2}}. This gives the warm start parameter Kχ=(M/εTV⁡)1/2K_{\chi}=(M/\varepsilon_{\operatorname{TV}})^{1/2}; substituting into Theorem 2.1 then gives the required bound for ε\varepsilon. Note that the TV errors accrued from each level add to O(εTV⁡)O(\varepsilon_{\operatorname{TV}}). ∎

To analyze the predictor-based algorithms, we also first prove convergence bounds under L∞L^{\infty}-accurate score estimate.

Consider DDPM with g≡1g\equiv 1, T≥1∨ln⁡(CLSd)T\geq 1\vee\ln(C_{\textup{LS}}d), and h=O(1CLS(d+CLS)(L∨Ls)2)h=O\left({\frac{1}{C_{\textup{LS}}(d+C_{\textup{LS}})(L\vee L_{s})^{2}}}\right). (Recall that pkhp_{kh} and qkhq_{kh} are the kk-th iterate of LMC with step size hh and true/estimated score respectively.) Then

and if ε1<1128CLS\varepsilon_{1}<\frac{1}{128C_{\textup{LS}}},

Moreover, for q0=ppriorq_{0}=p_{\textup{prior}}, χ2(q0∣∣p0)≤e−T/2CLSd\chi^{2}(q_{0}||p_{0})\leq e^{-T/2}C_{\textup{LS}}d.

We give a more precise statement in Section C. Note that unlike the case for LMC as in Theorem 4.2, the base density ptp_{t} is also evolving in time, which produces additional error terms and necessitates a more involved analysis. The additional error terms can be bounded using the Donsker-Varadhan variational principle, concentration for distributions satisfying LSI, and error bounds between ptp_{t} and pt+hp_{t+h} for small hh.

Here, we only state the result about DDPM, which has better bounds than SMLD (when g≡1g\equiv 1) because both the forward and backwards processes exhibit better mixing properties: the warm start improves exponentially rather than inversely with TT, and the log-Sobolev constant is uniformly bounded by that of pdatap_{\textup{data}} rather than increasing. However, the analysis in Section C can be directly applied to SMLD and other models as well. We also note there is a sense in which DDPM and SMLD are equivalent under a rescaling in time and space (see discussion in Section C.2).

Note that the choice of hh is necessary for exponential decay of error; as if hh is not small enough, we would get an exponential growing instead of decaying factor in the one-step error (See Section C for details). Such an hh may however still be a suitable choice when used in conjunction with a corrector step. Moreover, as ε1→0\varepsilon_{1}\to 0, with appropriate choice of TT and hh, qNhq_{Nh} and pNhp_{Nh} can be made arbitrarily close.

Theorem 3.1 now follows from the L∞L^{\infty} result (Theorem 4.3) in the same way that Theorem 2.1 follows from Theorem 4.2.

To prove Theorem 3.2, it suffices to run the corrector steps only at the lowest noise level, that is, set Nm=0N_{m}=0 for 1≤m<T/h1\leq m<T/h, although we note that interleaving the predictor and corrector steps does empirically help with mixing. The proof follows from using the predictor and the corrector theorems in series: first apply Theorem 3.1 with εχ=O(1)\varepsilon_{\chi}=O(1) to show that the predictor results a warm start pdatap_{\textup{data}}, then use Theorem 2.1 to show the corrector reduces the error to the desired εTV⁡\varepsilon_{\operatorname{TV}}.

Conclusion

We introduced a general framework to analyze SDE-based sampling algorithms given a L2L^{2}-error score estimate, and used it to obtain the first convergence bounds for several score-based generative models with polynomial complexity in all parameters. Our analysis can potentially be adapted to other SDE’s and sampling algorithms beyond Langevin Monte Carlo. There is also room for improving our analysis to better use smoothing properties of the SDE’s and compare different choices of the diffusion speed gg.

We present several interesting further directions to explore. In addition to extending the analysis to other SGM’s and comparing their theoretical performance (relative to each other as well as other approaches to generative modeling), we propose the following.

Our assumption of a bounded log-Sobolev constant essentially limits the analysis to distributions that are close to unimodal. However, SGM’s are empirically successful at modeling multimodal distributions [SE19], and in fact perform better with multimodal distributions than other approaches such as GAN’s. Can we analyze the convergence for simple multimodal distributions, such as a mixture of distributions each with bounded log-Sobolev constant? Positive results on sampling from multimodal distributions such as [GLR18] suggest this is possible, as the sequence of noised distributions is natural for annealing and tempering methods (see [GLR18, Remark 7.2]).

Weakening conditions on the score estimate.

The assumption that we have a score estimate that is O(1)O(1)-accurate in L2L^{2}, although weaker than the usual assumptions for theoretical analysis, is in fact still a strong condition in practice that seems unlikely to be satisfied (and difficult to check) when learning complex distributions such as distributions of images. What would a reasonable weaker condition be, and in what sense can we still obtain reasonable samples?

Guarantees for learning the score function.

Our analysis assumes a L2L^{2}-estimate of the score function is given, but the question remains of when we can find such an estimate. What natural conditions on distributions allow their score functions to be learned by a neural network? Various works have considered the representability of data distributions by diffusion-like processes [TR19], but the questions of optimization and generalization appear more challenging.

Acknowledgements

We thank Andrej Risteski for helpful conversations. This work was done in part while HL was visiting the Simons Institute for the Theory of Computing. The work was supported in part by National Science Foundation via awards DMS-2012286 and CCF-1934964 (Duke Tripods).

References

Appendix A Computations

We start the proofs by collecting some preliminary results. In the following, we will consider the SDE

and the interpolation of the discretization of an approximation

when t≥t−t\geq t_{-}. Let PtP_{t} and QtQ_{t} denote the law of xtx_{t} and ztz_{t}, respectively. We will take t−=kht_{-}=kh and t∈[kh,(k+1)h)t\in[kh,(k+1)h). We will assume that f,f^,Gf,\widehat{f},G are continuous and the functions f(⋅,t)f(\cdot,t), f^(⋅,t)\widehat{f}(\cdot,t) are uniformly Lipschitz for each t∈[kh,(k+1)h]t\in[kh,(k+1)h].

In this section, we will make some computations that will be used in both Sections B and C. First, we derive how the density evolves in time.

Let QtQ_{t} denote the law of the interpolated process (8). Then

Let qt∣t−q_{t|t_{-}} denote the distribution of ztz_{t} conditioned on zt−z_{t_{-}}. Then the Fokker-Planck equation gives

Taking expectation with respect to zt−z_{t_{-}} we get

Note that for fixed zz, ∫qt−∣t(y∣z)dy=1\int q_{t_{-}|t}(y|z)dy=1. Hence

We now use Lemma A.1 to compute how the χ2\chi^{2}-divergence between the approximate and exact densities changes. The following generalizes the calculation of [EHZ21] in the case where xtx_{t} is a non-stationary stochastic process. For simplicity of notation, from now on, we wil consider the case G(t)G(t) being a scalar.

Let PtP_{t} and QtQ_{t} be the laws of (7) and (8) for G(t)=g(t)IdG(t)=g(t)I_{d}. Then

For the second term, using integration by parts,

Finally, we will make good use of the following lemma to bound the second term in Lemma A.2.

Appendix B Analysis for LMC

then running (LMC-SE) with score estimate ss and step size h=εχ22720dL2CLSh=\frac{\varepsilon_{\chi}^{2}}{2720dL^{2}C_{\textup{LS}}} for any time T∈[Tmin⁡,CTTmin⁡]T\in[T_{\min},C_{T}T_{\min}], where Tmin⁡=4CLSln⁡(2Kχεχ2)T_{\min}=4C_{\textup{LS}}\ln\left({\frac{2K_{\chi}}{\varepsilon_{\chi}^{2}}}\right), results in a distribution pTp_{T} such that pTp_{T} is εTV⁡\varepsilon_{\operatorname{TV}}-far in TV distance from a distribution p‾T\overline{p}_{T}, where p‾T\overline{p}_{T} satisfies χ2(p‾T∣∣p)≤εχ2.\chi^{2}(\overline{p}_{T}||p)\leq\varepsilon_{\chi}^{2}. In particular, taking εχ=εTV⁡\varepsilon_{\chi}=\varepsilon_{\operatorname{TV}}, we have the error guarantee that TV⁡(pT,p)=2εTV⁡\operatorname{TV}(p_{T},p)=2\varepsilon_{\operatorname{TV}}.

The main difficulty is that the stationary distribution of LMC using the score estimate may be arbitrarily far from pp, even if the L2L^{2} error of the score estimate is bounded. (See Section D.) Thus, a long-time convergence result does not hold, and an upper bound on TT is required, as in the theorem statement.

We instead proceed by showing that conditioned on not hitting a bad set, if we run LMC using ss, the χ2\chi^{2}-divergence to the stationary distribution will decrease. This means that the closeness of the overall distribution (in TV distance, say) will decrease in the short term, despite it will increase in the long term, as the probability of hitting the bad set increases. This does not contradict the fact that the stationary distribution is different from pp. By running for a moderate amount of time (just enough for mixing), we can ensure that the probability of hitting the bad set is small, so that the resulting distribution is close to pp. Note that we state the theorem with a CTC_{T} parameter to allow a range of times that we can run LMC for.

More precisely, we prove Theorem B.1 in two steps.

Defining a bad set and bounding the hitting time (Section B.2).

The idea is now to reduce to the case of L∞L^{\infty} error by defining the “bad set” BB to be the set where ∥s−∇f∥≥ε1\left\|{s-\nabla f}\right\|\geq\varepsilon_{1}, where ε≪ε1≪1\varepsilon\ll\varepsilon_{1}\ll 1. This set has small measure by Chebyshev’s inequality. Away from the bad set, Theorem 4.2 applies; it then suffices to bound the probability of hitting BB. Technically, we define a coupling with a hypothetical process where the L∞L^{\infty} error is always bounded, and note that the processes disagree exactly when it hits BB; this is the source of the TV error.

We consider the probability of being in BB at times 0,h,2h,…0,h,2h,\ldots. we note that Theorem B.1 bounds the χ2\chi^{2}-divergence of this hypothetical process XtX_{t} at time tt to pp. If the distribution were actually pp, then the probability Xt∈B′X_{t}\in B^{\prime} is exactly p(B′)p(B^{\prime}); we expect the probability to be small even if the distribution is close to pp. Indeed, by Cauchy-Schwarz, we can bound the probability X∈BX\in B in terms of P(B)P(B) and χ2(qt∣∣p)\chi^{2}(q_{t}||p); this bound is given in Theorem 4.1. Note that the eventual bound depends on χ2(qt∣∣p)\chi^{2}(q_{t}||p), so we have to assume a warm start, that is, a reasonable bound on χ2(q0∣∣p)\chi^{2}(q_{0}||p).

The following gives a long-time convergence bound for LMC with inaccurate gradient, with error bounded in L∞L^{\infty}; this may be of independent interest.

See 4.2 Following [Che+21], convergence in Rényi divergence can also be derived; we only consider χ2\chi^{2}-divergence because we will need a warm start in χ2\chi^{2}-divergence for our application. Note that by letting N→∞N\to\infty and h→0h\to 0, we obtain the following.

Keep the assumptions in Theorem 4.2. The stationary distribution qq of Langevin diffusion with score estimate ss satisfies

We follow the proof of [Che+21, Theorem 4], except that we work with the χ2\chi^{2} divergence directly, rather than the Rényi divergence, and have an extra term from the inaccurate gradient (17). Given t≥0t\geq 0, let t−=h⌊th⌋t_{-}=h\left\lfloor\frac{t}{h}\right\rfloor. Define the interpolated process by

and let qtq_{t} denote the distribution of XtX_{t} at time tt, when X0∼q0X_{0}\sim q_{0}.

where A1,A2,A3A_{1},A_{2},A_{3} are obtained by substituting in the 3 terms in (13), and given in (15), (16), and (17). Let V(x)=−ln⁡p(x)V(x)=-\ln p(x). We consider each term in turn.

when h2≤1288L2h^{2}\leq\frac{1}{288L^{2}}. By [Che+21, p. 15]

when h≤11536L2CLSh\leq\frac{1}{1536L^{2}C_{\textup{LS}}}. Finally,

Combining (12), (14), (15), (16), and (17) gives

if h≤(112⋅72dL3CLS)1/2∧112⋅336dCLSh\leq\left({\frac{1}{12\cdot 72dL^{3}C_{\textup{LS}}}}\right)^{1/2}\wedge\frac{1}{12\cdot 336dC_{\textup{LS}}} and ε1≤(148CLS)1/2\varepsilon_{1}\leq\left({\frac{1}{48C_{\textup{LS}}}}\right)^{1/2}. Then for t∈[kh,(k+1)h)t\in[kh,(k+1)h),

using h≤1122Lh\leq\frac{1}{12\sqrt{2}L}. Unfolding the recurrence and summing the geometric series gives

when h≤11360dL2CLSh\leq\frac{1}{1360dL^{2}C_{\textup{LS}}} and ε12≤140CLS\varepsilon_{1}^{2}\leq\frac{1}{40C_{\textup{LS}}}. We can check that the given condition on hh and the fact that LCLS≥1LC_{\textup{LS}}\geq 1 (Lemma E.5) imply all the required inequalities on hh. ∎

B.2 Proof of Theorem B.1

We first define the bad set where the error in the score estimate is large,

Given t≥0t\geq 0, let t−=h⌊th⌋t_{-}=h\left\lfloor\frac{t}{h}\right\rfloor. Given a bad set BB, define the interpolated process by

In other words, run LMC using the score estimate as long as the point is in the good set at the previous discretization step, and otherwise use the actual gradient ∇ln⁡p\nabla\ln p. Let q‾t\overline{q}_{t} denote the distribution of z‾t\overline{z}_{t} when z‾0∼q0\overline{z}_{0}\sim q_{0}; note that qnhq_{nh} is the distribution resulting from running LMC with estimate bb for nn steps and step size hh. Note that this auxiliary process is defined only for purposes of analysis; it cannot be used for practical algorithm as we do not have access to ∇f\nabla f.

We can couple this process with LMC using ss so that as long as XtX_{t} does not hit BB, the processes agree, thus satisfying condition 1 of Theorem 4.1.

For this to be bounded by εχ2\varepsilon_{\chi}^{2}, it suffices for the terms to be bounded by εχ22,εχ24,εχ24\frac{\varepsilon_{\chi}^{2}}{2},\frac{\varepsilon_{\chi}^{2}}{4},\frac{\varepsilon_{\chi}^{2}}{4}; this is implied by

(We choose hh so that the condition in Theorem 4.2 is satisfied; note εχ≤1\varepsilon_{\chi}\leq 1.) By Theorem 4.1,

In order for this to be ≤εTV⁡\leq\varepsilon_{\operatorname{TV}}, it suffices for

Supposing that we run for time TT where Tmin⁡≤T≤CTTmin⁡T_{\min}\leq T\leq C_{T}T_{\min}, we have that N=Th≤CTTmin⁡hN=\frac{T}{h}\leq\frac{C_{T}T_{\min}}{h}. Thus it suffices for

B.3 Proof of Theorem 2.2

We restate the theorem for convenience. See 2.2

Choose the sequence σmin⁡2=σ12<⋯<σM2\sigma_{\min}^{2}=\sigma_{1}^{2}<\cdots<\sigma_{M}^{2} to be geometric with ratio 1+Θ(1d)1+\Theta\left({\frac{1}{\sqrt{d}}}\right). Note that

For σ22=(1+ε)σ12\sigma_{2}^{2}=(1+\varepsilon)\sigma_{1}^{2}, this equals (1+ε)−d/2(1−ε)−d/2=(1−ε2)−d/2−1(1+\varepsilon)^{-d/2}(1-\varepsilon)^{-d/2}=(1-\varepsilon^{2})^{-d/2}-1. For ε=Θ(1d)\varepsilon=\Theta\left({\frac{1}{\sqrt{d}}}\right), this is d⋅O(1d)=O(1)d\cdot O\left({\frac{1}{d}}\right)=O(1). Hence, the χ2\chi^{2}-divergence between successive distributions pσm2p_{\sigma_{m}^{2}} is O(1)O(1). Choosing σM2=Ω(d(M1+CLS))\sigma_{M}^{2}=\Omega(d(M_{1}+C_{\textup{LS}})) ensures we have a warm start for the highest noise level by Lemma E.9: χ2(pprior∣∣pσM2)=O(1)\chi^{2}(p_{\textup{prior}}||p_{\sigma_{M}^{2}})=O(1). This uses O(dlog⁡(dCLSσmin⁡2))O\left({\sqrt{d}\log\left({\frac{dC_{\textup{LS}}}{\sigma_{\min}^{2}}}\right)}\right) noise levels.

Write pm=pσm2p_{m}=p_{\sigma_{m}^{2}} for short. Let qmq_{m} be the distribution of the final sample x(m)x^{(m)}. We show by downwards induction on mm that there is q‾m\overline{q}_{m} such that

For m=Mm=M, this follows from the assumption on ε\varepsilon and Theorem 2.1 with Kχ=O(1)K_{\chi}=O(1) (given by the warm start).

Fix m<Mm<M and suppose it holds for m+1m+1. We use the closeness between qm+1q_{m+1} and pm+1p_{m+1} combined with χ2(pm+1∣∣pm)=O(1)\chi^{2}(p_{m+1}||p_{m})=O(1) to obtain compute how close qm+1q_{m+1} and pmp_{m} are. Because the triangle inequality does not hold for χ2\chi^{2}, we will incur an extra TV error.

Let q‾m,m+1\overline{q}_{m,m+1} be the distribution of the final sample if x0(m+1)∼q‾mx^{(m+1)}_{0}\sim\overline{q}_{m}. We have TV⁡(qm+1,q‾m,m+1)≤TV⁡(qm,q‾m)≤(M+1)−mM+1εTV⁡\operatorname{TV}(q_{m+1},\overline{q}_{m,m+1})\leq\operatorname{TV}(q_{m},\overline{q}_{m})\leq\frac{(M+1)-m}{M+1}\varepsilon_{\operatorname{TV}}.

By Markov’s inequality, when χ2(pm+1∣∣pm)≤1\chi^{2}(p_{m+1}||p_{m})\leq 1,

so q‾m+1,m≤2q‾m+1\overline{q}_{m+1,m}\leq 2\overline{q}_{m+1} and

Let q‾m+1,m′\overline{q}_{m+1,m}^{\prime} be the distribution of xNm(m)x_{N_{m}}^{(m)} when x0(m)∼q‾m+1,mx_{0}^{(m)}\sim\overline{q}_{m+1,m}. Then by assumption on ε\varepsilon (3) and Theorem 2.1 (with Kχ=4M+1εTV⁡K_{\chi}={4\sqrt{\frac{M+1}{\varepsilon_{\operatorname{TV}}}}}, εχ=εTV⁡4(M+1)\varepsilon_{\chi}=\frac{\varepsilon_{\operatorname{TV}}}{4(M+1)}, and εTV⁡←εTV⁡2(M+1)\varepsilon_{\operatorname{TV}}\leftarrow\frac{\varepsilon_{\operatorname{TV}}}{2(M+1)}), there is q‾m\overline{q}_{m} such that TV⁡(q‾m,m+1′,q‾m)≤εTV⁡2(M+1)\operatorname{TV}(\overline{q}_{m,m+1}^{\prime},\overline{q}_{m})\leq\frac{\varepsilon_{\operatorname{TV}}}{2(M+1)} and χ2(q‾m∣∣pm)≤εTV⁡4(M+1)\chi^{2}(\overline{q}_{m}||p_{m})\leq{\frac{\varepsilon_{\operatorname{TV}}}{4(M+1)}}. It remains to bound

where we use (19) in the last line. This finishes the induction step.

Finally, the theorem follows by taking m=1m=1 and noting

Appendix C Analysis for SGM based on reverse SDE’s

In this section, we analyze score-based generative models based on reverse SDE’s. In Section C.2, we prove convergence of the predictor algorithm under L∞L^{\infty}-accurate score estimate (Theorem 4.3, restated as C.1) using lemmas proved in Section C.3, C.4, C.5, and C.6. In Section C.7, we prove convergence of the predictor algorithm under L2L^{2}-accurate score estimate (Theorem 3.1, restated as C.16). In Section C.8, we prove convergence of the predictor-corrector algorithm (Theorem 3.2).

With a change of variable in (4), we define the sampling process xtx_{t} on [0,T][0,T] by

where h=T/Nh=T/N is the step size and ηk\eta_{k} is a sequence of independent Gaussian random vectors. As we run (20) from to NN with hh small enough, we should expect that the distribution of zTz_{T} is close to that of xTx_{T}. However, in both SMLD or DDPM models, for fixed zkz_{k}, the integration

can be exactly computed, as can the diffusion term. Therefore, we can consider the following process ztz_{t} as an “interpolation” of (20):

Note that by running this process instead, we can reduce the discretization error. Now if we denote the distribution of ztz_{t} by qtq_{t}, with q0≈p0q_{0}\approx p_{0}, we can expect that qTq_{T} is close to pTp_{T}. Here the estimated score ss satisfies for all xx

Observe that in either SMLD or DDPM, the function g(t)2g(t)^{2} is Lipschitz on [0,T][0,T]. So in the following sections, we will assume that g(t)2g(t)^{2} is LgL_{g}-Lipschitz on [0,T][0,T].

C.2 Predictor

In this section, we present the main result (Theorem C.1) on the one-step error of the predictor in χ2\chi^{2}-divergence, which can be obtained by directly applying the Gronwall’s inequality to the differential inequality derived in Lemma C.3. Note that Theorem C.1 is a more precise version of Theorem 4.3; see the remark following the theorem.

With the setting in Section C.1, assume gg is non-decreasing and let

where CtC_{t} is the log-Sobolev constant of ptp_{t}, bounded in Lemma E.7. Suppose that ∇ln⁡pt\nabla\ln p_{t} is LL-Lipschitz for all t∈[kh,(k+1)h]t\in[kh,(k+1)h], s(⋅,kh)s(\cdot,kh) is LsL_{s}-Lipschitz, L,Ls≥1L,L_{s}\geq 1, and εkh\varepsilon_{kh} is such that (22) holds. Then

are defined in (24), (30), (33), (35) and (36), respectively.

The theorem follows from applying Gronwall’s inequality to the result of Lemma C.3. ∎

Remark. Note that in DDPM, E=O(Ls2+L2d)E=O(L_{s}^{2}+L^{2}d). Therefore, when g≡1g\equiv 1, Ct,kh=O(ε12+(Ls2+L2d)h)C_{t,kh}=O(\varepsilon_{1}^{2}+(L_{s}^{2}+L^{2}d)h), where we denote the upper bound of εkh\varepsilon_{kh} for all k∈{0,...,N}k\in\{0,...,N\} by ε1\varepsilon_{1}. Using the bound on the log-Sobolev constant (Lemma E.7) and second moment (Lemma E.8) for DDPM, we note that the restriction on hh for all steps is implied by

with appropriate constants. Then we can conclude the first inequality in Theorem 4.3 by combining Theorem C.1 and Lemma E.7 and the second inequality from unfolding the first one and evaluating the geometric series. Likewise, we have the following analogue for SMLD, for which we omit the proof.

and letting t=T−Nht=T-Nh, if ε1<1128CT\varepsilon_{1}<\frac{1}{128C_{T}},

Moreover, for q0=ppriorq_{0}=p_{\textup{prior}}, q0=φTq_{0}=\varphi_{T}, χ2(q0∣∣p0)≤CLSdT\chi^{2}(q_{0}||p_{0})\leq\frac{C_{\textup{LS}}d}{T}.

Remark. We note that in a sense SMLD and DDPM are equivalent, as we can get from one to the other by rescaling in time and space. First we recall that, as discussed in Section 3, all the SMLD models are equivalent under rescaling in time. Therefore we can assume g(t)=et/2g(t)=e^{t/2} and consider the forward SDE for SMLD

where wtw_{t} is a standard Brownian Motion. Now let yt=e−t/2xty_{t}=e^{-t/2}x_{t}; then

which is exactly DDPM with g(t)=1g(t)=1. Note that Theorem C.2 uses a different parameterization for SMLD and the resulting complexity is slightly worse.

C.3 Differential Inequality

Now we prove a differential inequality involving χ2(qt∣∣pt)\chi^{2}(q_{t}||p_{t}). As in [Che+21], the key difficulty is to bound the discretization error. We decompose it into two error terms and bound them in Lemma C.4 and Lemma C.5 separately.

Let (qt)0≤t≤T(q_{t})_{0\leq t\leq T} denote the law of the interpolation (21). With the setting in Lemma C.1, we have for t∈[kh,(k+1)h]t\in[kh,(k+1)h],

where CtC_{t} is the LSI constant of ptp_{t}, εkh\varepsilon_{kh} is the L∞L^{\infty}-score estimation error at time khkh and EE is defined in (24).

Using the fact that ptp_{t} satisfies a log-Sobolev inequality with constant CtC_{t},

In the setting of Lemma C.3, we have the following bound for term AA:

In SMLD, f(x,t)=0f(x,t)=0 and hence A=0A=0; while in DDPM, f(x,t)=−12g(t)2xf(x,t)=-\frac{1}{2}g(t)^{2}x. Therefore, by Lemma A.3,

In the setting of Lemma C.3, we have the following bound for term BB:

Now we bound these error terms separately. For B1B_{1}, by the Lipschitz assumption, we have by Lemma A.3, for a constant C2>0C_{2}>0 to be chosen later,

For B2B_{2}, recalling the assumption that ∥s(x,T−kh)−∇ln⁡pkh(x)∥≤εkh\left\|{s(x,T-kh)-\nabla\ln p_{kh}(x)}\right\|\leq\varepsilon_{kh} for all xx, we have by Lemma A.3

Now for the last error term B3B_{3}, we have by Lemma A.3 that

where Ct,LC_{t,L} and Cd,LC_{d,L} are constants defined in (30) and (33) respectively. Hence

Combining all these results, we finally obtain the bound for error term BB in Lemma C.3: for h≤164Ct,Lg(T−kh)2h\leq\frac{1}{64C_{t,L}g(T-kh)^{2}},

C.4 Change of Measure

Define the Langevin diffusion w.r.t. p(x)p(x):

Rearrange this inequality to obtain the desired result. ∎

In the setting of Lemma C.3, it holds that

Applying Lemma C.6 to the density ψtqt\psi_{t}q_{t} yields

Note that we cannot expect analogous results for a general u(x)u(x) as in Lemma C.6. In the general case, we apply the Donsker-Varadhan variational principle, which states that for probability measures pp and qq,

Towards this end, we first need to analyze KL⁡(ψtqt∣∣pt)\operatorname{KL}(\psi_{t}q_{t}||p_{t}).

Since ptp_{t} satisfies LSI with constant CtC_{t},

With this in hand, we are ready to bound the second moment of ψtqt\psi_{t}q_{t} as well as the variance of a Gaussian random vector with respect to this measure:

where CtC_{t} is the LSI constant of ptp_{t}, which is bounded in Lemma E.6, and the second moment of ptp_{t} is bounded in Lemma E.8.

Since ptp_{t} has LSI constant CtC_{t}, by Donsker-Varadhan variational principle,

for any s>0s>0. By Lemma E.1, for any s∈[0,1Ct)s\in[0,\frac{1}{C_{t}}), we have

Now with the bound of KL⁡(ψtqt∣∣pt)\operatorname{KL}(\psi_{t}q_{t}||p_{t}) in Lemma C.8, we obtain

where CtC_{t} is the LSI constant of ptp_{t}.

Note that ∫khtg(T−s)dws\int_{kh}^{t}g(T-s)dw_{s} is a Gaussian random vector with variance ∫khtg(T−s)2ds⋅Id\int_{kh}^{t}g(T-s)^{2}ds\cdot I_{d}. Using the Donsker-Varadhan variational principle, for any random variable XX,

where the last inequality is due to Lemma C.8. We have proved

C.5 Perturbation Error

where px,σ2p_{x,\sigma^{2}} denotes the probability density

where y∗∈argmax⁡ypx,σ2(y)y^{*}\in\operatorname{argmax}_{y}p_{x,\sigma^{2}}(y) is a mode of the distribution px,σ2p_{x,\sigma^{2}}. We now bound each of these terms.

For the first term, note that px,σ2p_{x,\sigma^{2}} is (1σ2−L)\left({\frac{1}{\sigma^{2}}-L}\right)-strongly convex, so satisfies a Poincaré inequality with constant (1σ2−L)−1\left({\frac{1}{\sigma^{2}}-L}\right)^{-1}. Thus

For the second term, by Lemma E.3, noting that V(y)+∥x−y∥22σ2V(y)+\frac{\left\|{x-y}\right\|^{2}}{2\sigma^{2}} is (1σ2+L)\left({\frac{1}{\sigma^{2}}+L}\right)-smooth,

where the last inequality uses σ2≤12L\sigma^{2}\leq\frac{1}{2L}.

For the third term, we note that the mode satisfies

Putting these together and using (1σ2−L)−1≤2\left({\frac{1}{\sigma^{2}}-L}\right)^{-1}\leq 2, we obtain

With the setting in Lemma C.11 and the notation pα(x)=αdp(αx)p_{\alpha}(x)=\alpha^{d}p(\alpha x) for α≥1\alpha\geq 1, we have that for L≤12α2σ2L\leq\frac{1}{2\alpha^{2}\sigma^{2}},

Without loss of generality, we can assume that p(x)=e−V(x)p(x)=e^{-V(x)}; then pα(x)=αde−V(αx)p_{\alpha}(x)=\alpha^{d}e^{-V(\alpha x)}. Hence

Since α∇V(αx)\alpha\nabla V(\alpha x) is α2L\alpha^{2}L-Lipschitz, by Lemma C.11,

The result follows from combining the three inequalities above. ∎

In the setting of Lemma C.3, we have for t∈[kh,(k+1)h]t\in[kh,(k+1)h],

In both SMLD and DDPM models, we have the following relationship for t∈[kh,(k+1)h]t\in[kh,(k+1)h]:

where pα(x)=αdp(αx)p_{\alpha}(x)=\alpha^{d}p(\alpha x). In SMLD, α=1\alpha=1 and σ2=∫khtg(T−s)2 ds\sigma^{2}=\int_{kh}^{t}g(T-s)^{2}\,ds, while in DDPM, α=e12∫khtg(T−s)2 ds\alpha=e^{\frac{1}{2}\int_{kh}^{t}g(T-s)^{2}\,ds} and σ2=1−e−∫khtg(T−s)2 ds\sigma^{2}=1-e^{-\int_{kh}^{t}g(T-s)^{2}\,ds}. Now for SMLD,

where in the last inequality we use the fact that gg is increasing, so that for h≤14Lg(T−kh)2h\leq\frac{1}{4Lg(T-kh)^{2}},

Recall that to use Lemma C.11, it suffices that L≤12α2σ2L\leq\frac{1}{2\alpha^{2}\sigma^{2}}, and so it suffices that h≤14Lg(T−kh)2h\leq\frac{1}{4Lg(T-kh)^{2}} in SMLD.

For DDPM, observe that for h≤14g(T−kh)2h\leq\frac{1}{4g(T-kh)^{2}},

By Lemma C.12, using the assumption that L≥1L\geq 1, we obtain

C.6 Auxiliary Lemmas

With the setting of Lemma C.3, we have the following bound of the second moment of estimated score function with respect to ψtqt\psi_{t}q_{t}:

where Ct,LC_{t,L} and Cd,LC_{d,L} are constants defined in Lemma C.13.

Recall that we need to bound this second moment of estimated score function with respect to ψtqT\psi_{t}q_{T}. For the first term, as ∥s(x.T−kh)−∇ln⁡pkh(x)∥\left\|{s(x.T-kh)-\nabla\ln p_{kh}(x)}\right\| is εkh\varepsilon_{kh}-bounded, we have trivial bound that

By Lemma C.13, the second term is bounded by

for constant Ct,LC_{t,L} and Cd,LC_{d,L} defined in (30) and (33) respectively. The last term is bounded in Corollary C.7 by

Combining these three inequalities, we obtain that for h≤1g(T−kh)2h\leq\frac{1}{g(T-kh)^{2}},

where the next-to-last line is due to the fact that the estimated score function is LsL_{s}-Lipschitz. We also use the fact that g(t)g(t) is an increasing function and hence g(T−t)≤g(T−kh)g(T-t)\leq g(T-kh) for any t∈[kh,(k+1)h]t\in[kh,(k+1)h]. Hence if h≤13(Ls+1/2)g(T−kh)2h\leq\frac{1}{3(L_{s}+1/2)g(T-kh)^{2}}, then

Therefore, by the fact that (a+b)2≤2a2+2b2(a+b)^{2}\leq 2a^{2}+2b^{2} for any a,b>0a,b>0,

With the results of Lemma C.14 and Lemma C.9, we have

Now plugging this and the result of Lemma C.10 into (34), we get that

C.7 Proof of Theorem 3.1

We state a more precise version of Theorem 3.1. The structure of the proof is similar to that of Theorem 2.1.

running (4) starting from ppriorp_{\textup{prior}} for time T=Θ(ln⁡(CLSd)∨CLSln⁡(1εTV⁡))T=\Theta\left({\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}}\ln\left({\frac{1}{\varepsilon_{\operatorname{TV}}}}\right)}\right) and step size h=Θ(εχ2CLS(CLS+d)(L∨Ls)2)h=\Theta\left({\frac{\varepsilon_{\chi}^{2}}{C_{\textup{LS}}(C_{\textup{LS}}+d)(L\vee L_{s})^{2}}}\right) results in a distribution qTq_{T} such that qTq_{T} is εTV⁡\varepsilon_{\operatorname{TV}}-far in TV distance from a distribution q‾T\overline{q}_{T}, where q‾T\overline{q}_{T} satisfies χ2(q‾T∣∣pdata)≤εχ2\chi^{2}(\overline{q}_{T}||p_{\textup{data}})\leq\varepsilon_{\chi}^{2}. In particular, taking εχ=εTV⁡\varepsilon_{\chi}=\varepsilon_{\operatorname{TV}}, we have TV⁡(qT∣∣pdata)≤2εTV⁡\operatorname{TV}(q_{T}||p_{\textup{data}})\leq 2\varepsilon_{\operatorname{TV}}.

We first define the bad sets where the error in the score estimate is large,

Given t≥0t\geq 0, let t−=h⌊th⌋t_{-}=h\left\lfloor\frac{t}{h}\right\rfloor. Given a bad set BB, define the interpolated process by

In other words, simulate the reverse SDE using the score estimate as long as the point is in the good set (for the current ptp_{t}) at the previous discretization step, and otherwise use the actual gradient ∇ln⁡pt\nabla\ln p_{t}. Let q‾t\overline{q}_{t} denote the distribution of z‾t\overline{z}_{t} when z‾0∼q0\overline{z}_{0}\sim q_{0}; note that qnhq_{nh} is the distribution resulting from running LMC with estimate bb for nn steps and step size hh. Note that this process is defined only for purposes of analysis, as we do not have access to ∇ln⁡pt\nabla\ln p_{t}.

We can couple this process with the predictor algorithm using ss so that as long as xmh∉Bmhx_{mh}\not\in B_{mh}, the processes agree, thus satisfying condition 1 of Theorem 4.1.

Let T=NhT=Nh, and let Kχ=χ2(q0∣∣p0)K_{\chi}=\chi^{2}(q_{0}||p_{0}). Then by Theorem 4.3,

For this to be bounded by εχ2\varepsilon_{\chi}^{2}, it suffices for the terms to be bounded by εχ22,εχ24,εχ24\frac{\varepsilon_{\chi}^{2}}{2},\frac{\varepsilon_{\chi}^{2}}{4},\frac{\varepsilon_{\chi}^{2}}{4}; this is implied by

(We choose hh so that the condition in Theorem 4.3 is satisfied; note εχ≤1\varepsilon_{\chi}\leq 1.) By Theorem 4.1,

In order for this to be ≤εTV⁡\leq\varepsilon_{\operatorname{TV}}, it suffices for

Supposing that we run for time T=Θ(Tmin⁡)T=\Theta(T_{\min}), we have that n=Th=O(CTTmin⁡h)n=\frac{T}{h}=O\left({\frac{C_{T}T_{\min}}{h}}\right). Thus it suffices for

Finally, note that for T=Ω(ln⁡(CLSd))T=\Omega(\ln(C_{\textup{LS}}d)), we have Kχ=O(1)K_{\chi}=O(1) by Lemma E.9. Substituting Kχ=O(1)K_{\chi}=O(1) then gives the desired bound. ∎

C.8 Proof of Theorem 3.2

We now prove the main theorem on the predictor-corrector algorithm with L2L^{2}-accurate score estimate.

For simplicity, we consider the predictor-corrector algorithm in the case where all the corrector steps are at the end (but see the discussion following the proof for the general case). The result will follow from chaining together the guarantee on the predictor algorithm (Theorem C.16) and LMC (Theorem 2.1).

Let M=T/hM=T/h. We take h=Θ(1(L∨Ls)2CLS(CLS+d))h=\Theta\left({\frac{1}{(L\vee L_{s})^{2}C_{\textup{LS}}(C_{\textup{LS}}+d)}}\right), number of corrector steps N0=⋯=NT/h−1=0N_{0}=\cdots=N_{T/h-1}=0 and NM=Tc/hMN_{M}=T_{\text{c}}/h_{M}, where Tc=Θ(CLSln⁡(2εχ2))T_{\text{c}}=\Theta\left({C_{\textup{LS}}\ln\left({\frac{2}{\varepsilon_{\chi}^{2}}}\right)}\right) and hM=Θ(εχ2dL2CLS)h_{M}=\Theta\left({\frac{\varepsilon_{\chi}^{2}}{dL^{2}C_{\textup{LS}}}}\right). Let the distribution of zT,0z_{T,0} be qT,0q_{T,0}. By Theorem C.16, if T=Θ(ln⁡(CLSd)∨CLSln⁡(1/εTV⁡))T=\Theta(\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}}\ln(1/\varepsilon_{\operatorname{TV}})), then

then there exists q‾T,0\overline{q}_{T,0} such that TV⁡(qT,0,q‾T,0)=εTV⁡/2\operatorname{TV}(q_{T,0},\overline{q}_{T,0})=\varepsilon_{\operatorname{TV}}/2 and χ2(q‾T,0∣∣pdata)=1\chi^{2}(\overline{q}_{T,0}||p_{\textup{data}})=1. Then using Theorem 2.1 with εTV⁡←εTV⁡/2\varepsilon_{\operatorname{TV}}\leftarrow\varepsilon_{\operatorname{TV}}/2 and Kχ=1K_{\chi}=1, plus the triangle inequality gives that if

then there is q‾T\overline{q}_{T} such that TV⁡(qT,q‾T)=εTV⁡\operatorname{TV}(q_{T},\overline{q}_{T})=\varepsilon_{\operatorname{TV}} and χ2(q‾T∣∣pdata)=εχ2\chi^{2}(\overline{q}_{T}||p_{\textup{data}})=\varepsilon_{\chi}^{2}. Finally, setting εTV⁡,εχ←εTV⁡/2\varepsilon_{\operatorname{TV}},\varepsilon_{\chi}\leftarrow\varepsilon_{\operatorname{TV}}/2 gives TV⁡(qT,pdata)≤εTV⁡\operatorname{TV}(q_{T},p_{\textup{data}})\leq\varepsilon_{\operatorname{TV}}.

We note that for εTV⁡3=O(1(1+Ls/L)2(1+CLS/d)(ln⁡(CLSd)∨CLS))\varepsilon_{\operatorname{TV}}^{3}=O\left({\frac{1}{(1+L_{s}/L)^{2}(1+C_{\textup{LS}}/d)(\ln(C_{\textup{LS}}d)\vee C_{\textup{LS}})}}\right), the second condition on ε\varepsilon is more constraining, giving the theorem. ∎

We can also analyze a setting where predictor and corrector steps are interleaved; for instance, if N=1N=1, then interleaving the one-step inequalities in Theorem 4.2 and 4.3 gives a recurrence

we can then follow the proof of Theorem 3.1. While this does not improve the parameter dependence under the assumptions of Theorem 3.2, it can potentially allow for larger step sizes (beyond what is allowed by Theorem 3.1), as error accrued in the predictor step can be exponentially damped by the corrector step.

Appendix D Stationary distribution of LD with score estimate can be arbitrarily far away

We show that the stationary distribution of Langevin dynamics with L2L^{2}-accurate score estimate can be arbitrarily far from the true distribution. We can construct a counterexample even in one dimension, and take the true distribution as a standard Gaussian p(x)=12πe−x2/2p(x)=\frac{1}{\sqrt{2\pi}}e^{-x^{2}/2}. We will take the score estimate to also be in the form ∇ln⁡q\nabla\ln q, so that the stationary distribution of LMC with the score estimate is qq. The main idea of the construction is to set qq to disagree with pp only in the tail of pp, where it has a large mode; this error will fail to be detected under L2(p)L^{2}(p).

Let pp be the density function of N(0,1)N(0,1). There exists an absolute constant CC such that given any ε>0\varepsilon>0, there exists a distribution qq such that

Take a smooth non-negative function gg supported on $,with, with\max\lvert g^{\prime\prime}\rvert\leq candandg(0)=1.Weconsiderafamilyofdistributionsfor. We consider a family of distributions forL>0$ with density

Thus the score function for qLq_{L} is given by

We compute the L2(p)L^{2}(p) error between the score functions associated with pp and qLq_{L}.

where in the first inequality we have used that g(2L(x−L))g(\frac{2}{L}(x-L)) has support [L2,3L2][\frac{L}{2},\frac{3L}{2}], since gg has support $.Thusthe. Thus theL^{2}(p)−errorofthescorefunctiongoestoas-error of the score function goes to asL\to\infty$.

the distribution qLq_{L} satisfies the required smoothness (Lipschitz score) assumption. Note that qLq_{L} has a large mode concentrated at x=Lx=L as

while pp has vanishing density there, which is in fact the reason that L2(p)L^{2}(p)-loss of the score estimate is not able to detect the difference between the two distributions. As the height (and width) of the mode becomes arbitrarily large compared to x=0x=0, we have qL([L2,3L2])→1q_{L}([\frac{L}{2},\frac{3L}{2}])\to 1, whereas pL([L2,3L2])→0p_{L}([\frac{L}{2},\frac{3L}{2}])\to 0. Hence TV⁡(pL,qL)→1\operatorname{TV}(p_{L},q_{L})\to 1. ∎

Appendix E Useful facts

In this section, we collect some facts and technical lemmas used throughout the paper.

Alternatively, for any C1C^{1} function ff,

We say that a log-Sobolev inequality (LSI) holds with constant CLSC_{\textup{LS}} if for any probability measure qq,

We call the Poincaré constant and log-Sobolev constant the smallest CPC_{\textup{P}}, CLSC_{\textup{LS}} for which the inequalities hold for all qq. If pp satisfies a log-Sobolev inequality with constant, then pp satisfies a Poincaré inequality with the same constant; hence the Poincaré constant is at most the log-Sobolev constant, CP≤CLSC_{\textup{P}}\leq C_{\textup{LS}}. If p∝e−Vp\propto e^{-V} is α\alpha-strongly log-concave, that is, V⪰αIdV\succeq\alpha I_{d}, then pp satisfies a log-Sobolev inequality with constant 1/α1/\alpha.

We collect some properties of distributions satisfying LSI or PI.

Suppose that μ\mu satisfies a log-Sobolev inequality with constant CLSC_{\textup{LS}}. Let ff be a 1-Lipschitz function. Then

(Sub-gaussian concentration) For any t∈[0,1CLS)t\in\left[0,\frac{1}{C_{\textup{LS}}}\right),

Suppose that μ\mu satisfies a log-Sobolev inequality with constant CLSC_{\textup{LS}}. Let ff be a LL-Lipschitz function. Then

Suppose the dd-dimensional gaussian N(0,Σ)N(0,\Sigma) has density γ\gamma. Let p=h⋅γp=h\cdot\gamma be a probability density.

If hh is log-concave, and gg is convex, then

By the Poincaré inequality and Lemma E.4(2), since pp is equal to the density of N(0,1LId)N(0,\frac{1}{L}I_{d}) multiplied by a log-convex function,

E.2 Lemmas on SMLD and DDPM

We give bounds on several quantities associated with the SMLD and DDPM processes at time tt: the log-Sobolev constants (Lemma E.7), the second moment (Lemma E.8), and the warm start parameter (Lemma E.9).

First, we note that for SMLD and DDPM, the conditional distribution of x~t\widetilde{x}_{t} given x~0\widetilde{x}_{0} is

Let p~tSMLD\widetilde{p}^{\textup{SMLD}}_{t} and p~tDDPM\widetilde{p}^{\textup{DDPM}}_{t} denote the distribution of the SMLD/DDPM processes at time tt, when started at p0p_{0}. Let CLSC_{\textup{LS}} be the log-Sobolev constant of p0p_{0}. Then

Note that the analogous statement for the Poincaré constant CPC_{\textup{P}} holds for Lemma E.6 and E.7.

Note that if μ\mu has log-Sobolev constant CLSC_{\textup{LS}} and TT is a smooth LL-Lipschitz map, then T#μT_{\#}\mu has log-Sobolev constant ≤L2CLS\leq L^{2}C_{\textup{LS}}. Applying Lemma E.6 to (40) and (41) then finishes the proof. ∎

Hence, letting σSMLD2=∫0tg(s)2 ds\sigma_{\textup{SMLD}}^{2}=\int_{0}^{t}g(s)^{2}\,ds and σDDPM2=1−e−∫0tg(s)2 ds\sigma_{\textup{DDPM}}^{2}=1-e^{-\int_{0}^{t}g(s)^{2}\,ds},

Using the fact that χ2(N(0,Σ2)∣∣N(0,Σ1))=∣Σ1∣1/2∣Σ2∣∣(2Σ2−1−Σ1−1)∣−12−1\chi^{2}(N(0,\Sigma_{2})||N(0,\Sigma_{1}))=\frac{|\Sigma_{1}|^{1/2}}{|\Sigma_{2}|}|(2\Sigma_{2}^{-1}-\Sigma_{1}^{-1})|^{-\frac{1}{2}}-1, we have