ai papers

Understanding DDIM (Denoising Diffusion Implicit Models)

Junyoung Park · 2023-04-20 · 12 min

Introduction

Unlike GANs, whose adversarial training does not allow a latent prior to be specified directly, DDPM emerged as a promising new kind of generative model because it avoids mode collapse and can be trained stably.

During training, however, DDPM adds tiny Gaussian noise values to individual pixels over many iterations (T=1000T = 1000), and sampling is based on the noised input (xtx_t) at each step. It therefore cannot escape a Markov process.

A Markov process is a useful way to construct a stable prior p(z)p(z), but every advantage comes with a cost: DDPM sampling is remarkably slow. In a Markov process, each next state depends on the preceding one in a cascade, which cannot be parallelized on a hardware accelerator such as a GPU. In practice, generating images at the same resolution requires a thousand times more computation than an implicit model such as a GAN. For example, a GAN can generate 50k50k images of size 32×3232 \times 32 in under a minute, whereas DDPM takes 20 hours. For more detail on the equations and diffusion itself, see the introductory DDPM post and the post deriving the DDPM equations.

This paper focuses on the excessively slow DDPM sampling process and proposes a new method that retains the same objective as DDPM while enabling a non-Markovian process during sampling. In contrast to DDPM’s fully stochastic sampling, this process is deterministic—conditioned on the original image x0x_0—and creates a one-to-one mapping trajectory like a neural-network decoder. The authors call it a DDIM (Denoising Diffusion Implicit Model).

Overview

The idea behind DDPM was to train the reverse process to follow the posterior q(xt1xt,x0)q(x_{t-1} \vert x_t, x_0), which makes the Markovian forward process tractable. DDIM assumes a non-Markovian process and thus enables deterministic sampling. By explicitly stating that the noised input at time tt originates from x0x_0, as shown below, it escapes the approach that depended only on the preceding state.

In other words, we can ensure that the distribution followed by the original pθ(xt1xt)p_\theta(x_{t-1} \vert x_{t}) is non-Markovian rather than Markovian. The diffusion process can thereby remain implicitly aware, during sampling, of the image x0x_0 that it must recover.

Most importantly, this change does not alter the objective function. There is no need to retrain with a different objective: a pretrained DDPM can be used as-is by applying only the sampling procedure derived in the figure above. A further advantage is that, because deterministic sampling is aware of x0x_0, the reverse process need not traverse all T=1000T = 1000 steps used by the forward process to create a noised sample. It can instead follow a subsequence Tsub=[τn, τn1,, τ0]T_\text{sub} = [\tau_n,~\tau_{n-1}, \cdots,~\tau_0] and sample without a large loss of quality.

Finally, because every noised image xt(t<T)x_{t(t < T)} in the sampling process is conditioned on x0x_0, interpolation in the latent space can produce meaningful semantic interpolation.

Image editing with GANs was comparatively straightforward—for example, through GAN inversion—because the mapping from latent zz through a style mapper FF and image synthesizer GG to the implicitly generated x=F(G(z))x = F(G(z)) nonlinearly warped the information in the spaces of zz and xx. To some degree, interpolating the two latents z1z_1 and z2z_2 that produce x1x_1 and x2x_2 as αz1+(1α)z2\alpha \cdot z_1 + (1-\alpha) \cdot z_2 could therefore have an effect in image space analogous to βx1+(1β)x2\beta \cdot x_1 + (1-\beta)x_2. Because the mapping is nonlinear, this affine expression is not exact, but it enables the intuitive semantic operation of producing, for instance, a brunette between a blonde woman and a woman with black hair.

Stochasticity prevented such intuitive sampling in a diffusion process. DDIM offers one way to overcome that limitation.

Deriving the equations

DDIM uses notation different from DDPM, which can be confusing. I prefer the DDPM notation, so I will rewrite the entire DDIM derivation using DDPM notation.

q(x1:Tx0):=t=1Tq(xtxt1), where q(xtxt1):=N(αtxt1, (1αt)I)q(x_{1:T} \vert x_0) := \prod_{t=1}^T q(x_t \vert x_{t-1}) , \text{ where }q(x_t \vert x_{t-1}):= \mathcal{N}(\sqrt{\alpha_t}x_{t-1}, ~(1-\alpha_t)I)

