No jobs
Foundation 10 min 1 of 4

Destroying an image on purpose

A fixed schedule with a closed form: no network, no simulation, and any timestep in one multiply-add.

What this repairs

Thinking the model learns to add noise, or that the forward process is something the network does rather than a fixed schedule with a closed form.

The forward process is a decision, not a computation. Before any training runs, someone picks a thousand numbers β1βT\beta_1 \dots \beta_T and declares that

q(xtxt1)=N ⁣(1βtxt1, βtI).q(x_t \mid x_{t-1}) = \mathcal{N}\!\left(\sqrt{1-\beta_t}\,x_{t-1},\ \beta_t I\right).

That is the whole forward process. There is no network in it, nothing is fitted to data, and it is identical for every image the model will ever see. The two coefficients are chosen so that their squares sum to one, since (1βt)+βt=1(1-\beta_t) + \beta_t = 1 . That makes the step variance-preserving: feed it unit-variance data and it returns unit-variance data, forever.

Written that way it looks like something you would have to simulate: a thousand small Gaussian steps, applied in order. You do not, and the reason is the only piece of algebra in this concept.

A thousand steps collapse into one

  1. xt=1βt  xt1+βt  zt,ztN(0,I)x_t = \sqrt{1-\beta_t}\;x_{t-1} + \sqrt{\beta_t}\;z_t, \qquad z_t \sim \mathcal{N}(0, I)

    The definition above, written as a reparameterisation instead of a density. Each step scales what it was given down slightly and adds a fresh, independent draw.

  2. xt=αtαt1  xt2+αtβt1  zt1+βt  zt,αt=1βtx_t = \sqrt{\alpha_t \alpha_{t-1}}\;x_{t-2} + \sqrt{\alpha_t \beta_{t-1}}\;z_{t-1} + \sqrt{\beta_t}\;z_t, \qquad \alpha_t = 1 - \beta_t

    Substitute the previous step into this one. Nothing has been approximated yet — this is one line of algebra, and the two noise draws are still separate terms.

  3. αtβt1  zt1+βt  zt  =  αtβt1+βt  zˉ,zˉN(0,I)\sqrt{\alpha_t \beta_{t-1}}\;z_{t-1} + \sqrt{\beta_t}\;z_t \;=\; \sqrt{\alpha_t \beta_{t-1} + \beta_t}\;\bar{z}, \qquad \bar{z} \sim \mathcal{N}(0, I)

    This is the step that does the work, and it is the only one. Two independent zero-mean Gaussians sum to one Gaussian whose variance is the sum of theirs, so two draws become one draw and the chain stops growing.

  4. xt=αˉt  x0+1αˉt  ε,αˉt=st(1βs)x_t = \sqrt{\bar{\alpha}_t}\;x_0 + \sqrt{1-\bar{\alpha}_t}\;\varepsilon, \qquad \bar{\alpha}_t = \prod_{s \le t}(1 - \beta_s)

    Induct on the previous line all the way down to x₀ and the telescoping product is what survives. Any timestep, from the clean image, in one multiply-add — no loop and no intermediate states.

  5. (αˉt)2+(1αˉt)2=1for every t\left(\sqrt{\bar{\alpha}_t}\right)^{2} + \left(\sqrt{1-\bar{\alpha}_t}\right)^{2} = 1 \quad \text{for every } t

    Variance preservation survived the collapse, which is not automatic and is worth checking. The two coefficients are a cosine and a sine of one angle sweeping from 0 to π/2, and that identity is the whole subject of the third concept in this topic.

The closed form is what makes training affordable, and the mechanism is worth being explicit about because it is the reason the training loop looks the way it does.

Without it, producing a training example at t=700t = 700 would mean running seven hundred sequential steps, and a batch would be as expensive as its deepest member. With it, a training step draws tt uniformly at random, draws one ε\varepsilon , and jumps straight there. The loss is therefore an expectation over timesteps,

L=Ex0,ε,t[target(x0,ε,t)fθ(xt,t)2],\mathcal{L} = \mathbb{E}_{x_0,\,\varepsilon,\,t}\Big[\,\big\lVert \text{target}(x_0, \varepsilon, t) - f_\theta(x_t, t) \big\rVert^2\,\Big],

and one network is trained to handle all thousand noise levels at once, each one sampled rather than simulated. Training a diffusion model is a sampling problem over tt ; only inference is sequential.

Check yourself

You need a training example at t = 499. Do you have to run 499 noising steps to get one, and if you take the shortcut, is the result the same?

Show answer

No, and yes — in the sense that matters.

One multiply-add gets you there, and on the textbook curve the coefficients are the ones in the table above, 0.52690.5269 and 0.84990.8499 :

x499=αˉ499x0+1αˉ499ε=0.5269x0+0.8499ε.x_{499} = \sqrt{\bar{\alpha}_{499}}\,x_0 + \sqrt{1-\bar{\alpha}_{499}}\,\varepsilon = 0.5269\,x_0 + 0.8499\,\varepsilon.

On the shipped curve the same line reads 0.4923x0+0.8704ε0.4923\,x_0 + 0.8704\,\varepsilon , which is the same argument with the schedule the model was actually trained on. Either way it is one multiply-add.

It is not the same sample the sequential route would have produced from the same seed, because a different number of Gaussians were drawn — five hundred against one. It is an exact sample from the same distribution q(x499x0)q(x_{499} \mid x_0) , which is the only property the loss depends on. The two routes differ by which draw you got, not by what you are sampling from, and no amount of running the long way round makes the training signal better.

Euler View - ML Experiment Monitor