HyperAIHyperAI

Command Palette

Search for a command to run...

Diffusion Model

High-Accuracy Sampling for Diffusion Models and Log-Concave Distributions

Fan Chen Sinho Chewi Constantinos Daskalakis Alexander Rakhlin

Abstract

We present algorithms for diffusion model sampling which obtain δ\deltaδ-error in polylog(1/δ\deltaδ) steps, given access to O~(δ)\widetilde{O}(\delta)O(δ)-accurate score estimates in L2L^{2}L2. This is an exponential improvement over all previous results. Specifically, under minimal data assumptions, the complexity is O~(dpolylog(1/δ))\widetilde{O}(d\text{polylog}(1/\delta))O(dpolylog(1/δ)) where d is the dimension of the data; under a non-uniform L-Lipschitz condition, the complexity is O~(dLpolylog(1/δ))\widetilde{O}(\sqrt{dL}\text{polylog}(1/\delta))O(dL​polylog(1/δ)); and if the data distribution has intrinsic dimension d⋆d_{\star}d⋆​, then the complexity reduces to O~(d⋆polylog(1/δ))\widetilde{O}(d_{\star}\text{polylog}(1/\delta))O(d⋆​polylog(1/δ)). Our approach also yields the first polylog(1/δ\deltaδ) complexity sampler for general log-concave distributions using only gradient evaluations.

One-sentence Summary

Diffusion model sampling algorithms are proposed that achieve δ\deltaδ-error in polylog(1/δ)\text{polylog}(1/\delta)polylog(1/δ) steps given O~(δ)\widetilde{O}(\delta)O(δ)-accurate score estimates in L2L^{2}L2, yielding an exponential improvement over prior work with complexity O~(d⋆polylog(1/δ))\widetilde{O}(d_{\star}\text{polylog}(1/\delta))O(d⋆​polylog(1/δ)) under intrinsic dimension d⋆d_{\star}d⋆​ and providing the first polylog(1/δ)\text{polylog}(1/\delta)polylog(1/δ) complexity sampler for general log-concave distributions using only gradient evaluations.

Key Contributions

  • The work gives diffusion sampling algorithms that reach δ\deltaδ error in polylog⁡(1/δ)\operatorname{polylog}(1/\delta)polylog(1/δ) steps when provided with O~(δ)\widetilde{O}(\delta)O(δ)-accurate score estimates in L2L^{2}L2, yielding O~(dpolylog⁡(1/δ))\widetilde{O}(d\operatorname{polylog}(1/\delta))O(dpolylog(1/δ)) complexity under minimal data assumptions and an exponential improvement in dependence on target accuracy over previous results.

  • The approach samples from the Bayes-rule diffusion transition rather than relying only on Gaussian DDPM updates, and the resulting guarantees remain robust to score estimation error while giving O~(dLpolylog⁡(1/δ))\widetilde{O}(\sqrt{dL}\operatorname{polylog}(1/\delta))O(dL​polylog(1/δ)) complexity under a non-uniform LLL-Lipschitz condition and O~(d⋆polylog⁡(1/δ))\widetilde{O}(d_{\star}\operatorname{polylog}(1/\delta))O(d⋆​polylog(1/δ)) complexity when the data have intrinsic dimension d⋆d_{\star}d⋆​.

  • The framework also produces the first polylog⁡(1/δ)\operatorname{polylog}(1/\delta)polylog(1/δ)-complexity sampler for general log-concave distributions using only gradient evaluations.

Introduction

The authors study the complexity of sampling from continuous distributions when only evaluations of the gradient of the log-density are available, a setting central to diffusion-based generative models because these models learn score functions rather than unnormalized densities. This matters because fast convergence, ideally with iteration counts scaling polylog(1/delta) in the target accuracy, would allow high-accuracy generation without excessive score queries. Prior work faces a key limitation: score-only diffusion samplers typically rely on stochastic differential equation discretizations, whose discretization error prevents high-accuracy guarantees and leads to polynomial or only modestly subpolynomial dependence on 1/delta, while existing polylog-type results require density evaluations or stronger assumptions. The authors address this by introducing first-order rejection sampling, a meta-algorithm that simulates rejection sampling using only first-order queries, and show that it yields high-accuracy polylogarithmic guarantees for diffusion sampling under minimal data assumptions, with additional refinements for Lipschitz scores, low intrinsic dimension, and log-concave sampling.