Here αt\alpha_t is one minus βt\beta_t, the variance scheduled for each time step tt. As discussed in the equation-derivation post, adding noise through this forward process produces a Gaussian distribution while keeping the variance at 11. Accumulating noise in this way gives the following expression for q(xtx0)q(x_t \vert x_0), where αˉt=τ=1tατ\bar{\alpha}_t = \prod_{\tau=1}^t \alpha_\tau.

q(xtx0):=q(x1:tx0)dx1:(t1)=N(xt; αˉtx0,(1αˉt)I)q(x_t \vert x_0) := \int q(x_{1:t} \vert x_0)dx_{1:(t-1)} = \mathcal{N}(x_t;~\sqrt{\bar{\alpha}}_t x_0, (1-\bar{\alpha}_t)I)

As in DDPM, the actual implementation uses a reparameterization trick rather than sampling directly from the stochastic process above.

xt=αˉtx0+1αˉtϵ, where ϵN(0,I)x_t = \sqrt{\bar{\alpha}_t} x_0 + \sqrt{1-\bar{\alpha}_t} \epsilon, \text{ where }\epsilon \sim \mathcal{N}(0, I)

Remarkably, the DDIM equation can be derived directly from this expression. The proof is based on Equation 2.115 in Bishop’s Pattern Recognition—the formula for marginalizing a particular variable from a Gaussian conditional distribution. In brief, suppose we have

p(x)=N(xμ, Λ1)p(yx)=N(yAx+b, L1)\begin{aligned} p(x) =& \mathcal{N}(x \vert \mu,~\Lambda^{-1}) \\ p(y \vert x) =& \mathcal{N}(y \vert Ax+b,~\mathrm{L}^{-1}) \end{aligned}

Then the distribution of yy after projecting out xx is

p(y)=N(yAμ+b, L1+AΛ1A)p(y) = \mathcal{N}(y \vert A\mu+b,~\mathrm{L}^{-1}+ A \Lambda^{-1}A^\top)

The conditional mean was parameterized by xx; after marginalization it uses the prior mean, while the variance acquires the additional term at the end. Returning to DDIM, we want to inductively learn the “posterior” of a non-Markovian process satisfying the following constraint:

qσ(xt1xt, x0)q_\sigma(x_{t-1} \vert x_t,~x_0)

If this looks familiar, in the DDPM derivation it appeared when the original forward distribution q(xt1xt)q(x_{t-1} \vert x_t) was conditioned on x0x_0 for every time step t>1t>1 and expanded with Bayes’ rule while retaining the Markov process:

q(xt1xt,x0)=q(xtxt1,x0)q(xt1x0)q(xtx0)q(x_{t-1} \vert x_t,x_0) = q(x_t \vert x_{t-1},x_0) \frac{q(x_{t-1} \vert x_0)}{q(x_t \vert x_0)}

This time, however, we seek a new non-Markovian distribution qσ(xtxt1,x0)q_{\sigma}(x_{t} \vert x_{t-1}, x_0) with the same marginal q(xtx0)q(x_{t} \vert x_0) at every time step tt. The inductive proof proceeds as follows.

  1. For t=1t = 1, it is clear that q(x1x0)=qσ(x1x0)q(x_{1} \vert x_0) = q_{\sigma}(x_1 \vert x_0).
  2. At t=τt = \tau, suppose q(xτ1x0)=qσ(xτ1xτ,x0)dxτq(x_{\tau-1} \vert x_0) = \int q_{\sigma}(x_{\tau-1} \vert x_{\tau}, x_0) dx_\tau holds (τ1\tau \ge 1).
  3. If we can also make q(xτx0)=qσ(xτxτ+1,x0)dxτ+1q(x_{\tau} \vert x_0) = \int q_{\sigma}(x_{\tau} \vert x_{\tau+1}, x_0) dx_{\tau+1} hold for t=τ+1t = \tau + 1, every marginal of the DDIM forward process can be matched to DDPM for all t1t \ge 1.

Keeping Bishop’s equation firmly in mind, consider the marginal that must be matched:

q(xt1x0)=N(xt1; αˉt1x0,(1αˉt1)I)q(x_{t-1} \vert x_0) = \mathcal{N}(x_{t-1};~\sqrt{\bar{\alpha}}_{t-1} x_0, (1-\bar{\alpha}_{t-1})I)

Conditioning this expression on xtx_{t} gives the following. Shown together with the distribution q(xtx0)q(x_t \vert x_0), it is

