Search

Search papers and lessons

v-Prediction

Level 4 · 11 min read

v-prediction trains a diffusion network to output a weighted difference of the noise and the clean data, which keeps the training target well scaled at every noise level.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Discrete math
  • Linear algebra
  • Generative models
  • Inference
  • ReadReady to readNot yet

TL;DR

A diffusion model is trained to predict something from a noisy input. The usual choice is the noise that was added. v-prediction asks the network for a different target: a weighted difference of the noise and the clean data. Salimans and Ho introduced it in 2022, and it keeps the target at a similar size whether the input is nearly clean or nearly pure noise. That makes training steadier and makes it easier to sample in only a few steps.

Builds on: Diffusion Model, Signal-to-Noise Ratio, Gaussian (Normal) Distribution · Leads to: Progressive Distillation, Imagen Video

Where it's used

Image generators. Some Stable Diffusion 2 checkpoints, the ones trained at 768 pixels, were released as v-prediction models. A sampler has to know which target a network was trained for, or the output comes out washed out or noisy.

Video. Imagen Video uses v-parameterisation in its cascade of diffusion models. CogVideoX also uses v-prediction, together with a fix for the final noise level, so a video model with many frames per clip gets a well-scaled training target.

Few-step samplers. The method was introduced alongside Progressive Distillation, which trains a fast student to do in one step what a teacher does in several. The student's targets must stay well behaved when each step is large, and v-prediction is what keeps them stable.

How it works

Take one number as the data, to keep the arithmetic visible. Let x0=2x_0 = 2 be the clean value and ε=1\varepsilon = 1 the noise. Pick a point on the schedule where α=0.6\alpha = 0.6 and σ=0.8\sigma = 0.8. These satisfy α2+σ2=1\alpha^2 + \sigma^2 = 1, so αˉ=0.36\bar\alpha = 0.36.

  1. Start with the clean value and the noise. x0=2x_0 = 2 and ε=1\varepsilon = 1. Nothing is mixed yet. Check: both are plain numbers.
  2. Mix them into the noisy input. xt=αx0+σε=0.6×2+0.8×1=2.0x_t = \alpha x_0 + \sigma \varepsilon = 0.6 \times 2 + 0.8 \times 1 = 2.0. Check: the network sees one number and must work out how it was made.
  3. Build the v target. v=αε−σx0=0.6×1−0.8×2=−1.0v = \alpha \varepsilon - \sigma x_0 = 0.6 \times 1 - 0.8 \times 2 = -1.0. Check: vv is another mix of the same two quantities, with the signs and weights changed.
  4. Ask the network for v and score it. Suppose it predicts v^=−0.8\hat v = -0.8. The loss is (v−v^)2=(−1.0+0.8)2=0.04(v - \hat v)^2 = (-1.0 + 0.8)^2 = 0.04. Check: the loss is zero only when the prediction matches vv exactly.
  5. Turn the prediction into a clean estimate. x^0=αxt−σv^=0.6×2.0+0.8×0.8=1.84\hat x_0 = \alpha x_t - \sigma \hat v = 0.6 \times 2.0 + 0.8 \times 0.8 = 1.84. Check: this is close to the true 22, and the error came from the prediction error of 0.20.2 in vv.
  6. Recover the noise from the same output. ε^=σxt+αv^=0.8×2.0−0.6×0.8=1.12\hat\varepsilon = \sigma x_t + \alpha \hat v = 0.8 \times 2.0 - 0.6 \times 0.8 = 1.12. Check: one network output gives both the clean estimate and the noise, so the choice of target does not limit what the sampler can use.

The plot shows the two weights that define the target. Their squares always add to one, so the target never loses its scale.

00.20.40.60.8100.20.40.60.81fraction of the schedule (t / T)weight
  • alpha, weight on the noise-free part
  • sigma, weight on the noise
The two weights trace a quarter circle as the schedule runs. At the midpoint both equal 0.7071, and the squares always sum to 1.

The math

