TutorialsModel training

Chapter 1 — From data to supervision

In Forward diffusion, we derived a formula for particle motion from clean data to pure noise. Since this process is known, we can apply it programmatically to corrupt real images and generate supervision for training.

In practice, we discretize a continuous sample path xx into a chain of progressively noisier states:

x0x1xT1x_0 \rightarrow x_1 \rightarrow \dots x_{T-1}

where x0x_0 is a real image from the dataset and the final state xT1x_{T-1} is pure noise.

You might expect that we should explicitly generate the full chain for each x0x_0. But in practice, each iteration usually samples a single random time tt. The model then sees one pair: for example (xtxt1)(x_t \to x_{t-1}) or (xtx0)(x_t \to x_0), depending on the exact training objective.

But why not train on the entire chain? Isn't more training data always better?

In practice, training has a finite budget of NN iterations. Spending many consecutive updates on one chain from a fixed x0x_0 gives highly correlated examples. Sampling fresh (x0,t)(x_0, t) pairs each iteration typically covers the space more efficiently under the same budget. With enough compute, you would still eventually visit the full chain anyway.

To express xtx_t, don't we need to express all x<tx_{<t}? If so, isn't it a waste to not train on x<tx_{<t}?

For DDPM-style forward processes, we can sample xtx_t directly from x0x_0 and tt via a closed-form distribution, so we do not need to explicitly generate all x<tx_{<t} first.

The overall training data generation algorithm

  1. Draw x0x_0 from the training set.
  2. Draw a random time step tt.
  3. Corrupt x0x_0 into xtx_t using the forward motion.
  4. Train the model to predict the denoising target associated with xtx_t (more on objectives soon).
1 / 3