q(xtx0)=N(xt; αˉtx0,(1αˉt)I)qσ(xt1xt,x0)=N(xt1; αˉt1x0+C(xtαˉtx0),σt2I)\begin{aligned} q(x_t \vert x_0) =& \mathcal{N}(x_{t};~\sqrt{\bar{\alpha}_t}x_0,(1-\bar{\alpha}_{t})I) \\ q_\sigma(x_{t-1} \vert x_t, x_0) =& \mathcal{N}(x_{t-1};~\sqrt{\bar{\alpha}_{t-1}}x_0 + C\cdot(x_t - \sqrt{\bar{\alpha}_t}x_0),\sigma_t^2 I) \end{aligned}

Here σt\sigma_t can be regarded as an arbitrary standard deviation of any Gaussian distribution satisfying the same marginal. The constant CC is introduced into the mean for the following reason. According to Equation 2.115 in Bishop,

E(qσ(xt1x0))=E(qσ(xt1xt,x0))xt=E(q(xtx0))\mathbb{E}\left(q_\sigma(x_{t-1} \vert x_0)\right) = \mathbb{E}\left(q_\sigma(x_{t-1} \vert x_t, x_0)\right) \rvert_{x_t = \mathbb{E}(q(x_t \vert x_0))}

Therefore, the expression αˉt1x0+C(xtαˉtx0)\sqrt{\bar{\alpha}_{t-1}}x_0 + C\cdot(x_t - \sqrt{\bar{\alpha}_t}x_0) was intentionally constructed so that substituting αˉtx0\sqrt{\bar{\alpha}_t}x_0 for xtx_t produces αˉt1x0\sqrt{\bar{\alpha}_{t-1}}x_0. Since we introduced the arbitrary constant CC, we solve for it by applying the variance identity in the same way:

Var(qσ(xt1x0))=Var(qσ(xt1xt,x0))+C2Var(q(xtx0))\mathrm{Var}(q_\sigma(x_{t-1} \vert x_0)) = \mathrm{Var}(q_\sigma(x_{t-1} \vert x_t, x_0))+C^2 \cdot \mathrm{Var}(q(x_t \vert x_0))

Substituting the known variances of the marginal distributions gives

(1αˉt1)I=σt2I+C2(1αˉt)I(1-\bar{\alpha}_{t-1})I = \sigma_t^2I + C^2 \cdot (1-\bar{\alpha}_t)I

Removing the identity matrix II and solving for the coefficient CC gives

C=1αˉt1σt2(1αˉt)C = \frac{\sqrt{1-\bar{\alpha}_{t-1}-\sigma_t^2}}{\sqrt{(1-\bar{\alpha}_t)}}

The non-Markovian posterior for an arbitrary variance σt2\sigma_t^2 is therefore

qσ(xt1xt,x0)=N(xt1; αˉt1x0+1αˉt1σt2(1αˉt)(xtαˉtx0),σt2I)q_\sigma(x_{t-1} \vert x_t, x_0) = \mathcal{N}(x_{t-1};~\sqrt{\bar{\alpha}_{t-1}}x_0 + \frac{\sqrt{1-\bar{\alpha}_{t-1}-\sigma_t^2}}{\sqrt{(1-\bar{\alpha}_t)}} \cdot(x_t - \sqrt{\bar{\alpha}_t}x_0),\sigma_t^2 I)

To emphasize once more, this equation has a completely different meaning from the posterior derived for DDPM. Converting the non-Markovian posterior above into a likelihood gives

qσ(xtxt1,x0)=qσ(xt1xt,x0)×qσ(xtx0)qσ(xt1x0)q_\sigma(x_{t} \vert x_{t-1}, x_0) = q_\sigma(x_{t-1} \vert x_t,x_0) \times \frac{q_\sigma(x_t \vert x_0)}{ q_\sigma(x_{t-1} \vert x_0)}

We have thus found a non-Markovian forward process qσq_\sigma with the same marginals as the Markovian forward process qq, which is exactly what the paper set out to do.

From a non-Markovian posterior to the DDPM loss

Now let us verify why optimizing the qq defined above yields the same loss as DDPM. Only the qq term changes relative to the DDPM loss, so we can express the result as follows by replacing the forward process in DDPM’s lower bound with the non-Markovian one.

E(logpθ(x0))Eq(logpθ(xT)t1logpθ(xt1xt)qσ(xtxt1,x0))\mathbb{E}(-\log p_\theta (x_0)) \leq \mathbb{E}_q \left( -\log p_\theta(x_T) - \sum_{t \ge 1}\log \frac{p_\theta(x_{t-1} \vert x_t)}{q_\sigma(x_t \vert x_{t-1}, x_0)} \right)

