Reversing the forward process means sampling from , and that distribution is hopeless. It depends on the distribution of all natural images: to know what the slightly-less-noisy version of a noisy patch looked like, you have to know what patches exist in the world.
But there is a conditional that is tractable. If you also knew — the clean image — then is Gaussian with a mean and a variance you can write down in closed form, because both of the densities it is built from are Gaussians you already have.
We do not have . So we estimate it. That sentence is the entire derivation of the training objective, and it is the one that gets skipped: the network is not inverting the forward process, it is supplying the single unavailable term of a posterior whose other parts are known exactly.
The posterior that is available
-
Bayes, conditioned on x₀ throughout. Nothing has been assumed yet; this is a rearrangement of the definition of conditional probability.
-
The forward process is Markov by construction, so conditioning on x₀ as well tells the step nothing new. This is why the numerator is made only of things the previous concept already wrote down.
-
Both surviving factors are Gaussian in x_{t−1} — one from the single step, one from the closed form — and the denominator does not contain x_{t−1} at all, so it is a normalising constant.
-
A product of two Gaussians in the same variable is a Gaussian; completing the square in x_{t−1} gives its mean. Note the shape of the answer — it is a weighted blend of the clean image and the sample you already hold, not a correction applied to one of them.
-
The variance falls out of the same completion of the square, and it depends on the schedule alone — not on the image, not on the network, and not on anything that has to be learned.
-
The whole model, in one line: take the exact posterior and substitute an estimate for the one term you cannot observe. Everything else on this page is known in closed form before training starts.
From a KL divergence to a plain squared error
-
The variational bound decomposes into one of these per timestep. This is where the objective actually comes from, and it is a divergence between distributions rather than an error on an image.
-
Both sides are Gaussians with one and the same fixed variance, because we chose p_θ that way. The KL between two equal-variance Gaussians is just the squared distance between their means — so a divergence becomes an L2, and it is the variance choice that did it.
-
Substitute the posterior mean for both. The two means differ only in their x₀ slot, so everything else cancels and the coefficient in front of x₀ comes out squared.
-
Reparameterise x₀ through the closed form, x₀ = (x_t − √(1−ᾱ)ε)/√ᾱ. Predicting the noise and predicting the image are the same task in different coordinates, and this line is where that first shows up.
-
And then the weight is thrown away. This is a choice, not an identity: the unweighted loss is no longer the variational bound, it up-weights the high-noise timesteps relative to it, and it trains better. Which weighting you are implicitly choosing is the subject of the next concept.
Your network emits a perfect ε̂ at t = 999 — the exact noise that was added. Why is the image not finished?
Show answer
Because a perfect at still only tells the sampler where to move by of the distance to . The posterior is a distribution over slightly-less-noisy images, not over clean ones, and is dominated by the term you already had.
There is a sharper version of the same answer. The network's output is only used to choose a distribution; the sampler then draws from it, adding of fresh noise back in. Even a perfect network run at every timestep does not produce a deterministic image under DDPM — it produces a draw from the data distribution, which is the entire point of a generative model and the thing an regressor cannot do.