In a denoising diffusion probabilistic model (DDPM), the forward process is q(xt∣xt−1)=N(xt;1−βt xt−1, βtI). How do you derive the closed-form marginal q(xt∣x0)=N(xt;αˉt x0, (1−αˉt)I) with αt=1−βt and αˉt=∏s=1tαs, and why does predicting the noise ε match predicting the score ∇xtlog⁡q(xt∣x0)?

Deep learning, Diffusion models
Level L4 Advanced. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can derive the single-step forward sampling formula used to train diffusion models at random timesteps t and connect noise prediction to score matching.

Key idea

Repeatedly substituting xt=αt xt−1+1−αt εt adds independent zero-mean Gaussians, whose variances sum (αt(1−αˉt−1)+(1−αt)=1−αˉt). Differentiating the resulting Gaussian log-density gives ∇xtlog⁡q(xt∣x0)=−ε1−αˉt.

Steps

  1. Write the reparameterised single step with αt=1−βt: xt=αt xt−1+1−αt εt, where εt∼N(0,I).
  2. Prove xt=αˉt x0+1−αˉt εˉt by induction: for t=1 it holds directly since αˉ1=α1. Assume it holds at t−1: xt−1=αˉt−1 x0+1−αˉt−1 εˉt−1 with εˉt−1∼N(0,I) independent of εt.
  3. Substitute into xt: xt=αtαˉt−1 x0+αt(1−αˉt−1) εˉt−1+1−αt εt. Since adding two independent zero-mean Gaussians gives a zero-mean Gaussian whose variance is the sum of variances, the noise variance is αt(1−αˉt−1)+(1−αt)=αt−αtαˉt−1+1−αt=1−αˉt. Thus q(xt∣x0)=N(xt;αˉt x0,(1−αˉt)I).
  4. Connect to the score: log⁡q(xt∣x0)=−∥xt−αˉt x0∥22(1−αˉt)+const. Differentiating with respect to xt and substituting xt−αˉt x0=1−αˉt ε yields ∇xtlog⁡q(xt∣x0)=−xt−αˉt x01−αˉt=−ε1−αˉt.
  5. Conclude: training εθ(xt,t) with the simplified DDPM loss Et,x0,ε[∥ε−εθ(αˉt x0+1−αˉt ε, t)∥2] lets you sample any timestep t in O(1) without unrolling t steps, and estimates the scaled conditional score −1−αˉt ∇xtlog⁡q(xt∣x0).

Common mistakes

How long your answer should be

One page; 6–7 minutes.

Last checked on 4 December 2026.

Read this

Previous in Deep learning: Why do gradients of the original minimax GAN objective vanish when pdata and pg have disjoint supports, what is mode collapse, and how does the Wasserstein-1 distance in WGAN fix both?
Next in Deep learning: At DDPM reverse step t with αt=0.81, βt=0.19, αˉt=0.36 and scalar noisy value xt=1.09, a trained noise network predicts εθ(xt,t)=0.8. What is the estimated clean signal x^0, and what is the reverse-step mean μθ(xt,t) used to sample xt−1?