The conversion to a posterior and the rest of the algebra were already covered for DDPM, so we can skip directly to the result. The variational-inference loss is

DKL(q(xTx0)pθ(xT))t>1DKL(qσ(xt1xt,x0)pθ(xt1xt))Eq(logpθ(x0x1))D_{KL}(q(x_T \vert x_0) \vert\vert p_\theta(x_T)) -\sum_{t > 1} D_{KL} (q_\sigma(x_{t-1} \vert x_t, x_0) \vert\vert p_\theta(x_{t-1} \vert x_t)) -\mathbb{E}_q\left(\log p_{\theta}(x_0 \vert x_1) \right)

The only change is that the distribution qq representing the forward process now carries σ\sigma, the standard deviation of the non-Markovian posterior. As in DDPM, we discard the first term and express the training of the diffusion model on the remaining terms in terms of the reverse process pθp_\theta:

pθ(t)(xt1xt)={N(x0(xt,ϵθ),σ12I),if t=1qσ(xt1xt, x0(xt,ϵθ)),otherwisep_\theta^{(t)}(x_{t-1} \vert x_t) = \begin{cases} \mathcal{N}(x_0(x_t, \epsilon_\theta), \sigma_1^2I), &\text{if }t = 1\\ q_\sigma (x_{t-1} \vert x_t,~x_0(x_t,\epsilon_\theta)),& \text{otherwise}\end{cases}

Here x0(xt,ϵθ)x_0(x_t, \epsilon_\theta) denotes x0=(xt1αˉtϵθ(t)(xt))/αˉtx_0 = (x_t - \sqrt{1-\bar{\alpha}_t} \cdot \epsilon_\theta^{(t)}(x_t)) / \sqrt{\bar{\alpha}_t}, reconstructed from the noise ϵθ(t)\epsilon_\theta^{(t)} that the network predicts was added to each xtx_t. Looking only at the case t>1t>1, the KL divergence between Gaussian distributions simplifies because their exponential terms cancel:

DKL(qσ(xt1xt,x0)pθ(t)(xt1xt))=DKL(qσ(xt1xt,x0)qσ(xt1xt, x0(xt, ϵθ)))=Eq(x0x0(xt,ϵθ)222σt2)\begin{aligned} &D_{KL} (q_\sigma(x_{t-1} \vert x_t, x_0) \vert\vert p_\theta^{(t)}(x_{t-1} \vert x_t)) \\ &=D_{KL} (q_\sigma(x_{t-1} \vert x_t, x_0) \vert\vert q_\sigma(x_{t-1} \vert x_t,~x_0(x_t,~\epsilon_\theta))) \\ &=\mathbb{E}_q\left(\frac{\parallel x_0 - x_0(x_t,\epsilon_\theta) \parallel_2^2}{2\sigma_t^2} \right) \end{aligned}

Rewriting the expression through ϵ\epsilon, the noise actually added during reparameterization, gives

=Eq((xt1αˉtϵ)/αˉt(xt1αˉtϵθ(t)(xt))/αˉt222σt2)=\mathbb{E}_q\left( \frac{\parallel (x_t-\sqrt{1-\bar{\alpha}_t}\epsilon)/\sqrt{\bar{\alpha}_t} - (x_t-\sqrt{1-\bar{\alpha}_t}\epsilon_\theta^{(t)}(x_t))/\sqrt{\bar{\alpha}_t} \parallel_2^2}{2\sigma_t^2} \right)

The familiar form is beginning to appear. After collecting the coefficients, we recover the familiar simplified objective:

=Eq((1αˉt)ϵϵθ(t)(xt)22σt2αˉt)=Eq(1αˉt2σt2αˉtϵϵθ(t)(xt)2)=\mathbb{E}_q \left( (1-\bar{\alpha}_t)\cdot\frac{\parallel \epsilon - \epsilon_\theta^{(t)}(x_t) \parallel^2}{2\sigma_t^2\bar{\alpha}_t} \right) = \mathbb{E}_q\left( \frac{1-\bar{\alpha}_t}{2\sigma_t^2\bar{\alpha}_t} \cdot \parallel \epsilon - \epsilon_\theta^{(t)}(x_t) \parallel^2 \right)

This proves that the non-Markovian posterior introduced for DDIM sampling indeed converges to the DDPM loss.

Sampling with DDIM

Using the predicted ϵθ\epsilon_\theta in the non-Markovian forward process defined above yields the following sampling equation:

xt1=αˉt1(xt1αˉtϵθ(t)(xt)αˉt)predicted x0+1αˉt1σt2ϵθ(t)(xt)direction pointing to xt+σtzrandom noise, zN(0,I)x_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\underset{\text{predicted }x_0}{\left( \frac{x_t - \sqrt{1-\bar{\alpha}_t}\epsilon_\theta^{(t)}(x_t)}{\sqrt{\bar{\alpha}_t}} \right)} + \underset{\text{direction pointing to }x_t}{\sqrt{1-\bar{\alpha}_{t-1} - \sigma_t^2} \cdot \epsilon_\theta^{(t)}(x_t)} + \underset{\text{random noise}}{\sigma_t z},~z \sim \mathcal{N}(0, I)

The equation first predicts x0x_0 and then reconstructs xtx_t. There is no strict need to predict the sample at t1t-1; predicting the sample at t2t-2 is also reasonable. DDIM sampling can therefore use only selected values of tt rather than consuming all TT time steps. For example, given a subsequence [xτ1, , xτS](S<T)[x_{\tau_1},~\cdots,~x_{\tau_S}] (S < T) of the full length-TT time sequence [1, 2, , T][1,~2,~\cdots,~T], we can redefine the non-Markovian forward process as q(xτix0)=N(αˉτix0, (1αˉτi)I)q(x_{\tau_i} \vert x_0) = \mathcal{N}(\sqrt{\bar{\alpha}_{\tau_i}}x_0,~(1-\bar{\alpha}_{\tau_i})I). Because it no longer depends only on the preceding state, dependence on a contiguous sequence disappears as well.

Experiments

The sampling equation contains a new hyperparameter, σ\sigma:

xt1=αˉt1(xt1αˉtϵθ(t)(xt)αˉt)predicted x0+1αˉt1σt2ϵθ(t)(xt)direction pointing to xt+σtzrandom noise, zN(0,I)x_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\underset{\text{predicted }x_0}{\left( \frac{x_t - \sqrt{1-\bar{\alpha}_t}\epsilon_\theta^{(t)}(x_t)}{\sqrt{\bar{\alpha}_t}} \right)} + \underset{\text{direction pointing to }x_t}{\sqrt{1-\bar{\alpha}_{t-1} - \sigma_t^2} \cdot \epsilon_\theta^{(t)}(x_t)} + \underset{\text{random noise}}{\sigma_t z},~z \sim \mathcal{N}(0, I)

Computing the variance separately gives the sum of the squared coefficients attached to epsilon:

Var(xt1)=αˉt1(1αˉt)αˉt+(1αˉt1σt2)+σt2=(1+αt2αˉt)αt\mathrm{Var}(x_{t-1}) = \frac{\bar{\alpha}_{t-1} \cdot (1-\bar{\alpha}_t)}{\bar{\alpha}_t} + (1-\bar{\alpha}_{t-1} - \sigma_t^2) + \sigma_t^2 = \frac{(1+\alpha_t-2\bar{\alpha}_t)}{\alpha_t}

Thus, σ\sigma controls the transition between DDPM’s stochasticity and DDIM’s determinism without changing the actual sampling variance. Recall the DDPM sampling equation:

xt1=1αt(xtβt1αˉtϵθ(xt,t))+σtzx_{t-1} = \frac{1}{\sqrt{\alpha_t}}\left( x_t - \frac{\beta_t}{\sqrt{1-\bar{\alpha}}_t} \epsilon_\theta(x_t, t)\right)+\sigma_tz

In deriving this equation, the standard deviation of the tractable probability distribution q(xt1xt,x0)q(x_{t-1} \vert x_t, x_0) for the Markovian forward process was

σ~t2=βt×(1αˉt11αˉt)\tilde{\sigma}_t^2 = \beta_t \times \left( \frac{1-\bar{\alpha}_{t-1}}{1-\bar{\alpha}_t} \right)

Remarkably, when DDIM’s σt\sigma_t takes this form, its sampling equation becomes exactly the DDPM equation. Defining η\eta as a hyperparameter therefore lets us interpolate between DDPM and DDIM sampling:

σt=η(1αt)×(1αˉt11αˉt)\sigma_{t} = \eta\sqrt{(1-\alpha_t) \times \left( \frac{1-\bar{\alpha}_{t-1}}{1-\bar{\alpha}_t} \right)}

η=1\eta = 1 gives pure DDPM, while η=0\eta = 0 gives pure DDIM.

The figure reports FID after sampling with fewer than T=1000T = 1000 steps for DDPM (η=1\eta = 1), DDIM (η=0\eta = 0), and intermediate values. DDPM performance deteriorates sharply as the number of steps decreases, while DDIM preserves its quality.

Unsurprisingly, more steps yield better sampling performance—but the sampling time becomes excessive.

Roughly 2010020 \sim 100 steps provide generation quality comparable to 10001000 steps, corresponding by a simple calculation to a 10-to-50-fold speedup.

Best of all, latent interpolation now has a meaningful relationship with the semantics of the generated images. It is hilarious how the Shutterstock watermark slowly appears along the way—maybe that is just me, though.

Neural ODEs with DDIM

Although DDIM and DDPM are diffusion models, their discrete treatment of diffusion makes it difficult to call them differential equations. DDIM sampling, however, has a form that admits an Euler approximation. Recall the sampling equation:

xt1=αˉt1(xt1αˉtϵθ(t)(xt)αˉt)predicted x0+1αˉt1σt2ϵθ(t)(xt)direction pointing to xt+σtzrandom noise, zN(0,I)x_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\underset{\text{predicted }x_0}{\left( \frac{x_t - \sqrt{1-\bar{\alpha}_t}\epsilon_\theta^{(t)}(x_t)}{\sqrt{\bar{\alpha}_t}} \right)} + \underset{\text{direction pointing to }x_t}{\sqrt{1-\bar{\alpha}_{t-1} - \sigma_t^2} \cdot \epsilon_\theta^{(t)}(x_t)} + \underset{\text{random noise}}{\sigma_t z},~z \sim \mathcal{N}(0, I)

There it is. For DDIM, as discussed above, we simply set σ=0\sigma = 0.

xt1αˉt1=xt1αˉtϵθ(t)(xt)αˉt+1αˉt1ϵθ(t)(xt)αˉt1\frac{x_{t-1}}{\sqrt{\bar{\alpha}_{t-1}}} = \frac{x_t - \sqrt{1-\bar{\alpha}_t}\epsilon_\theta^{(t)}(x_t)}{\sqrt{\bar{\alpha}_t}} + \frac{\sqrt{1-\bar{\alpha}_{t-1}} \cdot \epsilon_\theta^{(t)}(x_t)}{\sqrt{\bar{\alpha}_{t-1}}}

Because this was originally an equation for discrete sampling, replacing every time interval with Δ\Delta converts it into a differential-equation form:

xtΔαˉtΔ=xtαˉt+(1αˉtΔαˉtΔ1αˉtαˉt)ϵθ(t)(xt)\frac{x_{t-\Delta}}{\sqrt{\bar{\alpha}_{t-\Delta}}} = \frac{x_t }{\sqrt{\bar{\alpha}_t}} + \left(\frac{\sqrt{1-\bar{\alpha}_{t-\Delta}} }{\sqrt{\bar{\alpha}_{t-\Delta}}} - \frac{\sqrt{1-\bar{\alpha}_t}}{\sqrt{\bar{\alpha}_t}} \right)\cdot \epsilon_\theta^{(t)}(x_t)

Substituting xt/αˉt=xˉtx_t/\sqrt{\bar{\alpha}_t} = \bar{x}_t and 1αˉtαˉt=σ\frac{\sqrt{1-\bar{\alpha}_t}}{\sqrt{\bar{\alpha}_t}} = \sigma gives

dxˉ(t)=ϵθ(t)(xˉ(t)σ2+1)dσ(t)d\bar{x}(t) = \epsilon_\theta^{(t)}\left(\frac{\bar{x}(t)}{\sqrt{\sigma^2+1}}\right)d\sigma(t)

This is a differential equation. Compared with DDPM, the continuous diffusion process formulated through an SDE presents x(T)x(T) as the solution to a Neural ODE, allowing a deterministic one-to-one mapping.

Because an ODE is available, x0x_0 can be encoded directly into xTx_T or reconstructed back into x0x_0. The trajectory error depends on Δ\Delta, so a larger SS—a shorter time interval—brings the result closer to the true solution of the differential equation. The figure above shows reconstruction error on CIFAR-10.