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 with density is defined as the gradient of the log-pdf, . 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 . SGM consists of two steps: first, learning an estimate of the score function for a sequence of “noisy” versions of the data distribution , 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 . For , let the resulting distributions be and the distributions conditional on the starting data point be . Typically, is chosen so that and is close to some “prior” distribution that is easy to sample from, such as . While the score 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 where . The objective is represented and optimized within an expressive function class, typically neural networks, to obtain a -estimate of the score, that is, such that
The reason we estimate the score function is that there are a variety of sampling algorithms—based on simulating SDE’s—that can sample from given access to , including Langevin Monte Carlo and Hamiltonian Monte Carlo. The second step is then to use the estimated score function in lieu of the exact gradient in the sampling algorithm to successively obtain samples from . This sequence interpolates smoothly between the prior distribution (e.g., ) and the data distribution ; 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 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 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 . This poses a significant challenge for analysis, as the stationary distribution of Langevin diffusion with -accurate gradient can be arbitrarily far from (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 -accurate gradients. First, they show using uniform generalization bounds that optimizing the de-noising autoencoder (DAE) objective does in fact give a -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 where 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 -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 -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 . 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 -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 -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 and the score estimate , which we will use throughout this paper.
is and -smooth, that is, is -Lipschitz. We assume .
satisfies a log-Sobolev inequality with constant . We assume .
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 is when 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.
is a function that is -Lipschitz. We assume .
The error in the score estimate is bounded in :
Our first main result gives an error bound between the sampled distribution and , assuming -accurate score function estimate.
then running (LMC-SE) with score estimate , 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 such that is -far in TV distance from a distribution , where satisfies In particular, taking , we have the error guarantee that .
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 -score estimate can be arbitrarily far from . Note also that we need a warm start in -divergence: to obtain fixed errors , the required accuracy for the score estimate is inversely proportional to . Intuitively, we must suffer from such a dependence because if the starting distribution is very far away, then there is no guarantee that 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 or its approximation. Hence, [SE19] proposed using annealed Langevin dynamics: consider a sequence of noise levels giving rise to a sequence of distributions , where , being the density of . For large enough , provides a warm start to . We then successively run LMC using score estimates for , with the approximate sample for giving a warm start for . We obtain the following algorithm and error estimate.
then is a sample from a distribution such that .
Note that we assume a score estimate with error 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 apart.
The proof shows that the noise levels can be chosen as a geometric sequence, which matches the choice used in practice [SE20]. The additional dependence on and in Theorem 2.2 compared to Theorem 2.1 comes from requiring a sequence of noise levels and an additional factor in -divergence we suffer at the beginning of each level . 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 via a forward SDE,
where . Let denote the distribution of ( is used instead of to distinguish with the Gaussian-convolved distribution used in Annealed Langevin dynamics as in §2.2). Remarkably, also satisfies a reverse-time SDE,
The case where and 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: . In this case, , 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 for constants . We take .
Denoising diffusion probabilistic modeling: . This is an Ornstein-Uhlenbeck process with time rescaling, , where . [Son+20a] call this a variance-preserving (VP) SDE, as the variance converges towards . Because it displays exponential convergence towards , it can be run for a smaller amount of normalized time . [Son+20a] suggest the choice . We take .
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 corresponds to 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 for time and step size results in a distribution so that .
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 . Because the predictor is tracking a changing distribution , we incur more error terms and worse dependence on parameters () 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 , if
then Algorithm 2 with appropriate choices of , , corrector step sizes and predictor step size , produces a sample from a distribution such that .
The assumption on is for convenience in stating our bound. In comparison to using the predictor step alone (Theorem 3.1), note that in the bound on , 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 -divergence with error , and the final corrector steps are responsible for decreasing the error to . 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 error guarantee to a error guarantee by excluding a bad set, formalized in the following theorem.
If for all , then . (For , this says .)
.
For our setting, we will take the “bad sets” to be the set of where is large, to be the discretized process with estimated score, and to be the discretized process with estimated score except in where the error is large. Because uses an -accurate score estimate, we can use existing techniques for analyzing Langevin Monte Carlo [VW19, EHZ21, Che+21] to bound .
First note that if some for , then for the smallest such , we have ; the same is true if for some . 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 convergence bounds under -accurate score estimate. The following theorem may be of independent interest.
Following [Che+21], we prove this by first defining a continuous-time interpolation of the discrete process, and then deriving a differential inequality for using the log-Sobolev inequality for . 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 to be chosen. Then by Chebyshev’s inequality, . Let be the discretized process, but where the score estimate is set to be equal to on ; note it agrees with as long as it has not hit . Because uses a score estimate that has -error , Theorem 4.2 gives a bound for . Then Theorem 4.1 gives
The theorem then follows from choosing parameters so that and . ∎
We remark that the main inefficiency in the proof comes from the use of Chebyshev’s inequality, and a bound on the error for will improve the bound.
Choosing the sequence to be geometric with ratio ensures that the -divergence between successive distributions is . Then, choosing ensures we have a warm start for the highest noise level: . This uses noise levels. Chebyshev’s inequality can be used to show that the distribution of the final sample for is close to a distribution that is in -divergence from . This gives the warm start parameter ; substituting into Theorem 2.1 then gives the required bound for . Note that the TV errors accrued from each level add to . ∎
To analyze the predictor-based algorithms, we also first prove convergence bounds under -accurate score estimate.
Consider DDPM with , , and . (Recall that and are the -th iterate of LMC with step size and true/estimated score respectively.) Then
and if ,
Moreover, for , .
We give a more precise statement in Section C. Note that unlike the case for LMC as in Theorem 4.2, the base density 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 and for small .
Here, we only state the result about DDPM, which has better bounds than SMLD (when ) because both the forward and backwards processes exhibit better mixing properties: the warm start improves exponentially rather than inversely with , and the log-Sobolev constant is uniformly bounded by that of 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 is necessary for exponential decay of error; as if 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 may however still be a suitable choice when used in conjunction with a corrector step. Moreover, as , with appropriate choice of and , and can be made arbitrarily close.
Theorem 3.1 now follows from the 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 for , 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 to show that the predictor results a warm start , then use Theorem 2.1 to show the corrector reduces the error to the desired .
Conclusion
We introduced a general framework to analyze SDE-based sampling algorithms given a -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 .
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 -accurate in , 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 -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 . Let and denote the law of and , respectively. We will take and . We will assume that are continuous and the functions , are uniformly Lipschitz for each .
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 denote the law of the interpolated process (8). Then
Let denote the distribution of conditioned on . Then the Fokker-Planck equation gives
Taking expectation with respect to we get
Note that for fixed , . Hence
We now use Lemma A.1 to compute how the -divergence between the approximate and exact densities changes. The following generalizes the calculation of [EHZ21] in the case where is a non-stationary stochastic process. For simplicity of notation, from now on, we wil consider the case being a scalar.
Let and be the laws of (7) and (8) for . 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 and step size for any time , where , results in a distribution such that is -far in TV distance from a distribution , where satisfies In particular, taking , we have the error guarantee that .
The main difficulty is that the stationary distribution of LMC using the score estimate may be arbitrarily far from , even if the error of the score estimate is bounded. (See Section D.) Thus, a long-time convergence result does not hold, and an upper bound on 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 , the -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 . 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 . Note that we state the theorem with a 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 error by defining the “bad set” to be the set where , where . 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 . Technically, we define a coupling with a hypothetical process where the error is always bounded, and note that the processes disagree exactly when it hits ; this is the source of the TV error.
We consider the probability of being in at times . we note that Theorem B.1 bounds the -divergence of this hypothetical process at time to . If the distribution were actually , then the probability is exactly ; we expect the probability to be small even if the distribution is close to . Indeed, by Cauchy-Schwarz, we can bound the probability in terms of and ; this bound is given in Theorem 4.1. Note that the eventual bound depends on , so we have to assume a warm start, that is, a reasonable bound on .
The following gives a long-time convergence bound for LMC with inaccurate gradient, with error bounded in ; this may be of independent interest.
See 4.2 Following [Che+21], convergence in Rényi divergence can also be derived; we only consider -divergence because we will need a warm start in -divergence for our application. Note that by letting and , we obtain the following.
Keep the assumptions in Theorem 4.2. The stationary distribution of Langevin diffusion with score estimate satisfies
We follow the proof of [Che+21, Theorem 4], except that we work with the divergence directly, rather than the Rényi divergence, and have an extra term from the inaccurate gradient (17). Given , let . Define the interpolated process by
and let denote the distribution of at time , when .
where are obtained by substituting in the 3 terms in (13), and given in (15), (16), and (17). Let . We consider each term in turn.
when . By [Che+21, p. 15]
when . Finally,
Combining (12), (14), (15), (16), and (17) gives
if and . Then for ,
using . Unfolding the recurrence and summing the geometric series gives
when and . We can check that the given condition on and the fact that (Lemma E.5) imply all the required inequalities on . ∎
B.2 Proof of Theorem B.1
We first define the bad set where the error in the score estimate is large,
Given , let . Given a bad set , 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 . Let denote the distribution of when ; note that is the distribution resulting from running LMC with estimate for steps and step size . 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 .
We can couple this process with LMC using so that as long as does not hit , the processes agree, thus satisfying condition 1 of Theorem 4.1.
For this to be bounded by , it suffices for the terms to be bounded by ; this is implied by
(We choose so that the condition in Theorem 4.2 is satisfied; note .) By Theorem 4.1,
In order for this to be , it suffices for
Supposing that we run for time where , we have that . Thus it suffices for
B.3 Proof of Theorem 2.2
We restate the theorem for convenience. See 2.2
Choose the sequence to be geometric with ratio . Note that
For , this equals . For , this is . Hence, the -divergence between successive distributions is . Choosing ensures we have a warm start for the highest noise level by Lemma E.9: . This uses noise levels.
Write for short. Let be the distribution of the final sample . We show by downwards induction on that there is such that
For , this follows from the assumption on and Theorem 2.1 with (given by the warm start).
Fix and suppose it holds for . We use the closeness between and combined with to obtain compute how close and are. Because the triangle inequality does not hold for , we will incur an extra TV error.
Let be the distribution of the final sample if . We have .
By Markov’s inequality, when ,
so and
Let be the distribution of when . Then by assumption on (3) and Theorem 2.1 (with , , and ), there is such that and . It remains to bound
where we use (19) in the last line. This finishes the induction step.
Finally, the theorem follows by taking 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 -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 -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 on by
where is the step size and is a sequence of independent Gaussian random vectors. As we run (20) from to with small enough, we should expect that the distribution of is close to that of . However, in both SMLD or DDPM models, for fixed , the integration
can be exactly computed, as can the diffusion term. Therefore, we can consider the following process 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 by , with , we can expect that is close to . Here the estimated score satisfies for all
Observe that in either SMLD or DDPM, the function is Lipschitz on . So in the following sections, we will assume that is -Lipschitz on .
C.2 Predictor
In this section, we present the main result (Theorem C.1) on the one-step error of the predictor in -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 is non-decreasing and let
where is the log-Sobolev constant of , bounded in Lemma E.7. Suppose that is -Lipschitz for all , is -Lipschitz, , and 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, . Therefore, when , , where we denote the upper bound of for all by . 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 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 , if ,
Moreover, for , , .
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 and consider the forward SDE for SMLD
where is a standard Brownian Motion. Now let ; then
which is exactly DDPM with . 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 . 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 denote the law of the interpolation (21). With the setting in Lemma C.1, we have for ,
where is the LSI constant of , is the -score estimation error at time and is defined in (24).
Using the fact that satisfies a log-Sobolev inequality with constant ,
In the setting of Lemma C.3, we have the following bound for term :
In SMLD, and hence ; while in DDPM, . Therefore, by Lemma A.3,
In the setting of Lemma C.3, we have the following bound for term :
Now we bound these error terms separately. For , by the Lipschitz assumption, we have by Lemma A.3, for a constant to be chosen later,
For , recalling the assumption that for all , we have by Lemma A.3
Now for the last error term , we have by Lemma A.3 that
where and are constants defined in (30) and (33) respectively. Hence
Combining all these results, we finally obtain the bound for error term in Lemma C.3: for ,
C.4 Change of Measure
Define the Langevin diffusion w.r.t. :
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 yields
Note that we cannot expect analogous results for a general as in Lemma C.6. In the general case, we apply the Donsker-Varadhan variational principle, which states that for probability measures and ,
Towards this end, we first need to analyze .
Since satisfies LSI with constant ,
With this in hand, we are ready to bound the second moment of as well as the variance of a Gaussian random vector with respect to this measure:
where is the LSI constant of , which is bounded in Lemma E.6, and the second moment of is bounded in Lemma E.8.
Since has LSI constant , by Donsker-Varadhan variational principle,
for any . By Lemma E.1, for any , we have
Now with the bound of in Lemma C.8, we obtain
where is the LSI constant of .
Note that is a Gaussian random vector with variance . Using the Donsker-Varadhan variational principle, for any random variable ,
where the last inequality is due to Lemma C.8. We have proved
C.5 Perturbation Error
where denotes the probability density
where is a mode of the distribution . We now bound each of these terms.
For the first term, note that is -strongly convex, so satisfies a Poincaré inequality with constant . Thus
For the second term, by Lemma E.3, noting that is -smooth,
where the last inequality uses .
For the third term, we note that the mode satisfies
Putting these together and using , we obtain
With the setting in Lemma C.11 and the notation for , we have that for ,
Without loss of generality, we can assume that ; then . Hence
Since is -Lipschitz, by Lemma C.11,
The result follows from combining the three inequalities above. ∎
In the setting of Lemma C.3, we have for ,
In both SMLD and DDPM models, we have the following relationship for :
where . In SMLD, and , while in DDPM, and . Now for SMLD,
where in the last inequality we use the fact that is increasing, so that for ,
Recall that to use Lemma C.11, it suffices that , and so it suffices that in SMLD.
For DDPM, observe that for ,
By Lemma C.12, using the assumption that , 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 :
where and are constants defined in Lemma C.13.
Recall that we need to bound this second moment of estimated score function with respect to . For the first term, as is -bounded, we have trivial bound that
By Lemma C.13, the second term is bounded by
for constant and defined in (30) and (33) respectively. The last term is bounded in Corollary C.7 by
Combining these three inequalities, we obtain that for ,
where the next-to-last line is due to the fact that the estimated score function is -Lipschitz. We also use the fact that is an increasing function and hence for any . Hence if , then
Therefore, by the fact that for any ,
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 for time and step size results in a distribution such that is -far in TV distance from a distribution , where satisfies . In particular, taking , we have .
We first define the bad sets where the error in the score estimate is large,
Given , let . Given a bad set , 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 ) at the previous discretization step, and otherwise use the actual gradient . Let denote the distribution of when ; note that is the distribution resulting from running LMC with estimate for steps and step size . Note that this process is defined only for purposes of analysis, as we do not have access to .
We can couple this process with the predictor algorithm using so that as long as , the processes agree, thus satisfying condition 1 of Theorem 4.1.
Let , and let . Then by Theorem 4.3,
For this to be bounded by , it suffices for the terms to be bounded by ; this is implied by
(We choose so that the condition in Theorem 4.3 is satisfied; note .) By Theorem 4.1,
In order for this to be , it suffices for
Supposing that we run for time , we have that . Thus it suffices for
Finally, note that for , we have by Lemma E.9. Substituting then gives the desired bound. ∎
C.8 Proof of Theorem 3.2
We now prove the main theorem on the predictor-corrector algorithm with -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 . We take , number of corrector steps and , where and . Let the distribution of be . By Theorem C.16, if , then
then there exists such that and . Then using Theorem 2.1 with and , plus the triangle inequality gives that if
then there is such that and . Finally, setting gives .
We note that for , the second condition on is more constraining, giving the theorem. ∎
We can also analyze a setting where predictor and corrector steps are interleaved; for instance, if , 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 -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 . We will take the score estimate to also be in the form , so that the stationary distribution of LMC with the score estimate is . The main idea of the construction is to set to disagree with only in the tail of , where it has a large mode; this error will fail to be detected under .
Let be the density function of . There exists an absolute constant such that given any , there exists a distribution such that
Take a smooth non-negative function supported on $\max\lvert g^{\prime\prime}\rvert\leq cg(0)=1L>0$ with density
Thus the score function for is given by
We compute the error between the score functions associated with and .
where in the first inequality we have used that has support , since has support $L^{2}(p)L\to\infty$.
the distribution satisfies the required smoothness (Lipschitz score) assumption. Note that has a large mode concentrated at as
while has vanishing density there, which is in fact the reason that -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 , we have , whereas . Hence . ∎
Appendix E Useful facts
In this section, we collect some facts and technical lemmas used throughout the paper.
Alternatively, for any function ,
We say that a log-Sobolev inequality (LSI) holds with constant if for any probability measure ,
We call the Poincaré constant and log-Sobolev constant the smallest , for which the inequalities hold for all . If satisfies a log-Sobolev inequality with constant, then satisfies a Poincaré inequality with the same constant; hence the Poincaré constant is at most the log-Sobolev constant, . If is -strongly log-concave, that is, , then satisfies a log-Sobolev inequality with constant .
We collect some properties of distributions satisfying LSI or PI.
Suppose that satisfies a log-Sobolev inequality with constant . Let be a 1-Lipschitz function. Then
(Sub-gaussian concentration) For any ,
Suppose that satisfies a log-Sobolev inequality with constant . Let be a -Lipschitz function. Then
Suppose the -dimensional gaussian has density . Let be a probability density.
If is log-concave, and is convex, then
By the Poincaré inequality and Lemma E.4(2), since is equal to the density of 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 : 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 given is
Let and denote the distribution of the SMLD/DDPM processes at time , when started at . Let be the log-Sobolev constant of . Then
Note that the analogous statement for the Poincaré constant holds for Lemma E.6 and E.7.
Note that if has log-Sobolev constant and is a smooth -Lipschitz map, then has log-Sobolev constant . Applying Lemma E.6 to (40) and (41) then finishes the proof. ∎
Hence, letting and ,
Using the fact that , we have