Method

The method is organized around a reusable sampling primitive designed to sample from a tilted Gaussian target without direct access to the density value. The core target has the form

ν(x)∝exp⁡(−f(x)−∥x−x0∥22η),\nu(x)\propto \exp\left(-f(x)-\frac{\|x-x_0\|^2}{2\eta}\right),ν(x)∝exp(−f(x)−2η∥x−x0​∥2​),

where the algorithm is allowed to query only first order information about fff. In the diffusion sampling setting, one chooses f=−log⁡ptf=-\log p_tf=−logpt​ and replaces −∇f-\nabla f−∇f by a score estimate. The main challenge is to perform rejection sampling against a Gaussian proposal while avoiding expensive integration or evaluation of fff itself.

The authors introduce a first order rejection sampling module. The abstract task is to sample from a target

p^(x)∝q(x)exp⁡(w(x)),\widehat p(x)\propto q(x)\exp(w(x)),p​(x)∝q(x)exp(w(x)),

where qqq is a proposal distribution and w(x)w(x)w(x) is not directly evaluable. Instead, for each xxx, the sampler can draw random variables W1,W2,…W_1,W_2,\ldotsW1​,W2​,… such that

E[Wi∣x]=w(x).\mathbb{E}[W_i\mid x]=w(x).E[Wi​∣x]=w(x).

The key observation is that an unbiased estimator of w(x)w(x)w(x) is enough to simulate the required Bernoulli acceptance probability. This is a Bernoulli factory construction. If the random variables are bounded after clipping, say in [−B,B][-B,B][−B,B], the acceptance step can be performed using a Poissonized product of scaled unbiased estimates. The resulting sampler outputs a point with law approximately proportional to

q(x)exp⁡(E[Wi∣x]),q(x)\exp(\mathbb{E}[W_i\mid x]),q(x)exp(E[Wi​∣x]),

and the expected number of drawn estimators grows on the order of

O(Be2B(T+log⁡(1/δ)))O\left(Be^{2B}(T+\log(1/\delta))\right)O(Be2B(T+log(1/δ)))

over TTT calls, up to constant factors, with probability at least 1−δ1-\delta1−δ.

For a Gaussian tilt, the first order rejection sampling module is instantiated by constructing a Gaussian proposal from a local linear approximation of fff. Choose a point x+x_+x+​ and form

q(x)∝exp⁡(−⟨x−x+,∇f(x+)⟩−12η∥x−x0∥2).q(x)\propto \exp\left(-\langle x-x_+,\nabla f(x_+)\rangle-\frac{1}{2\eta}\|x-x_0\|^2\right).q(x)∝exp(−⟨x−x+​,∇f(x+​)⟩−2η1​∥x−x0​∥2).

Equivalently, if

x^=x0−η∇f(x+),\widehat x=x_0-\eta\nabla f(x_+),x=x0​−η∇f(x+​),

then the proposal can be taken as

q=N(x^,ηI).q=\mathsf N(\widehat x,\eta I).q=N(x,ηI).

The residual log tilt between ν\nuν and qqq can be written as a path integral of gradient differences. In the simplest form,

log⁡ν(x)−log⁡q(x)−const=∫01⟨x−x+,∇f(x+)−∇f(rx+(1−r)x+)⟩ dr.\log \nu(x)-\log q(x)-\mathrm{const} = \int_0^1 \langle x-x_+,\nabla f(x_+)-\nabla f(rx+(1-r)x_+)\rangle\,dr.logν(x)−logq(x)−const=∫01​⟨x−x+​,∇f(x+​)−∇f(rx+(1−r)x+​)⟩dr.

