The finale of the DDIM series. We've removed the Markov shackle (Part 2) and proven the loss is equivalent to DDPM's (Part 3). But de-Markovianizing is only the surface. To understand why DDIM actually accelerates, we go to the math: with σt=0\sigma_t = 0, DDIM's reverse iteration is — remarkably — an ordinary differential equation (ODE).

Which of the three got upgraded?

Back to the experienced-driver framework. What exactly did DDIM improve about DDPM — the route, the car, or the driver?

  • The route (forward noising) — unchanged. We even forbade changing the marginal q(xt∣x0)q(x_t\mid x_0) (Part 3). So DDIM did not improve DDPM via the noising process / distribution.
  • The driver (optimization target) — unchanged. The target is still predicting noise ϵ\epsilon, and Part 3 proved the loss is equivalent. So DDIM did not touch the optimization objective either.
  • The car (reverse denoising iteration) — by elimination, this is the one. DDIM re-tunes the car: set σt=0\sigma_t = 0 and start from Formula (16).

The only remaining lever is the reverse iteration, and that's exactly where DDIM operates.


Starting from Formula (16) with σt=0\sigma_t = 0

Recall the DDIM sampler from Part 2:

xt−1=αt−1(xt−1−αt ϵθ(xt)αt)⏟predicted x0+1−αt−1 ϵθ(xt,t)⏟direction to xt+σtϵt⏟random noise.x_{t-1} = \sqrt{\alpha_{t-1}}\underbrace{\left(\frac{x_t - \sqrt{1-\alpha_t}\,\epsilon_\theta(x_t)}{\sqrt{\alpha_t}}\right)}_{\text{predicted }x_0} + \underbrace{\sqrt{1-\alpha_{t-1}}\,\epsilon_\theta(x_t, t)}_{\text{direction to }x_t} + \underbrace{\sigma_t\epsilon_t}_{\text{random noise}}.

Set σt=0\sigma_t = 0 — the random-noise term vanishes (this is still Eq 16, just with the stochastic term gone):

xt−1=αt−1(xt−1−αt ϵθ(xt)αt)+1−αt−1 ϵθ(xt,t).x_{t-1} = \sqrt{\alpha_{t-1}}\left(\frac{x_t - \sqrt{1-\alpha_t}\,\epsilon_\theta(x_t)}{\sqrt{\alpha_t}}\right) + \sqrt{1-\alpha_{t-1}}\,\epsilon_\theta(x_t, t).

Our goal is to massage this iteration into an ODE — to prove the SDE became an ODE. (The full rearrangement below is Eq 22 in the lecture.)


Rearranging into a difference

Divide through and regroup so that xtx_t and xt−1x_{t-1} terms sit on opposite sides. Concretely, divide by αt−1\sqrt{\alpha_{t-1}} and move the xt−1x_{t-1} term over. The result comes out strikingly tidy:

xtαt−xt−1αt−1=(1−αtαt−1−αt−1αt−1)ϵθ(xt,t).\frac{x_t}{\sqrt{\alpha_t}} - \frac{x_{t-1}}{\sqrt{\alpha_{t-1}}} = \left(\sqrt{\frac{1-\alpha_t}{\alpha_t}} - \sqrt{\frac{1-\alpha_{t-1}}{\alpha_{t-1}}}\right)\epsilon_\theta(x_t, t).

Every term now has matching tt / t−1t-1 structure on both sides.


Making time continuous

A differential equation needs continuous time. Replace the unit step "t−1t-1" with a general step "t−Δtt - \Delta t" (the time increment shrinks from 11 to something small):

xtαt−xt−Δtαt−Δt=(1−αtαt−1−αt−Δtαt−Δt)ϵθ(xt,t).(22)\frac{x_t}{\sqrt{\alpha_t}} - \frac{x_{t-\Delta t}}{\sqrt{\alpha_{t-\Delta t}}} = \left(\sqrt{\frac{1-\alpha_t}{\alpha_t}} - \sqrt{\frac{1-\alpha_{t-\Delta t}}{\alpha_{t-\Delta t}}}\right)\epsilon_\theta(x_t, t). \tag{22}

A change of variables (the trick)

Define two new quantities to clean this up:

xˉt:=xtαt,σt:=1−αtαt.\bar{x}_t := \frac{x_t}{\sqrt{\alpha_t}}, \qquad \sigma_t := \sqrt{\frac{1-\alpha_t}{\alpha_t}}.

⚠️ Note: this σt\sigma_t is a reparameterization variable (a function of αt\alpha_t), not the sampling-noise σt\sigma_t we set to zero. Same letter, different role.

