U1.2 22 min read Oct 2026

U1.2 Denoising: How Do We Learn a Reverse Step?

Builds on7 notes

How can we sample a reverse step?

We can move forward and sample any xtx_t directly from x0x_0. Now, given xtx_t, we want a draw from q(xt−1∣xt)q(x_{t-1}\mid x_t).

ReviewWhy a distribution rather than one answer?

The reverse conditional describes the density of possible previous states given the present xtx_t.

On our trip to Pingtung, the preceding stop could have been Kaohsiung on the west coast or Taitung on the east coast. A conditional distribution assigns probabilities to both possibilities.

Corruption loses information: many preceding states can lead to the same present state. A distribution represents that uncertainty. How we later use this information, through stochastic or deterministic generation, is developed in U1.4.

The forward Gaussian perturbation leaves a range of plausible preceding states. We need their conditional density.

DiscussionQ1

Why not invert the corruption formula? We know

xt=αt xt−1+βt ϵt,x_t=\sqrt{\alpha_t}\,x_{t-1}+\sqrt{\beta_t}\,\epsilon_t ,

so perhaps we can draw a fresh ϵt∼N(0,I)\epsilon_t\sim\mathcal N(0,I) and solve

xt−1=(xt−βt ϵt)/αtx_{t-1}=\big(x_t-\sqrt{\beta_t}\,\epsilon_t\big)\big/\sqrt{\alpha_t}

After all, the noise was random.

Why does this fail?

Show the reasoning

Noise is independent when we construct the forward step, but not after conditioning on its result.

Forward construction first fixes xt−1x_{t-1} and independently draws ϵt\epsilon_t. The observed xtx_t depends on that particular hidden noise, so observing xtx_t gives information about ϵt\epsilon_t.

Their covariance makes the dependence explicit. Since ϵt\epsilon_t and xt−1x_{t-1} are independent,

Cov⁡(ϵt, xt)=Cov⁡(ϵt, αt xt−1+βt ϵt)=βt I  ≠  0.\operatorname{Cov}(\epsilon_t,\,x_t) =\operatorname{Cov}\big(\epsilon_t,\ \sqrt{\alpha_t}\,x_{t-1}+\sqrt{\beta_t}\,\epsilon_t\big) =\sqrt{\beta_t}\,I\;\ne\;0 .

Nonzero covariance rules out independence. Fresh independent noise cannot replace the original noise after observing xtx_t.

The marginal law of ϵt\epsilon_t remains standard Gaussian. Its conditional law given xtx_t is different, and that is the law inversion would require.

A shuffled deck gives the same intuition. Although the shuffle was random, its observed result constrains what that particular shuffle did.

Applying an unrelated random shuffle backward does not undo the original one. Likewise, we cannot independently redraw the hidden ϵt\epsilon_t.

Could we calculate the reverse conditional directly instead?

We know the forward transition, so Bayes’ rule suggests

q(xt−1∣xt)=q(xt∣xt−1) pt−1(xt−1)pt(xt).q(x_{t-1}\mid x_t)=\frac{q(x_t\mid x_{t-1})\,p_{t-1}(x_{t-1})}{p_t(x_t)} .

The forward factor is known. But pt−1p_{t-1} and ptp_t are noisy-data marginal densities, averaging over all possible clean data. They depend on the unknown pdatap_{\text{data}}. This is an intractable expression: we can write it, but cannot directly evaluate it.

If we cannot calculate it, can we learn it?

We did not expect every quantity to be analytically available. Otherwise there would be little need for learning.

Let a network parameterize pθ(xt−1∣xt)p_\theta(x_{t-1}\mid x_t). Our goal is to adjust θ\theta until this conditional distribution approximates the true reverse law.

Then we would no longer need to calculate the true conditional explicitly.

The question changes from

How do we calculate this distribution?

to

What learning problem would teach a network this distribution?

We first define closeness using KL divergence (M5.1), averaging over the random input xtx_t:

J(θ)=Ept(xt)[DKL(q(xt−1∣xt) ∥ pθ(xt−1∣xt))].\mathcal J(\theta)=\mathbb E_{p_t(x_t)}\Big[D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big)\Big].

We have an objective, but its target is still intractable. We cannot yet evaluate the loss or its gradient.

DiscussionQ2

What information do we actually have? What did the forward process give us?

Training draws x0x_0, tt, and ϵ\epsilon, then constructs xtx_t. We know the full tuple, rather than only xtx_t.

Which extra information might make the target, or an equivalent loss, tractable?

Show the reasoning

x0x_0。

The difficult marginals average over all possible clean origins. During training, however, we know the particular x0x_0 that produced this input.

Let us condition on that x0x_0 first.

Training gives us one extra piece of information

Recall how the noisy input was constructed.

Training begins with clean data and adds noise, so its origin x0x_0 is known. Generation only has the current state, and cannot use this extra information.

Would knowing the clean origin simplify the target? Instead of the first conditional, consider the second:

q(xt−1∣xt)versusq(xt−1∣xt,x0).q(x_{t-1}\mid x_t)\qquad\text{versus}\qquad q(x_{t-1}\mid x_t,x_0).

The second is tractable. This suggests the training objective

J~(θ)=Epdata(x0) Eq(xt∣x0)[DKL(q(xt−1∣xt,x0) ∥ pθ(xt−1∣xt))].\widetilde{\mathcal J}(\theta)=\mathbb E_{p_{\text{data}}(x_0)}\ \mathbb E_{q(x_t\mid x_0)} \Big[D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t,x_0)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big)\Big].

The target sees x0x_0, but the learned model does not.

That restriction is necessary: generation has no clean endpoint available. Training may use extra information to construct a target, while the predictor still only receives xtx_t and tt.

Are we still learning the original reverse conditional despite this asymmetry?

Yes: this change of objective is an exact identity up to a constant.

For fixed xtx_t, many clean images could have produced it. The model cannot distinguish their identities, so it must fit their conditional distributions collectively, weighted by how likely each origin is given xtx_t.

Their mixture is

Ep(x0∣xt)[q(xt−1∣xt,x0)]=q(xt−1∣xt).\mathbb E_{p(x_0\mid x_t)}\big[q(x_{t-1}\mid x_t,x_0)\big]=q(x_{t-1}\mid x_t).

Thus fitting all the tractable conditional targets averages them into the intractable marginal target.

A squared-error analogy helps. If aˉ=(a1+a2+a3)/3\bar a=(a_1+a_2+a_3)/3, fitting all three labels has the same optimum as fitting their mean, because completing the square gives

13∑i=13(x−ai)2=(x−aˉ)2+13∑i=13(ai−aˉ)2⏟independent of x.\frac13\sum_{i=1}^3(x-a_i)^2 =(x-\bar a)^2+\underbrace{\frac13\sum_{i=1}^3(a_i-\bar a)^2}_{\text{independent of }x}.

This suggests the corresponding KL identity:

J~(θ)=J(θ)+C⟹arg⁡min⁡θ J~(θ)=arg⁡min⁡θ J(θ),\widetilde{\mathcal J}(\theta)=\mathcal J(\theta)+C \quad\Longrightarrow\quad \arg\min_\theta\ \widetilde{\mathcal J}(\theta)=\arg\min_\theta\ \mathcal J(\theta),

CC does not depend on θ\theta. In an unrestricted conditional family, the optimum is the mixture above, namely q(xt−1∣xt)q(x_{t-1}\mid x_t).

We have exchanged an intractable objective for a tractable one with the same minimizers, without directly evaluating the marginal target.

Try itDerive the parameter-independent difference between the objectives

We want to show that conditioning the training target on x0x_0 preserves the original optimization problem.

Fix xtx_t and consider

DKL(q(xt−1∣xt,x0) ∥ pθ(xt−1∣xt)).D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t,x_0)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big).

Expand the KL definition:

DKL(q(xt−1∣xt,x0) ∥ pθ(xt−1∣xt))=∫q(xt−1∣xt,x0)log⁡q(xt−1∣xt,x0) dxt−1−∫q(xt−1∣xt,x0)log⁡pθ(xt−1∣xt) dxt−1.\begin{aligned} &D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t,x_0)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big)\\[4pt] &=\int q(x_{t-1}\mid x_t,x_0)\log q(x_{t-1}\mid x_t,x_0)\,\mathrm dx_{t-1}\\[2pt] &\quad-\int q(x_{t-1}\mid x_t,x_0)\log p_\theta(x_{t-1}\mid x_t)\,\mathrm dx_{t-1}. \end{aligned}

The first term is

∫q(xt−1∣xt,x0)log⁡q(xt−1∣xt,x0) dxt−1.\int q(x_{t-1}\mid x_t,x_0)\log q(x_{t-1}\mid x_t,x_0)\,\mathrm dx_{t-1}.

It contains no θ\theta and remains constant after averaging over clean and noisy states.

Only the second term affects learning:

−∫q(xt−1∣xt,x0)log⁡pθ(xt−1∣xt) dxt−1.-\int q(x_{t-1}\mid x_t,x_0)\log p_\theta(x_{t-1}\mid x_t)\,\mathrm dx_{t-1}.

Average over clean origins compatible with xtx_t:

− Ep(x0∣xt)[∫q(xt−1∣xt,x0)log⁡pθ(xt−1∣xt) dxt−1].-\,\mathbb E_{p(x_0\mid x_t)}\Big[\int q(x_{t-1}\mid x_t,x_0)\log p_\theta(x_{t-1}\mid x_t)\,\mathrm dx_{t-1}\Big].

The model log density does not depend on x0x_0, so we can average the target density first:

−∫[∫q(xt−1∣xt,x0) p(x0∣xt) dx0]log⁡pθ(xt−1∣xt) dxt−1.-\int\Big[\int q(x_{t-1}\mid x_t,x_0)\,p(x_0\mid x_t)\,\mathrm dx_0\Big]\log p_\theta(x_{t-1}\mid x_t)\,\mathrm dx_{t-1}.

The bracketed expression is

∫q(xt−1∣xt,x0) p(x0∣xt) dx0.\int q(x_{t-1}\mid x_t,x_0)\,p(x_0\mid x_t)\,\mathrm dx_0 .

Marginalizing over possible clean origins, weighted by their posterior probabilities, gives

q(xt−1∣xt).q(x_{t-1}\mid x_t).

The second term therefore becomes

−∫q(xt−1∣xt)log⁡pθ(xt−1∣xt) dxt−1,-\int q(x_{t-1}\mid x_t)\log p_\theta(x_{t-1}\mid x_t)\,\mathrm dx_{t-1},

This is the cross-entropy of the marginal reverse law and the model.

Expanding the original KL produces exactly the same parameter-dependent cross-entropy. Its remaining entropy term is also independent of θ\theta.

The objectives therefore differ only by a constant:

J~(θ)=J(θ)+C⟹arg⁡min⁡θ J~(θ)=arg⁡min⁡θ J(θ).\widetilde{\mathcal J}(\theta)=\mathcal J(\theta)+C \quad\Longrightarrow\quad \arg\min_\theta\ \widetilde{\mathcal J}(\theta)=\arg\min_\theta\ \mathcal J(\theta).

With sufficient model expressiveness, the optimum is

pθ(xt−1∣xt)=q(xt−1∣xt).p_\theta(x_{t-1}\mid x_t)=q(x_{t-1}\mid x_t).

Extra training information thus teaches the reverse distribution we originally wanted.

We call this recurring construction the conditional trick: make a marginal target tractable by conditioning, and let the loss perform the remaining averaging. Lai and colleagues [2] organize its diffusion variants. This note uses KL; U1.3 uses MSE, and U2 applies it to velocity.

Calculate the conditional posterior

Now derive the tractable target using Bayes’ rule:

q(xt−1∣xt,x0)=q(xt∣xt−1,x0) q(xt−1∣x0)q(xt∣x0)=q(xt∣xt−1) q(xt−1∣x0)q(xt∣x0).q(x_{t-1}\mid x_t,x_0) =\frac{q(x_t\mid x_{t-1},x_0)\,q(x_{t-1}\mid x_0)}{q(x_t\mid x_0)} =\frac{q(x_t\mid x_{t-1})\,q(x_{t-1}\mid x_0)}{q(x_t\mid x_0)} .

The second equality uses the Markov property: the next forward step only depends on the current state. All three factors are known forward-process Gaussian densities.

The first is a transition; the other two use the direct-sampling formula from U1.1:

q(xt∣xt−1)=N(αtxt−1,βtI),q(xt−1∣x0)=N(αˉt−1x0,(1−αˉt−1)I),q(xt∣x0)=N(αˉtx0,(1−αˉt)I).\begin{aligned} q(x_t\mid x_{t-1})&=\mathcal N(\sqrt{\alpha_t}x_{t-1},\beta_t I),\\ q(x_{t-1}\mid x_0)&=\mathcal N(\sqrt{\bar\alpha_{t-1}}x_0,(1-\bar\alpha_{t-1})I),\\ q(x_t\mid x_0)&=\mathcal N(\sqrt{\bar\alpha_t}x_0,(1-\bar\alpha_t)I). \end{aligned}

These are products and ratios of densities, not random variables. Gaussian exponents are quadratic; combining them and completing the square gives another Gaussian.

Does the resulting posterior variance depend on x0x_0?

Try itComplete the square to obtain the posterior mean and variance

Only xt−1x_{t-1} varies; xtx_t and x0x_0 are fixed. The denominator is constant with respect to xt−1x_{t-1}, so consider the product in the numerator:

q(xt−1∣xt,x0) ∝ q(xt−1∣x0) q(xt∣xt−1) ∝ exp⁡[−∥xt−αt xt−1∥22βt−∥xt−1−αˉt−1 x0∥22(1−αˉt−1)].q(x_{t-1}\mid x_t,x_0)\ \propto\ q(x_{t-1}\mid x_0)\,q(x_t\mid x_{t-1}) \ \propto\ \exp\Big[-\frac{\|x_t-\sqrt{\alpha_t}\,x_{t-1}\|^2}{2\beta_t} -\frac{\|x_{t-1}-\sqrt{\bar\alpha_{t-1}}\,x_0\|^2}{2(1-\bar\alpha_{t-1})}\Big].

Collect the quadratic coefficient:

A=αtβt+11−αˉt−1,A=\frac{\alpha_t}{\beta_t}+\frac{1}{1-\bar\alpha_{t-1}},

Writing the linear term as −2b⊤xt−1-2b^\top x_{t-1} gives

b=αtβt xt+αˉt−11−αˉt−1 x0.b=\frac{\sqrt{\alpha_t}}{\beta_t}\,x_t+\frac{\sqrt{\bar\alpha_{t-1}}}{1-\bar\alpha_{t-1}}\,x_0 .

The exponent becomes −A∥xt−1−b/A∥2/2-A\|x_{t-1}-b/A\|^2/2 plus a constant. Comparing with a Gaussian gives variance 1/A1/A and mean b/Ab/A.

Simplify using αt+βt=1\alpha_t+\beta_t=1 and αtαˉt−1=αˉt\alpha_t\bar\alpha_{t-1}=\bar\alpha_t:

αt−αtαˉt−1+βt=(αt+βt)−αˉt=1−αˉt,\alpha_t-\alpha_t\bar\alpha_{t-1}+\beta_t=(\alpha_t+\beta_t)-\bar\alpha_t=1-\bar\alpha_t ,

Thus β~t=(1−αˉt−1)βt/(1−αˉt)\tilde\beta_t=(1-\bar\alpha_{t-1})\beta_t/(1-\bar\alpha_t). Multiplying this by bb gives the two mean coefficients below.

Substitution yields

q(xt−1∣xt,x0)=N(μ~t(xt,x0), β~tI),q(x_{t-1}\mid x_t,x_0)=\mathcal N\big(\tilde\mu_t(x_t,x_0),\ \tilde\beta_t I\big),