This suggests the unbiased estimator

Wr,x=⟨x−x+,∇f(x+)−∇f(rx+(1−r)x+)⟩,W_{r,x} = \langle x-x_+,\nabla f(x_+)-\nabla f(rx+(1-r)x_+)\rangle,Wr,x​=⟨x−x+​,∇f(x+​)−∇f(rx+(1−r)x+​)⟩,

where r∼Unif(0,1)r\sim\mathrm{Unif}(0,1)r∼Unif(0,1). In practice the estimator is clipped to a fixed interval:

W^r,x=Clip⁡B(Wr,x),\widehat W_{r,x}=\operatorname{Clip}_B(W_{r,x}),Wr,x​=ClipB​(Wr,x​),

with B=Θ(1)B=\Theta(1)B=Θ(1). If ∇f\nabla f∇f is β\betaβ Lipschitz, then

∣Wr,x∣≤β∥x−x+∥2.|W_{r,x}|\le \beta\|x-x_+\|^2.∣Wr,x​∣≤β∥x−x+​∥2.

Therefore, when the Gaussian proposal is well centered near the anchor and the step size is sufficiently small, the clipped estimator is bounded with high probability.

A more refined construction uses a general path integral. Fix a random shift distribution for zzz and a path γz,r(x)\gamma_{z,r}(x)γz,r​(x) satisfying γz,1(x)=x\gamma_{z,1}(x)=xγz,1​(x)=x and γz,0(x)\gamma_{z,0}(x)γz,0​(x) independent of xxx. Then for a smooth function hhh,

h(x)−Ez∼P[h(γz,0)]=Ez∼P,r∼Unif⟨γ˙z,r(x),∇h(γz,r(x))⟩,h(x)-\mathbb{E}_{z\sim P}[h(\gamma_{z,0})] = \mathbb{E}_{z\sim P,r\sim\mathrm{Unif}} \langle \dot\gamma_{z,r}(x),\nabla h(\gamma_{z,r}(x))\rangle,h(x)−Ez∼P​[h(γz,0​)]=Ez∼P,r∼Unif​⟨γ˙​z,r​(x),∇h(γz,r​(x))⟩,

where γ˙z,r(x)=ddrγz,r(x)\dot\gamma_{z,r}(x)=\frac{d}{dr}\gamma_{z,r}(x)γ˙​z,r​(x)=drd​γz,r​(x). This leads to the path estimator

Wr,z,x=⟨γ˙z,r(x),∇f(x+)−∇f(γz,r(x))⟩.W_{r,z,x} = \langle \dot\gamma_{z,r}(x), \nabla f(x_+)-\nabla f(\gamma_{z,r}(x))\rangle.Wr,z,x​=⟨γ˙​z,r​(x),∇f(x+​)−∇f(γz,r​(x))⟩.

A useful choice is

γz,r(x)=arx+(1−ar)x^+brz,\gamma_{z,r}(x) = a_r x+(1-a_r)\widehat x+b_r z,γz,r​(x)=ar​x+(1−ar​)x+br​z,

with

ar=sin⁡(πr/2),br=cos⁡(πr/2),a_r=\sin(\pi r/2), \qquad b_r=\cos(\pi r/2),ar​=sin(πr/2),br​=cos(πr/2),

and zzz sampled from a Gaussian noise distribution. This path interpolates smoothly between the proposal mean and the current candidate while adding randomness from zzz. Under gradient Lipschitz or Hölder continuity assumptions on ∇f\nabla f∇f, this path estimator yields a Gaussian tilt sampler whose sample distribution is close in chi squared divergence to the target. In the smooth case, the step size must satisfy a condition of the form

η−1≫β1d1/2log⁡(1/δ),\eta^{-1}\gg \beta_1 d^{1/2}\log(1/\delta),η−1≫β1​d1/2log(1/δ),

