Basis Lab

Answers · How models work

Why does the forward noising process have to be a Markov chain?

In shortThe forward process is made memoryless so that each step is a fixed random rule and any later state can be computed straight from the original picture.

Nothing forces a noising process to be Markov in general. The forward process here is Markov because it is built from one line whose only inputs are the current state and fresh independent noise, and that choice is what makes each step an exact Gaussian and the distribution at any later step computable directly from the original picture.

xt=1−βt xt−1+βt εt,εt∼N(0,I)x_t = \sqrt{1-\beta_t}\,x_{t-1} + \sqrt{\beta_t}\,\varepsilon_t,\qquad \varepsilon_t\sim\mathcal N(0,I)

Given xt−1x_{t-1}, the right-hand side contains no random quantity except εt\varepsilon_t, drawn independently of everything before step tt. So the conditional distribution is p(xt∣x0:t−1)=p(xt∣xt−1)=N(1−βt xt−1,βtI)p(x_t\mid x_{0:t-1}) = p(x_t\mid x_{t-1}) = \mathcal N(\sqrt{1-\beta_t}\,x_{t-1}, \beta_t I). The earlier states are still present in xt−1x_{t-1}; they are not ignored, they have already been summed up in it. What is absent is any extra dependence on the route by which xt−1x_{t-1} was reached.

Take βt=0.02\beta_t=0.02. A current value of 11 becomes a random value centred at 0.98⋅1=0.9899\sqrt{0.98}\cdot 1 = 0.9899 with variance 0.020.02. The next step reads only the drawn value. It does not read the value from two steps ago, because the fresh noise from the first step is already inside the drawn value; adding another independent draw is all the next step does.

What the memoryless step buys

Expand one step to see why this is not a cosmetic restriction. Substituting the previous line gives the next equation. The original picture still influences xtx_t, but only through the coefficient that survives from multiplying the shrinks. The random terms multiply as well, and because each εs\varepsilon_s is independent, those terms combine into one Gaussian. That is the algebra that turns a thousand applications of the line into a single formula.

xt=(1−βt)(1−βt−1) xt−2+1−βtβt−1 εt−1+βt εtx_t = \sqrt{(1-\beta_t)(1-\beta_{t-1})}\,x_{t-2} + \sqrt{1-\beta_t}\sqrt{\beta_{t-1}}\,\varepsilon_{t-1} + \sqrt{\beta_t}\,\varepsilon_t

Repeating that elimination all the way back gives the closed form below, where αˉt\bar\alpha_t is the product of the shrink factors. This is the first payoff of the Markov construction: training does not need to run the chain forward one step at a time to obtain a noisy example at step tt.

q(xt∣x0)=N(αˉt x0,(1−αˉt)I),αˉt=∏s=1t(1−βs)q(x_t\mid x_0) = \mathcal N\left(\sqrt{\bar\alpha_t}\,x_0, (1-\bar\alpha_t)I\right), \qquad \bar\alpha_t = \prod_{s=1}^{t}(1-\beta_s)

With βs=0.02\beta_s=0.02 at every step, after 100100 steps αˉ100=0.98100=0.1326\bar\alpha_{100}=0.98^{100}=0.1326. Then x100=0.1326 x0+0.8674 εx_{100}=\sqrt{0.1326}\,x_0+\sqrt{0.8674}\,\varepsilon, that is 0.3641 x0+0.9313 ε0.3641\,x_0+0.9313\,\varepsilon. One draw gives a training example at step 100100; no simulation of the ninety-nine preceding steps is needed. If the step also depended on xt−2x_{t-2}, the product would not close over one state and this shortcut would disappear.

The reverse direction is where this matters most. The true reverse of a Markov chain is also Markov, with transition p(xt−1∣xt)p(x_{t-1}\mid x_t). A network trained to approximate that transition sees one noisy picture and one time, so it solves a small local problem. If the forward step remembered two or three earlier states, the reverse would need the same window, and the input to the network would grow with the length of the chain.

The natural guess is that conditioning only on xt−1x_{t-1} must throw information away. It throws away the details of the route, not the information in the current value. If the line were xt=f(xt−2,xt−1)+βt εtx_t = f(x_{t-2},x_{t-1}) + \sqrt{\beta_t}\,\varepsilon_t, then p(xt∣xt−1)p(x_t\mid x_{t-1}) would not be a complete conditional: the reverse step from xtx_t would need xt−2x_{t-2} as well, then xt−3x_{t-3}, and the training target would no longer be a function of one noisy picture and one time index. You could still destroy a picture that way, but you would have left the method with an exact marginal and a local reverse step.

The same collapse is why one training objective can be written without unrolling the chain. A single random tt and a single ε\varepsilon produce a valid noisy picture at that tt, because the marginal is exact. Without the Markov property the marginal at tt would depend on the whole sequence of earlier choices, so a training pair would have to carry that sequence or approximate it.

The property also fails if the noise is correlated between steps. Fresh εt\varepsilon_t is essential: if εt\varepsilon_t shared randomness with εt−1\varepsilon_{t-1}, then given xt−1x_{t-1} the next value would still depend on earlier draws, and the Markov equality would be false. Markov here is temporal, not spatial. It does not say pixels are independent of one another, only that the next whole picture depends on the previous whole picture and on nothing older. So the forward process does not have to be Markov to add noise, but it has to be Markov for the closed-form marginal and the single-step reverse target to exist in this form.

Worth keeping

  • A noising process does not have to be Markov, but the one used here is Markov by construction.
  • Conditioning on the current noisy picture loses the route, not the information in the current value.
  • Without the Markov property, the closed-form marginal and the single-step training target both fail.

Where this goes next

This question is one step of How Noise Becomes a Picture, a course that works through its subject from the beginning. The page that teaches this part of it is Destroying a Picture on Purpose, and it reads the whole way through whether or not you have an account.

What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.

Read that pageThe whole course

Other questions people ask about this

  1. Why does diffusion add Gaussian noise instead of any random corruption?Diffusion adds Gaussian noise because Gaussian errors combine exactly: each step keeps the spread fixed and gives a closed-form noisy picture at any later step, which makes the reverse step learnable.
  2. How do you turn the predicted noise into the mean of the previous image?Subtract a small scheduled fraction of the predicted noise from the current image, then rescale to undo the forward step's shrinkage.
  3. What does classifier-free guidance actually add together, and why does it make the prompt stronger?It adds the unconditional prediction to several times the gap between the conditional and unconditional predictions, pushing past the conditional answer so the prompt is obeyed more strictly.
  4. Why is the model's noise prediction really the score of the noised image distribution?The network's noise prediction, divided by the noise level and given a minus sign, is the direction that makes a noised image more plausible.
  5. Why does the model get stuck repeating the same sentence over and over?The model is not stuck in a memory loop: once it has written a phrase, that phrase is in its context and makes writing it again more likely, so a decoder that always picks the top word cannot leave.
  6. Why does the same request cost more tokens in some languages than in others?A token is learned from a corpus, so a language that was rare in the training text is split into many more pieces for the same meaning, and the price multiplier follows.

Read alongside