The equation becomes:

xˉt−xˉt−Δt=(σt−σt−Δt) ϵθ(⋯ ).\bar{x}_t - \bar{x}_{t-\Delta t} = \big(\sigma_t - \sigma_{t-\Delta t}\big)\,\epsilon_\theta(\cdots).


Taking the limit → an ODE

Compare to the canonical ODE form dxt=f(xt,t) dtdx_t = f(x_t, t)\,dt. Without taking the limit, the differential dtdt is just t−(t−Δt)=Δtt - (t - \Delta t) = \Delta t. By the same logic, the right-hand difference σt−σt−Δt\sigma_t - \sigma_{t-\Delta t} is a Δσ\Delta\sigma, which in the limit becomes dσd\sigma:

  • Left side: xˉt−xˉt−Δt→dxˉt\bar{x}_t - \bar{x}_{t-\Delta t} \to d\bar{x}_t.
  • Right side: σt−σt−Δt→dσ\sigma_t - \sigma_{t-\Delta t} \to d\sigma.

So instead of dividing by Δt\Delta t and taking the limit (giving dxˉt/dtd\bar x_t/dt), we divide by Δσ\Delta\sigma — the "infinitesimal element" is σ\sigma, not tt. Taking the limit:

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

(Here xt=αt xˉtx_t = \sqrt{\alpha_t}\,\bar x_t and αt=1/σ2+1\sqrt{\alpha_t} = 1/\sqrt{\sigma^2+1}, which is why the network input rewrites as xˉt/σ2+1\bar x_t/\sqrt{\sigma^2+1}.)

This is manifestly an ODE — no random/stochastic term, just a deterministic differential.

This is the deep reason DDIM accelerates. The reverse denoising formula is an ODE, and ODEs can be solved with large steps. The "car got better" because it became an ODE-car.


The big picture: probability-flow ODE

So DDIM's reverse iteration, in continuous form, is — surprisingly — an ordinary differential equation. This is exactly the probability-flow ODE from Song's consistency-models line of work:

Setting the perturbation (diffusion) coefficient of an SDE to zero converts the SDE into a probability-flow ODE. That's the same move DDIM makes (σt=0\sigma_t = 0), and the same engine behind ODE-based step-skipping.

Why ODEs are the better vehicle for fast sampling:

  • No perturbation term ⇒ the numerical solution is simpler.
  • Faster to solve than an SDE.
  • Larger step sizes are possible — i.e. you can skip more steps.

This is the through-line connecting DDIM to flow matching / rectified flow, which push step-skipping to the extreme — all of them ODE-based. (The rare exceptions, like Schrödinger-bridge methods, skip steps with SDEs via much more complex machinery; but as a rule, if you want to skip steps, build on an ODE.) A practical takeaway for designing fast samplers:

Base the modeling on an ODE, not naively on an SDE. ODE/flow models are currently the better solution: kill the SDE's stochasticity → probability-flow ODE → simpler solver, bigger steps, faster sampling.


Series wrap-up

Across four parts, DDIM's full story:

  1. Core idea & DDPM recap — one letter ("Implicit"); slow because of the Markov shackle; the free-loading constraint.
  2. Removing Markov & the sampler — posit the reverse distribution, solve by undetermined coefficients, get the step-skipping sampler (Eq 16), and the meaning of Implicit (σt=0\sigma_t = 0).
  3. Loss-equivalence proof — Jσ=Lγ+CJ_\sigma = L_\gamma + C; DDIM changes the forward joint, not the reverse model, so a pretrained DDPM model is free-loadable.
  4. This part — with σt=0\sigma_t = 0, the reverse iteration is an ODE (a probability-flow ODE); that's the real source of acceleration.

The one-line summary: DDIM keeps DDPM's route and driver, and upgrades only the car — turning the reverse-time SDE into a deterministic ODE, which is what makes large-step, fast sampling possible while free-loading the very same DDPM-trained model.


Notes taken from a video tutorial on DDIM (Part 4 of the series).


References

  • Song, J., Meng, C., & Ermon, S. (2021). Denoising Diffusion Implicit Models. ICLR 2021. arXiv:2010.02502
  • Ho, J., Jain, A., & Abbeel, P. (2020). Denoising Diffusion Probabilistic Models. NeurIPS 2020. arXiv:2006.11239
  • Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., & Poole, B. (2021). Score-Based Generative Modeling through Stochastic Differential Equations. ICLR 2021. arXiv:2011.13456