A squared-error objective trains the network on whichever target is chosen. Write the noisy input as a mix of data and noise, with αt=αˉt\alpha_t = \sqrt{\bar\alpha_t} and σt=1−αˉt\sigma_t = \sqrt{1 - \bar\alpha_t}.

Definition: v-prediction target

For data x0x_0, noise ε∼N(0,I)\varepsilon \sim \mathcal{N}(0, I) and a noisy input xt=αtx0+σtεx_t = \alpha_t x_0 + \sigma_t \varepsilon with αt2+σt2=1\alpha_t^2 + \sigma_t^2 = 1, the v-target is

v=αtε−σtx0.v = \alpha_t \varepsilon - \sigma_t x_0.

A network vθ(xt,t)v_\theta(x_t, t) is trained to output it.

Steps 1 and 2 in symbols: the noisy input

The noisy input is the same mix as in the diffusion model lesson, xt=αtx0+σtεx_t = \alpha_t x_0 + \sigma_t \varepsilon. The condition αt2+σt2=1\alpha_t^2 + \sigma_t^2 = 1 means the two weights are the sine and cosine of one angle. That is why the plot is a quarter circle. The condition is what keeps the variance of xtx_t fixed when the data and noise both have unit variance.

Step 3 in symbols: the target

The target is the rotated pair (ε,x0)(\varepsilon, x_0) with weights αt\alpha_t and −σt-\sigma_t. Because the weights come from the same angle as the input, the target can be written from the input and the prediction alone. Two inverse formulas recover the clean value and the noise:

x0=αtxt−σtv,ε=σtxt+αtv.x_0 = \alpha_t x_t - \sigma_t v, \qquad \varepsilon = \sigma_t x_t + \alpha_t v.

Check that the first one is correct. Substitute xtx_t and vv: αt(αtx0+σtε)−σt(αtε−σtx0)=(αt2+σt2)x0=x0\alpha_t(\alpha_t x_0 + \sigma_t \varepsilon) - \sigma_t(\alpha_t \varepsilon - \sigma_t x_0) = (\alpha_t^2 + \sigma_t^2) x_0 = x_0. The noise terms cancel, which is the whole point of the construction.

Step 4 in symbols: the loss

Training minimises the expectation of a loss, here the squared error:

Lv=Et,x0,ε[ ∥v−vθ(xt,t)∥2].L_v = \mathbb{E}_{t, x_0, \varepsilon}\left[\, \left\| v - v_\theta(x_t, t) \right\|^2 \right].

Each draw of tt, data and noise gives one squared-error term, the same shape as the noise-prediction loss. Only the target changed.

Steps 5 and 6: why the target is better scaled

Suppose instead the network predicts the noise, and the clean estimate is x^0=(xt−σtε^)/αt\hat x_0 = (x_t - \sigma_t \hat\varepsilon)/\alpha_t. An error δ\delta in ε^\hat\varepsilon becomes an error σtδ/αt\sigma_t \delta / \alpha_t in x^0\hat x_0. Near the high-noise end αt\alpha_t is close to zero, so this error is amplified. With v-prediction the clean estimate is αtxt−σtv^\alpha_t x_t - \sigma_t \hat v, so an error δ\delta in v^\hat v becomes σtδ\sigma_t \delta, which is never larger than δ\delta because σt≤1\sigma_t \le 1.

If the data and noise both have unit variance and are independent, then Var(v)=αt2+σt2=1\mathrm{Var}(v) = \alpha_t^2 + \sigma_t^2 = 1 at every step. The target has the same size everywhere on the schedule.

Worked examples

Example
The round trip, by hand