and

μ~t=αˉt−1 βt1−αˉt x0+αt (1−αˉt−1)1−αˉt xt,β~t=1−αˉt−11−αˉt βt.\tilde\mu_t=\frac{\sqrt{\bar\alpha_{t-1}}\,\beta_t}{1-\bar\alpha_t}\,x_0 +\frac{\sqrt{\alpha_t}\,(1-\bar\alpha_{t-1})}{1-\bar\alpha_t}\,x_t, \qquad \tilde\beta_t=\frac{1-\bar\alpha_{t-1}}{1-\bar\alpha_t}\,\beta_t .

The mean is a schedule-dependent linear combination of x0x_0 and xtx_t. Its coefficients need not sum to one. The variance depends on the schedule alone, not on either observed value.

Training DDPM

We can now evaluate the training target:

q(xt−1∣xt,x0)=N(μ~t(xt,x0), β~tI)q(x_{t-1}\mid x_t,x_0)=\mathcal N\big(\tilde\mu_t(x_t,x_0),\ \tilde\beta_t I\big)

Only the mean depends on the image values. The model lacks x0x_0, so keep the variance and mean formula, replacing the clean image with x^θ(xt,t)\hat x_\theta(x_t,t):

pθ(xt−1∣xt)=N(μ~t(xt, x^θ(xt,t)), β~tI).p_\theta(x_{t-1}\mid x_t)=\mathcal N\Big(\tilde\mu_t\big(x_t,\ \hat x_\theta(x_t,t)\big),\ \tilde\beta_t I\Big).

The network receives only information available during generation: the present state and timestep. U1.4 examines the cost of this Gaussian assumption.

With equal fixed covariances, KL reduces to a distance between means:

DKL(q(xt−1∣xt,x0) ∥ pθ(xt−1∣xt))=12β~t∥μ~t(xt,x0)−μ~t(xt,x^θ(xt,t))∥2.\begin{aligned} D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t,x_0)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big) &=\frac{1}{2\tilde\beta_t}\Big\|\tilde\mu_t(x_t,x_0)-\tilde\mu_t\big(x_t,\hat x_\theta(x_t,t)\big)\Big\|^2 . \end{aligned}

Equal Gaussian normalizers cancel. Expanding the quadratic forms leaves precisely the squared difference of the means.

The posterior mean is affine in x0x_0, with the displayed schedule coefficient. Consequently its error is proportional to clean-image prediction error:

∥μ~t(xt,x0)−μ~t(xt,x^θ)∥2=(αˉt−1 βt1−αˉt)2∥x0−x^θ∥2.\Big\|\tilde\mu_t(x_t,x_0)-\tilde\mu_t\big(x_t,\hat x_\theta\big)\Big\|^2=\Big(\frac{\sqrt{\bar\alpha_{t-1}}\,\beta_t}{1-\bar\alpha_t}\Big)^{2}\big\|x_0-\hat x_\theta\big\|^2 .

The full objective becomes weighted squared error:

J~(θ)=Et, x0, ϵ[w(t) ∥x^θ(xt,t)−x0∥2],w(t)=αˉt−1 βt2(1−αˉt)(1−αˉt−1),\widetilde{\mathcal J}(\theta)=\mathbb E_{t,\,x_0,\,\epsilon}\Big[w(t)\,\big\|\hat x_\theta(x_t,t)-x_0\big\|^2\Big], \qquad w(t)=\frac{\bar\alpha_{t-1}\,\beta_t}{2(1-\bar\alpha_t)(1-\bar\alpha_{t-1})},

The input is sampled directly from xt=αˉtx0+σtϵx_t=\sqrt{\bar\alpha_t}x_0+\sigma_t\epsilon. We have arrived at regression, without an adversary or an intractable normalizing constant.

But this raises a familiar concern:

Did we not just reject L2L_2?
Why does it work here?

DiscussionQ3