while in the merely Lipschitz case the condition becomes

η−1≫β02log⁡(1/δ).\eta^{-1}\gg \beta_0^2\log(1/\delta).η−1≫β02​log(1/δ).

The same subroutine is then used as the engine for diffusion sampling. The key structural insight is that one reverse diffusion step can be viewed as sampling from a Gaussian tilted target, where the tilt is determined by the score function. At step ttt, let the forward process have variance σt2\sigma_t^2σt2​ and signal scaling αt\alpha_tαt​. Given a state Xt+1X_{t+1}Xt+1​, define the deterministic anchor

xˉt=αt−1Xt+1.\bar x_t=\alpha_t^{-1}X_{t+1}.xˉt​=αt−1​Xt+1​.

A learned or estimated score function s^t\widehat{\mathsf s}_tst​ is then queried to construct an estimator for the reverse transition target. The sampler repeatedly runs the Gaussian tilt rejection subroutine at each diffusion time, accumulating sample quality as it progresses from t=Tt=Tt=T toward t=1t=1t=1.

The first variant is a simple Gaussian proposal method. It uses

qt=N(xˉt,ηtI)q_t=\mathsf N(\bar x_t,\eta_t I)qt​=N(xˉt​,ηt​I)

and the clipped path estimator

W^r,xt=Clip⁡B(⟨x−xˉt,s^t(rx+(1−r)xˉt)⟩),\widehat W_{r,x}^t = \operatorname{Clip}_B \left( \langle x-\bar x_t, \widehat{\mathsf s}_t(rx+(1-r)\bar x_t) \rangle \right),Wr,xt​=ClipB​(⟨x−xˉt​,st​(rx+(1−r)xˉt​)⟩),

where r∼Unif(0,1)r\sim\mathrm{Unif}(0,1)r∼Unif(0,1). The step size is chosen so that

σt2ηt≫dlog⁡(1/δ)+log⁡2(1/δ).\frac{\sigma_t^2}{\eta_t} \gg d\log(1/\delta)+\log^2(1/\delta).ηt​σt2​​≫dlog(1/δ)+log2(1/δ).

The resulting sampler tracks the reverse transition kernels from the prior distribution toward the early stopped distribution p1p_1p1​. Its error decomposition has the form

DKL(p1∥p^1)≲DKL(pT∥p^T)+Tδ+∑t=1T−1ηtεt,score2,D_{\mathsf{KL}}(p_1\|\widehat p_1) \lesssim D_{\mathsf{KL}}(p_T\|\widehat p_T) + T\delta + \sum_{t=1}^{T-1} \eta_t\varepsilon_{t,\mathrm{score}}^2,DKL​(p1​∥p​1​)≲DKL​(pT​∥p​T​)+Tδ+t=1∑T−1​ηt​εt,score2​,

where εt,score2\varepsilon_{t,\mathrm{score}}^2εt,score2​ measures the local score approximation error. The method does not require strong shape assumptions on the data distribution beyond a second moment bound. With an appropriate schedule, the number of steps needed to reach small discrepancy in the bounded Lipschitz metric is on the order of

max⁡{d,log⁡(1/δ)}log⁡2(d+M22δ2),\max\{d,\log(1/\delta)\} \log^2\left(\frac{d+M_2^2}{\delta^2}\right),max{d,log(1/δ)}log2(δ2d+M22​​),

where

M22=EX0∼pdata∥X0∥2.M_2^2=\mathbb{E}_{X_0\sim p_{\mathrm{data}}}\|X_0\|^2.M22​=EX0​∼pdata​​∥X0​∥2.

A second instantiation is a DDPM like method. Here the proposal includes a first order score correction:

qt=N(xˉt+ηts^t(xˉt),ηtI).q_t = \mathsf N\left( \bar x_t+\eta_t\widehat{\mathsf s}_t(\bar x_t), \eta_t I \right).qt​=N(xˉt​+ηt​st​(xˉt​),ηt​I).

