Denoising weights: transform the objective, not just its target name
Relate clean, noise, and velocity squared errors and derive a stated Min-SNR weighting without claiming universal convergence gains.
On this page
The question for today
What you’ll understand
- Convert clean-prediction weights into noise and velocity coordinates.
- Distinguish simplified denoising objectives from exact likelihood-related terms.
- Specify feature, batch, and timestep reductions in a weighting experiment.
A diffusion loss is defined by its target, timestep distribution, coefficient weights, and reduction rules. Replacing noise prediction with velocity prediction while keeping every scalar unchanged generally changes the objective. Start from one declared loss and transform it algebraically. Then evaluate whether the resulting optimization behavior helps the intended sampling task under controlled comparisons.
Squared-error coordinates carry different scales
Fix the noisy input and VP coefficients. Reconstruct a clean prediction from a noise prediction, or derive both from a velocity prediction. The corresponding residuals are related by scalar Jacobians, so their squared norms acquire squared coefficient factors. Use the same per-coordinate mean or vector-sum convention in every expression. A target change can otherwise introduce an unnoticed factor of data dimension as well as a timestep-dependent scale. These identities compare tied predictions, not arbitrary independently trained networks.
The original DDPM work distinguishes a simplified denoising objective from terms associated with its variational formulation. The precise weighting depends on assumptions including reverse variance and endpoint treatment. Do not label every unweighted noise MSE an exact likelihood objective or interpret its numerical value as directly comparable to another parameterization's raw MSE. Log common reference errors or explicitly transformed quantities when comparing models. A lower training number can reflect changed weights rather than a better denoiser.
State which Min-SNR convention is being used
Here begin with a clean-prediction loss weighted by min(r,gamma), for positive coefficient SNR r and positive threshold gamma. Transforming that same loss gives noise weight min(r,gamma)/r and velocity weight min(r,gamma)/(1+r). The denominator in the velocity form follows from sigma squared being one over one plus r. Applying the clean weight directly to noise MSE would instead define another objective. Endpoint values require limiting or guarded rules consistent with the chosen schedule.
The Min-SNR paper motivates a timestep-task balancing strategy and reports empirical improvements in its experiments. Those results do not guarantee faster convergence, better fidelity, or a universal optimal gamma for every dataset, sampler, backbone, or conditional task. Diffusers 0.35.1's text-to-image example contains parameterization-specific weights that can be checked against this algebra. Other preconditioned, continuous-time, or flow objectives need their own derivation. A familiar option name is insufficient evidence that two training scripts optimize the same quantity.
Control reduction and validation when changing weights
Compute a per-example feature loss, multiply by its timestep weight, and apply the declared batch reduction. Dividing by batch size and dividing by the sum of weights are different estimators, especially when the sampled timestep mix changes. If timesteps are sampled nonuniformly, separate objective weights from proposal correction. Record weighted and unweighted losses by noise-level bin, gradient norms, and a fixed held-out evaluation. Keep training data, model size, compute budget, and sampling protocol comparable when attributing an improvement to weighting.
The function lab isolates a weighted scalar residual square. Reset, set a=0.50 and x=1, predict y=0.50, then Play or Step. Separately Reset, set a=2 and x=1, predict y=2, then Play or Step. Interpret a only as a chosen nonnegative loss weight and x as an error; the graph does not compute an SNR or train a denoiser. This controlled change shows why raw loss magnitude changes when weights change even if the underlying residual stays exactly one.
Work it through
Verify equivalent weighted losses
Use VP coefficients with a²=0.8,sigma²=0.2, coefficient SNR r=4, and gamma=2. At fixed x_t, a scalar velocity error is 0.5; derive clean and noise losses through the stated conversions.
Velocity squared error is 0.25. Noise squared error is a²×0.25=0.20, while clean squared error is sigma²×0.25=0.05.
The weights are w_x0=2, w_epsilon=2/4=0.5, and w_v=2/5=0.4.
The weighted losses agree: 2×0.05=0.5×0.20=0.4×0.25=0.10. Equal raw MSE values would not have provided this equivalence.
The three weights describe the same declared clean-space loss for converted predictions. The calculation does not imply all separately trained parameterizations learn identically.
The living notebook
Explore the model
Interactive lab · function
A loss weight changes the number without changing the residual
Reset, set a=0.50 and x=1, predict y=0.50, then Play or Step. Separately Reset, set a=2 and x=1, predict y=2, then Play or Step. This fixed y=ax² graph contains no timestep, SNR, target conversion, or optimization.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. 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 forCompare objectives and common reference errors rather than raw loss magnitudes alone.
Pause & reason
Check your understanding
Your turn
Try it yourself
For r=0.25 and gamma=2, compute the stated clean, noise, and velocity weights. If scalar velocity MSE is one, what is its weighted contribution?
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 min(0.25,2)=0.25 and 1+r=1.25.
Compare with the solution
The clean weight is 0.25, noise weight is 0.25/0.25=1, and velocity weight is 0.25/1.25=0.2. A velocity MSE of one contributes 0.2 under this objective. These values require the same VP and target-conversion conventions used in the derivation.
Keep the idea
Take it with you
- Target transformations change squared-error weights through Jacobians.
- Min-SNR benefits are empirical and convention-specific.
- Feature, batch, and timestep reductions are part of the objective.
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.