Take x0=2x_0 = 2, ε=1\varepsilon = 1, α=0.6\alpha = 0.6, σ=0.8\sigma = 0.8.

  1. Check the weights: 0.62+0.82=0.36+0.64=10.6^2 + 0.8^2 = 0.36 + 0.64 = 1.
  2. Noisy input: xt=0.6×2+0.8×1=1.2+0.8=2.0x_t = 0.6 \times 2 + 0.8 \times 1 = 1.2 + 0.8 = 2.0.
  3. Target: v=0.6×1−0.8×2=0.6−1.6=−1.0v = 0.6 \times 1 - 0.8 \times 2 = 0.6 - 1.6 = -1.0.
  4. Recover the clean value: αxt−σv=0.6×2.0−0.8×(−1.0)=1.2+0.8=2.0\alpha x_t - \sigma v = 0.6 \times 2.0 - 0.8 \times (-1.0) = 1.2 + 0.8 = 2.0.
  5. Interpretation: the round trip returns the original x0=2x_0 = 2 exactly, so the target throws away no information about the clean value.
Example
A wrong prediction, read two ways

Use the same point as the example above, with xt=2.0x_t = 2.0, and let the network predict v^=−0.8\hat v = -0.8 where the truth is −1.0-1.0.

  1. Loss term: (v−v^)2=(−1.0+0.8)2=0.04(v - \hat v)^2 = (-1.0 + 0.8)^2 = 0.04.
  2. Clean estimate: x^0=0.6×2.0−0.8×(−0.8)=1.2+0.64=1.84\hat x_0 = 0.6 \times 2.0 - 0.8 \times (-0.8) = 1.2 + 0.64 = 1.84, against the true 22.
  3. Noise estimate: ε^=0.8×2.0+0.6×(−0.8)=1.6−0.48=1.12\hat\varepsilon = 0.8 \times 2.0 + 0.6 \times (-0.8) = 1.6 - 0.48 = 1.12, against the true 11.
  4. Interpretation: the single prediction error of 0.20.2 in vv shows up as errors of about 0.160.16 in the clean value and 0.120.12 in the noise. The two readings move together because they come from the same output.
Example
Error amplification at the high-noise end

A late step in a long schedule has αˉt=0.0004\bar\alpha_t = 0.0004, so αt=0.02\alpha_t = 0.02 and σt=0.9996≈0.9998\sigma_t = \sqrt{0.9996} \approx 0.9998. Suppose the network is off by δ=0.1\delta = 0.1 in its output, whichever target it was trained on.

  1. Noise-prediction route: x^0=(xt−σtε^)/αt\hat x_0 = (x_t - \sigma_t \hat\varepsilon)/\alpha_t, so the error in x^0\hat x_0 is σtδ/αt=0.9998×0.1/0.02≈5.0\sigma_t \delta / \alpha_t = 0.9998 \times 0.1 / 0.02 \approx 5.0.
  2. v-prediction route: x^0=αtxt−σtv^\hat x_0 = \alpha_t x_t - \sigma_t \hat v, so the error in x^0\hat x_0 is σtδ≈0.1\sigma_t \delta \approx 0.1.
  3. Compare: the same 0.1 mistake is fifty times more damaging on the noise route, because 1/αt=501/\alpha_t = 50.
  4. Interpretation: this is why noise prediction struggles at the very noisy end of a schedule, where the clean estimate is most sensitive to the network's output. v-prediction keeps that sensitivity bounded.

Try it: at αˉt=0.0001\bar\alpha_t = 0.0001, so αt=0.01\alpha_t = 0.01, the same error δ=0.1\delta = 0.1 in the noise output is amplified to what size in x^0\hat x_0? How many times larger is it than the v-route error? Answer: σtδ/αt≈0.1/0.01=10\sigma_t \delta / \alpha_t \approx 0.1 / 0.01 = 10, which is 100100 times the v-route error of about 0.10.1, because 1/αt=1001/\alpha_t = 100.

Common mistakes and tradeoffs

It is tempting to think v is a new kind of noise. In fact it is a mix of the noise and the clean data with the weights αt\alpha_t and −σt-\sigma_t. It adds no new randomness, and the clean data is recovered from it exactly once the noisy input is known.

It is tempting to think switching to v needs a new network or new training data. In fact the architecture and the loss have the same form. Only the target changes, and the sampler converts the output to whichever quantity it needs.