This proposal is closer to standard ancestral diffusion sampling, but the target correction is still implemented using the rejection estimator. The path used in the estimator is

γz,r,xˉt(x)=arx+(1−ar)xˉt+brz,\gamma_{z,r,\bar x_t}(x) = a_r x+(1-a_r)\bar x_t+b_r z,γz,r,xˉt​​(x)=ar​x+(1−ar​)xˉt​+br​z,

with

ar=sin⁡(πr/2),br=cos⁡(πr/2),a_r=\sin(\pi r/2), \qquad b_r=\cos(\pi r/2),ar​=sin(πr/2),br​=cos(πr/2),

and

z∼N(0,ηtI).z\sim\mathsf N(0,\eta_t I).z∼N(0,ηt​I).

The estimator is

W^r,z,xt=Clip⁡B(⟨γ˙z,r,xˉt(x),s^t(γz,r,xˉt(x))−s^t(xˉt)⟩).\widehat W_{r,z,x}^t = \operatorname{Clip}_B \left( \langle \dot\gamma_{z,r,\bar x_t}(x), \widehat{\mathsf s}_t(\gamma_{z,r,\bar x_t}(x)) - \widehat{\mathsf s}_t(\bar x_t) \rangle \right).Wr,z,xt​=ClipB​(⟨γ˙​z,r,xˉt​​(x),st​(γz,r,xˉt​​(x))−st​(xˉt​)⟩).

This version benefits from a nonuniform smoothness condition on the true score. Under this condition, the step size can be chosen to satisfy

σt2ηt≫dLδlog⁡(d/δ)+Lδlog⁡(d/δ),\frac{\sigma_t^2}{\eta_t} \gg \sqrt{dL_\delta\log(d/\delta)} + L_\delta\log(d/\delta),ηt​σt2​​≫dLδ​log(d/δ)​+Lδ​log(d/δ),

where LδL_\deltaLδ​ is a high probability smoothness parameter. For Gaussian data one may take LδL_\deltaLδ​ constant, while for mixtures of Gaussians it grows logarithmically in the ambient dimension and the number of mixture components. The resulting total query complexity is on the order of

max⁡{dLδlog⁡(d/δ),Lδlog⁡(d/δ)}log⁡(d+M22δ2).\max\left\{ \sqrt{dL_\delta\log(d/\delta)}, L_\delta\log(d/\delta) \right\} \log\left(\frac{d+M_2^2}{\delta^2}\right).max{dLδ​log(d/δ)​,Lδ​log(d/δ)}log(δ2d+M22​​).

The method can also be adapted when the data distribution has low dimensional structure. The motivation is that the Hessian of a Gaussian smoothed log density contains an isotropic term that can dominate the smoothness parameter. If

p=pdata∗N(0,σ2I),p=p_{\mathrm{data}}*\mathsf N(0,\sigma^2I),p=pdata​∗N(0,σ2I),

then

∇2log⁡p(x)=−Iσ2+Cov⁡(X0∣X=x)σ4.\nabla^2\log p(x) = -\frac{I}{\sigma^2} + \frac{\operatorname{Cov}(X_0\mid X=x)}{\sigma^4}.∇2logp(x)=−σ2I​+σ4Cov(X0​∣X=x)​.

The shifted score function

s~t(x)=s^t(x)+λtx,λt=1σt2,\widetilde{\mathsf s}_t(x) = \widehat{\mathsf s}_t(x)+\lambda_t x, \qquad \lambda_t=\frac{1}{\sigma_t^2},st​(x)=st​(x)+λt​x,λt​=σt2​1​,

removes the isotropic part of the curvature and often yields better behavior when the support of pdatap_{\mathrm{data}}pdata​ is intrinsically low dimensional.

The intrinsic dimension is defined using covering numbers. If Ndata(r)N_{\mathrm{data}}(r)Ndata​(r) is the covering number of the data support at radius rrr, then

