Noise, score, and velocity: transform the target and its error together
Derive target conversions under a VP convention and distinguish conditional training scores, marginal score estimators, and parameterization-dependent loss scales.
On this page
The question for today
What you’ll understand
- Convert between clean, noise, score, and velocity quantities at a fixed noisy input.
- Distinguish a conditional Gaussian score target from the learned marginal score.
- Propagate prediction error through the target-conversion Jacobians.
A diffusion network can predict added noise, a clean sample, a score, or a velocity-like target. These are related by algebra only after the process and coefficient convention are fixed. Their squared errors are not numerically interchangeable. Derive the conversion at a fixed noisy input and noise level, then carry its Jacobian into loss weighting and numerical tests.
Velocity is a rotation target under this VP convention
Use a²+σ²=1 and define v=aε−σx_0. Together with x_t=ax_0+σε, this is an orthogonal two-coordinate rotation applied independently to every data coordinate. Its inverse recovers x_0 and ε without dividing by a or sigma. This target is called velocity in the cited diffusion convention; it is not automatically a physical velocity or the derivative of every sampler trajectory. Other interpolations and flow-matching conventions can use different signs, coefficients, and targets.
A predicted v gives corresponding clean and noise predictions through the inverse identities. A noise prediction instead reconstructs x_0 by dividing x_t−σε_hat by a, requiring a>0. A clean prediction reconstructs noise by dividing x_t−ax_0_hat by sigma, requiring sigma>0. These divisions can amplify finite errors near an endpoint. A scheduler's prediction_type must agree with the network's training target; changing a configuration label without transforming the output does not convert a trained model.
The score target and its optimum refer to different conditionals
For the forward Gaussian conditional on a known clean sample, differentiating its log density with respect to x_t gives −ε/σ. Denoising score matching trains against that known noisy target. Under squared error and appropriate regularity, its population optimum given x_t is the conditional expectation of that target, which equals the score of the perturbed data marginal. The individual target is not already the unknown marginal score for that particular clean/noise draw. With external conditioning, the corresponding marginal is conditioned on that information.
Holding x_t and time fixed, a velocity prediction error delta_v produces noise error a delta_v and clean error −σ delta_v. The score error obtained from the noise prediction is −a delta_v/σ. Squaring introduces coefficient factors, not just a change of variable name. These identities compare predictions tied by the stated conversion. They do not say two independently parameterized finite networks have identical gradients, initialization, capacity, or training trajectories, even if their population-optimal predictions are related.
Test conversions on hand samples and endpoint-adjacent cases
Create a small tensor with fixed clean values, Gaussian draws, and nondegenerate coefficients. Check round-trip conversions and the expected loss factors in a wide reference dtype before testing mixed precision. Add near-endpoint cases separately and define allowed tolerances, because division-based conversions can lose accuracy. Verify coefficient broadcasting and target selection across the batch. A low scalar loss under the wrong target can be misleading if its magnitude or timestep weighting differs from the intended objective.
The matrix lab offers a separate sensitivity example. Reset, set a=1 and b=0, predict condition number one, then Play or Step. Separately Reset, set a=0.25 and b=0, predict singular values one and 0.25 and condition number four, then Play or Step. Readouts describe the selected final triangular matrix while playback interpolates geometry. This is not the velocity rotation or a diffusion target converter. Use its explicit small-scale direction to motivate checking error amplification in the actual division-based formulas.
Work it through
Round-trip one velocity target
Use x_0=2,epsilon=−1,a=0.8,sigma=0.6, so x_t=1. Compute velocity, reconstruct the clean and noise values, and find the conditional score target.
Velocity is 0.8×(−1)−0.6×2=−2.
The inverse gives x_0=0.8×1−0.6×(−2)=2 and epsilon=0.6×1+0.8×(−2)=−1.
The conditional score target is −(−1)/0.6=5/3≈1.6667. This known per-example score target is not itself the exact perturbed-data marginal score.
The target conversions agree under one pinned VP convention, and the score division has its explicit positive-sigma domain.
The living notebook
Explore the model
Interactive lab · matrix
A small scale can make inversion sensitive
Reset, set a=1 and b=0, predict κ₂=1, then Play or Step. Separately Reset, set a=0.25 and b=0, predict singular values 1 and 0.25 and κ₂=4, then Play or Step. Readouts concern the selected final matrix. This fixed triangular family is not a diffusion rotation, score model, or target converter.
- Area scale · det A
- 1.4
- Singular values · σmax, σmin
- 1.597, 0.876
- Condition number · κ₂(A)
- 1.823
The selected matrix is A = [[a,b],[0,1]]. Playback interpolates geometry between the identity and A; readouts always describe A. Its determinant is a and its singular values come from AᵀA. Positive a makes every supported matrix invertible. This two-dimensional family is not a general eigensolver or a learned network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forCheck the actual target-conversion Jacobian rather than assuming all equivalent targets have equal error scales.
Pause & reason
Check your understanding
Your turn
Try it yourself
At fixed x_t use a=0.6,sigma=0.8 and scalar velocity error delta_v=0.5. Find the induced noise and clean errors and their squared values.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use the fixed-input Jacobian relations before squaring.
Compare with the solution
Noise error is 0.6×0.5=0.3 and clean error is −0.8×0.5=−0.4. Their squared errors are 0.09 and 0.16, while velocity squared error is 0.25. Equal unweighted losses in these coordinates would not represent the same weighting.
Keep the idea
Take it with you
- Pin the VP target convention and scheduler interpretation together.
- Conditional score targets regress to a marginal score at the population optimum.
- Target conversion changes error and gradient scales through its Jacobian.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.