It is tempting to think v is always better. In fact the gain is largest at the high-noise end and for few-step sampling. With many steps on standard images, noise prediction often works just as well, so the choice is a matter of which regime the model is for.

SituationNoise predictionv-prediction
Many sampling steps, moderate resolutionWorks wellWorks well
Few-step sampling or distillationLess stable at the noisy endKeeps the target well scaled
Very long schedules reaching pure noiseClean estimate amplified near the endBounded sensitivity

A real cost is that the checkpoint fixes the parameterisation. A sampler that assumes noise prediction, given a v-prediction checkpoint, reads v^\hat v as ε^\hat\varepsilon and produces degraded output. Always convert with the formulas above.

History

Ho, Jain and Abbeel's 2020 paper trained diffusion models to predict the noise, and that became the standard recipe. Its clean-estimate formulas already contained the pieces that v-prediction later rearranged. When Salimans and Ho set out to distil long samplers into short ones in 2022, they found the noise target fragile at the noisy end, and they proposed predicting the weighted difference instead. Later image and video systems adopted v-prediction for some checkpoints and cascades.

Recap

  • A diffusion network can predict the noise, the clean data, or the weighted difference v, and each choice is a rearrangement of the same mix.
  • v is αtε−σtx0\alpha_t \varepsilon - \sigma_t x_0, and the clean value and noise are recovered from it with two inverse formulas.
  • Because αt2+σt2=1\alpha_t^2 + \sigma_t^2 = 1, the target keeps a steady size, and errors do not blow up when the input is nearly pure noise.
  • Few-step samplers and distillation benefit most, so the choice matters most in that regime.

To go further, read about Progressive Distillation for the few-step setting this target was built for, then Imagen Video to see the parameterisation used at video scale.

Check yourself

QuestionRecall: what is the v-target in terms of the noise ε\varepsilon, the clean data x0x_0, and the weights αt\alpha_t and σt\sigma_t?Show answer

v=αtε−σtx0v = \alpha_t \varepsilon - \sigma_t x_0. It is a weighted difference of the noise and the clean data, with the noise weighted by αt\alpha_t and the clean data by −σt-\sigma_t.

QuestionCompute: with αt=0.8\alpha_t = 0.8, σt=0.6\sigma_t = 0.6, x0=1x_0 = 1 and ε=−1\varepsilon = -1, find xtx_t and vv, then recover x0x_0 from them.Show answer

xt=0.8×1+0.6×(−1)=0.2x_t = 0.8 \times 1 + 0.6 \times (-1) = 0.2. Then v=0.8×(−1)−0.6×1=−0.8−0.6=−1.4v = 0.8 \times (-1) - 0.6 \times 1 = -0.8 - 0.6 = -1.4. Recovering gives αtxt−σtv=0.8×0.2−0.6×(−1.4)=0.16+0.84=1.0\alpha_t x_t - \sigma_t v = 0.8 \times 0.2 - 0.6 \times (-1.4) = 0.16 + 0.84 = 1.0, the original clean value.

QuestionWhy: why does the noise-prediction route make the clean estimate fragile at the very noisy end of a schedule?Show answer

The clean estimate is (xt−σtε^)/αt(x_t - \sigma_t \hat\varepsilon)/\alpha_t, and αt\alpha_t is close to zero there. Dividing by a small number multiplies any error in the network's output, so a small error in the noise output becomes a large error in the clean estimate. The v-route multiplies the error by σt\sigma_t instead, which is at most 1.

QuestionApplied: a checkpoint was trained with v-prediction, but the sampler assumes noise prediction. What goes wrong, and what is the fix?Show answer

The sampler treats the network output v^\hat v as if it were ε^\hat\varepsilon, so each step removes the wrong component of the input. Samples come out washed out or noisy. The fix is to convert the output before using it: ε^=σtxt+αtv^\hat\varepsilon = \sigma_t x_t + \alpha_t \hat v, or to use a sampler that reads v directly.

Sources