d⋆=1+log⁡Ndata(σ0/d).\mathsf d_\star = 1+\log N_{\mathrm{data}}(\sigma_0/\sqrt d).d⋆​=1+logNdata​(σ0​/d​).

The low dimensional adaptation modifies the Gaussian proposal variance through

1ηˉt=1ηt+λt,\frac{1}{\bar\eta_t} = \frac{1}{\eta_t}+\lambda_t,ηˉ​t​1​=ηt​1​+λt​,

and uses the shifted score difference in the rejection estimator:

W^r,z,xt=Clip⁡B(⟨γ˙z,r,xˉt(x),s^t(γz,r,xˉt(x))−s^t(xˉt)+λt(γz,r,xˉt(x)−xˉt)⟩).\widehat W_{r,z,x}^t = \operatorname{Clip}_B \left( \left\langle \dot\gamma_{z,r,\bar x_t}(x), \widehat{\mathsf s}_t(\gamma_{z,r,\bar x_t}(x)) - \widehat{\mathsf s}_t(\bar x_t) + \lambda_t(\gamma_{z,r,\bar x_t}(x)-\bar x_t) \right\rangle \right).Wr,z,xt​=ClipB​(⟨γ˙​z,r,xˉt​​(x),st​(γz,r,xˉt​​(x))−st​(xˉt​)+λt​(γz,r,xˉt​​(x)−xˉt​)⟩).

The corresponding step size condition becomes

σt2ηt≫d⋆log⁡(d/δ)+log⁡2(d/δ),\frac{\sigma_t^2}{\eta_t} \gg \mathsf d_\star\log(d/\delta) + \log^2(d/\delta),ηt​σt2​​≫d⋆​log(d/δ)+log2(d/δ),

and the resulting complexity depends on d⋆\mathsf d_\stard⋆​ rather than the ambient dimension ddd:

max⁡{d⋆,log⁡(d/δ)}log⁡2(d+M22δ2).\max\{\mathsf d_\star,\log(d/\delta)\} \log^2\left(\frac{d+M_2^2}{\delta^2}\right).max{d⋆​,log(d/δ)}log2(δ2d+M22​​).

The same Gaussian tilt sampler also gives a gradient only implementation of the restricted Gaussian oracle used in the proximal sampler for log concave distributions. For a target μ∝e−f\mu\propto e^{-f}μ∝e−f, the proximal sampler uses an augmented density of the form

μ~(x,y)∝exp⁡(−f(x)−12η∥y−x∥2).\widetilde\mu(x,y) \propto \exp\left( -f(x)-\frac{1}{2\eta}\|y-x\|^2 \right).μ​(x,y)∝exp(−f(x)−2η1​∥y−x∥2).

A Gibbs step requires sampling from the restricted Gaussian oracle

RGO⁡f,η,y(x)∝exp⁡(−f(x)−12η∥y−x∥2).\operatorname{RGO}_{f,\eta,y}(x) \propto \exp\left( -f(x)-\frac{1}{2\eta}\|y-x\|^2 \right).RGOf,η,y​(x)∝exp(−f(x)−2η1​∥y−x∥2).

This oracle is exactly a Gaussian tilt with center yyy. By implementing the oracle with the first order rejection sampling module, the proximal sampler avoids direct evaluations of fff and relies on gradient information instead. Under smoothness, log Sobolev, Poincaré, or log concavity assumptions, this yields high accuracy proximal sampling with first order query complexity, including improved dimension dependence compared with standard rejection based Gibbs schemes.

Experiment

The study applies the proposed method to proximal sampling from log-concave and isoperimetric densities by using a Gaussian tilt representation for the restricted Gaussian oracle. The findings show that this approach yields high-accuracy sampling guarantees for both smooth and Lipschitz objectives under log-Sobolev, Poincare, and log-concavity assumptions, while relying only on first-order and proximal queries. These results indicate that the method can achieve strong convergence without zeroth-order information or the accuracy degradation typical of diffusion-based discretization methods.