In U1.0, independent-pair L2L_2 learned one mean image. This is also squared error against real clean data.

Why does it avoid the same problem?

Show the reasoning

The difference is pairing.

Previously, noise and data were independent, so the optimum was a constant. Now the forward process couples xtx_t to x0x_0. The optimum is a conditional expectation (M1.2):

x^⋆(xt,t)=E[x0∣xt].\hat x^{\star}(x_t,t)=\mathbb E\big[x_0\mid x_t\big].

This is a function of the observed xtx_t. At low noise it is close to the original image; at high noise many origins are plausible, so their weighted average is appropriately blurry.

The old optimum was constant; this optimum depends on the observed state.

Think of reading an eye-chart symbol. When it is clear, its orientation is obvious. When it is almost unreadable, uncertainty over several orientations is appropriate. The information in the input determines the conditional average.

A positive weight w(t)w(t) depends only on time, so it does not change the unrestricted optimum at each fixed noise level.

Substituting the optimal predictor into the reverse mean gives

μ⋆(xt,t)=μ~t(xt, E[x0∣xt]),\mu^\star(x_t,t)=\tilde\mu_t\big(x_t,\ \mathbb E[x_0\mid x_t]\big),

This is the true reverse conditional’s mean. In our Gaussian approximation, the schedule specifies spread and the learned conditional clean mean specifies the center. It need not equal the true reverse conditional’s variance.

We have used the conditional-mean property here. Its proof and implications are developed in U1.3.

Low noise identifies a clean candidate; high noise leaves several plausible candidates whose weighted mean is blurry.

Figure: one noisy state, several clean origins. A broad posterior produces a blurry conditional mean. That blur can be the correct regression answer.

Watch a point being denoised

Interactive demo. Choose xtx_t and vary the noise level. Point sizes encode posterior weights proportional to exp⁡(−∥xt−αˉtx0∥2/(2σt2))\exp(-\|x_t-\sqrt{\bar\alpha_t}x_0\|^2/(2\sigma_t^2)). The arrow points to the conditional mean. At high noise, many candidates contribute.

How do we generate after training?

Given a trained network and current state xtx_t, we want to generate xt−1x_{t-1}.

Our reverse model is

pθ(xt−1∣xt),p_\theta(x_{t-1}\mid x_t),

We parameterize it as a Gaussian, substitute the predicted clean image into the posterior mean, and sample:

xt−1=μ~t(xt, x^θ(xt,t))+β~t z,z∼N(0,I).x_{t-1} = \tilde\mu_t \big( x_t,\ \hat x_\theta(x_t,t) \big) + \sqrt{\tilde\beta_t}\,z, \qquad z\sim\mathcal N(0,I).

This completes one reverse step.

Start from

xT∼N(0,I)x_T\sim\mathcal N(0,I)

and repeat:

xT→xT−1→⋯→x1→x0,x_T\to x_{T-1}\to\cdots\to x_1\to x_0,

The final state is a generated sample.

We now have both a training procedure and a generation procedure.

Why should regression improve generation?

Our practical objective is regression. How does it connect to the distribution of generated data?

We can follow three steps.

First, start with likelihood. Marginalizing the latent path makes pθ(x0)p_\theta(x_0) difficult to evaluate. Introducing the forward path and applying Jensen’s inequality gives

−log⁡pθ(x0) ≤ Eq(x1:T∣x0) ⁣[−log⁡pθ(x0:T)q(x1:T∣x0)].-\log p_\theta(x_0)\ \le\ \mathbb E_{q(x_{1:T}\mid x_0)}\!\left[-\log\frac{p_\theta(x_{0:T})}{q(x_{1:T}\mid x_0)}\right].

This supplies an upper bound on negative log-likelihood, corresponding to the negative ELBO; see What can we optimize when the required marginal is intractable?.

Second, compare distributions over complete paths. Averaging over real data yields

DKL(q(x0:T) ∥ pθ(x0:T))+constant.D_{\mathrm{KL}}\big(q(x_{0:T})\,\big\|\,p_\theta(x_{0:T})\big)+\text{constant}.

We are fitting the model’s reverse-path law to the forward-path law induced by data.

Third, factor the path-level KL through the Markov structure. Its parameter-dependent transition terms are

∑tEpt(xt)[DKL(q(xt−1∣xt) ∥ pθ(xt−1∣xt))].\sum_t\mathbb E_{p_t(x_t)}\Big[D_{\mathrm{KL}}\big(q(x_{t-1}\mid x_t)\,\big\|\,p_\theta(x_{t-1}\mid x_t)\big)\Big].

These are the reverse-step objectives we converted into regression. The terminal prior term is fixed when the prior is fixed; the boundary reconstruction term is handled separately.

The connection is therefore

regression loss⟶reverse-step KL⟶path KL⟶negative log-likelihood bound.\begin{aligned} \text{regression loss}&\longrightarrow\text{reverse-step KL}\\ &\longrightarrow\text{path KL}\\ &\longrightarrow\text{negative log-likelihood bound}. \end{aligned}

Regression is thus connected to generative likelihood rather than chosen arbitrarily.

This does not imply exact reverse transitions: our single-Gaussian model family generally cannot express the true reverse conditional.

How accurate is this approximation? Must sampling add noise? What changes as timesteps become smaller?

We will discuss these questions in U1.4.

A reverse step need not predict clean data directly

Given xt=αˉtx0+σtϵx_t=\sqrt{\bar\alpha_t}x_0+\sigma_t\epsilon, knowing either clean data or accumulated noise determines the other:

x0=xt−σtϵαˉt⟺ϵ=xt−αˉtx0σt.x_0=\frac{x_t-\sigma_t\epsilon}{\sqrt{\bar\alpha_t}} \qquad\Longleftrightarrow\qquad \epsilon=\frac{x_t-\sqrt{\bar\alpha_t}x_0}{\sigma_t}.

A network may predict noise and convert it to a clean estimate. This choice of output representation is its parametrization.

Three common choices are clean-data prediction, noise prediction, and vv prediction.

Clean-data prediction outputs x^0\hat x_0, as in the derivation above.

Noise prediction, used in DDPM [1], estimates the accumulated noise:

Lϵ=E[∥ϵθ(xt,t)−ϵ∥2],x^0=xt−σtϵθαˉt.\mathcal L_\epsilon=\mathbb E\big[\|\epsilon_\theta(x_t,t)-\epsilon\|^2\big], \qquad \hat x_0=\frac{x_t-\sigma_t\epsilon_\theta}{\sqrt{\bar\alpha_t}} .

vv prediction, introduced by Salimans and Ho [3], writes the coefficients as cosine and sine and defines

v=αˉt ϵ−σt x0.v=\sqrt{\bar\alpha_t}\,\epsilon-\sigma_t\,x_0 .

In the coefficient plane, vv is perpendicular to the xtx_t direction. It approaches noise at one end and negative clean data at the other. This useful endpoint behavior returns in U5.1.

NotationIn what sense is v perpendicular?

Since αˉt+σt2=1\bar\alpha_t+\sigma_t^2=1, write the coefficients as cos⁡ϕt\cos\phi_t and sin⁡ϕt\sin\phi_t:

xt=cos⁡ϕt x0+sin⁡ϕt ϵ,v=cos⁡ϕt ϵ−sin⁡ϕt x0.x_t=\cos\phi_t\,x_0+\sin\phi_t\,\epsilon,\qquad v=\cos\phi_t\,\epsilon-\sin\phi_t\,x_0 .

These form orthogonal coordinates in the two-dimensional coefficient space of clean data and noise; this does not assert that the realized image vectors are perpendicular. The vv expression is the derivative of xtx_t with respect to ϕt\phi_t.

At nondegenerate noise levels, the three predictions are related by time-dependent affine transformations. A trained output can be converted algebraically without retraining.

Does training each representation with the same-looking MSE produce the same model?

Equivalent representations, different training objectives

Suppose each representation uses MSE:

E[∥prediction−target∥2],\mathbb E\big[\|\text{prediction}-\text{target}\|^2\big],

Converting errors back to the same quantity introduces noise-level-dependent weights.

Substitute the clean/noise conversion:

∥x^0−x0∥2=σt2αˉt ∥ϵθ−ϵ∥2=1SNR(t) ∥ϵθ−ϵ∥2,SNR(t)=αˉt1−αˉt.\|\hat x_0-x_0\|^2=\frac{\sigma_t^2}{\bar\alpha_t}\,\|\epsilon_\theta-\epsilon\|^2 =\frac{1}{\mathrm{SNR}(t)}\,\|\epsilon_\theta-\epsilon\|^2, \qquad \mathrm{SNR}(t)=\frac{\bar\alpha_t}{1-\bar\alpha_t}.

The derived weighted objective becomes, in noise coordinates,

J~(θ)=Et[w(t)SNR(t) Lϵ,t],w(t)SNR(t)=βt2αt(1−αˉt−1).\begin{aligned} \widetilde{\mathcal J}(\theta) &=\mathbb E_t\left[\frac{w(t)}{\mathrm{SNR}(t)}\,\mathcal L_{\epsilon,t}\right],\\ \frac{w(t)}{\mathrm{SNR}(t)} &=\frac{\beta_t}{2\alpha_t(1-\bar\alpha_{t-1})}. \end{aligned}

Thus interconvertible outputs do not imply identical unweighted training objectives.

With unrestricted functions and positive weights, the pointwise optimal predictors correspond under conversion. Finite model capacity and training time make the relative emphasis across noise levels matter:

representation equivalent  ≠  optimization equivalent\boxed{\text{representation equivalent} \;\neq\; \text{optimization equivalent}}

Different parametrizations prioritize errors at different noise levels.

DDPM makes an additional practical choice.

It discards the derived noise-space weighting and uses uniform noise MSE:

Lsimple(θ)=Et, x0, ϵ[∥ϵθ(xt,t)−ϵ∥2].\mathcal L_{\text{simple}}(\theta)=\mathbb E_{t,\,x_0,\,\epsilon}\big[\|\epsilon_\theta(x_t,t)-\epsilon\|^2\big].

This separates two design decisions:

The forward process determines the noisy training data.
Loss weighting determines the relative training emphasis.

Changing weights leaves the ideal predictor at each time unchanged, but changes practical optimization. The particular likelihood bound derived above no longer follows unchanged. Kingma and Gao [4] study the broader relationship between diffusion objectives and ELBOs. We return to this distinction when comparing diffusion with Flow Matching.

The core DDPM training loop

repeat
  x0 ← a batch of training data
  t  ← Uniform{1,…,T}
  ε  ← N(0, I)
  xt ← √ᾱ_t · x0 + √(1-ᾱ_t) · ε
  loss ← ‖ε_θ(xt, t) − ε‖²
  take a gradient step

Implementation still requires batch size, TT, schedule, architecture, and optimizer choices, but this is the central loop.

U1.5 implements it. Its loss need not approach zero; U1.3 explains why a positive residual can be unavoidable.

Check your understanding

Check your understanding

What changes when we condition the training target on x0x_0 and average over examples?

Check your understanding

Which step restricts the attainable reverse distribution?

Check your understanding

How do we obtain a clean estimate from a trained noise predictor?

Check your understanding

How does DDPM’s simple loss relate to the derived loss?

Check your understanding

What should an optimal clean predictor output at high noise?

References

  1. Ho, J., Jain, A., Abbeel, P. Denoising Diffusion Probabilistic Models. NeurIPS 2020.
  2. Lai, C.-H., Song, Y., Kim, D., Mitsufuji, Y., Ermon, S. The Principles of Diffusion Models. 2025, Section 2.2.
  3. Salimans, T., Ho, J. Progressive Distillation for Fast Sampling of Diffusion Models. ICLR 2022.
  4. Kingma, D. P., Gao, R. Understanding Diffusion Objectives as the ELBO with Simple Data Augmentation. NeurIPS 2023.