1. Stop grading samples one by one
Let a one-step generator be
Suppose the teacher turns noise \(z_1\) into a cat and \(z_2\) into a dog. Trajectory distillation asks the student to reproduce those two assignments. Distributional distillation allows the student to swap them. What matters is that the collection of outputs still contains the right cats and dogs in the right proportions.
The formal name for the noise-to-image assignment is a coupling. Once we forget that assignment and keep only the output distribution, we keep the marginal. This extra freedom is useful when a one-step student is too small or too constrained to imitate the teacher's exact map.
Why not compare the clean output distributions directly? In image space, valid images occupy an extremely narrow part of all possible pixel arrays. The teacher and student can therefore miss each other almost completely, even if both produce recognizable images. In that case the KL can be infinite or provide almost no useful direction. The standard repair is simple: add the same type of Gaussian noise to both sides before comparing them.
At every \(t>0\), the added noise spreads both distributions out, so they overlap and can “see” each other. Large \(t\) mainly compares coarse layout; small \(t\) compares fine detail. Here noise is not merely damage—it turns an almost impossible clean-space comparison into a sequence of easier comparisons from coarse to fine.
2. Forward and reverse KL fail differently
Start with one Gaussian component \(p_m=\mathcal N(m,\varsigma^2)\) and a single-Gaussian student \(q_\mu=\mathcal N(\mu,\varsigma^2)\). They share the same variance, so their cross-entropy is
Because \(\mathrm{KL}(p\|q)=H(p,q)-H(p)\), minimizing forward KL over \(q\) is the same as minimizing this cross-entropy.
Optional: derive Equation (G) from the Gaussian density
Take the expectation under \(p_m\), then add and subtract its mean \(m\):
The two-mode example
Let the target contain two narrow modes, while the student can represent only one:
Forward KL straddles the modes
The target \(p\) is not itself Gaussian. Instead, use the linearity of expectation to split its cross-entropy into the two Gaussian components:
Apply Equation (G) once with \(m=-a\) and once with \(m=+a\):
Every term except \(\mu^2/(2\varsigma^2)\) is constant in \(\mu\), so the minimum is \(\mu=0\): a location between the modes where the target places almost no mass. A capacity-limited student covers both modes slightly and represents neither well.
Reverse KL locks onto one mode
Unlike forward KL, this reverse KL is difficult to evaluate directly: the logarithm contains a sum of two Gaussian densities, so it cannot be split across the two mixture components. Fortunately, gradient descent does not require a closed-form value; it only needs the derivative with respect to the student location \(\mu\). Write
A sample from \(q_\mu=\mathcal N(\mu,\varsigma^2)\) can be written as \(X=\mu+\varsigma Z\), where \(Z\sim\mathcal N(0,1)\). Substituting this into the expectation gives
Now expand the student term:
This expression no longer contains \(\mu\), so its total derivative is zero for every fixed \(Z\)—the expectation is not needed for this cancellation. Written with the chain rule, the two contributions are
If \(x\) were held fixed, \(\partial_\mu\log q_\mu(x)\) would not be zero pointwise; only its expectation would vanish. Here \(x=\mu+\varsigma Z\) moves with \(\mu\), so the explicit parameter derivative and the sample-motion derivative cancel pointwise. This special simplification holds because the example changes only the mean while keeping the variance fixed.
The distribution of \(Z\) does not depend on \(\mu\), so we can now differentiate inside the expectation. Applying the chain rule to the remaining target term gives
The last line merely renames \(\mu+\varsigma Z\) as \(X\). Since this random variable follows \(q_\mu\), the two expectations are identical. Equation (R) says that gradient descent moves the student along the average target score:
Now read the direction directly from the two-mode curve. Since \(p(x)>0\), the score \(\nabla_x\log p(x)=p'(x)/p(x)\) has the same sign as the slope \(p'(x)\):
- On the positive side, samples move toward the right mode: rightward before the peak and leftward after it.
- On the negative side, the picture is symmetric and samples move toward the left mode.
- At exactly \(x=0\), the two sides balance and the score is zero; any small initialization or sampling imbalance chooses one side.
Because the student is narrow compared with the distance between the modes, most of its samples lie in the same basin. Their average score therefore pulls the whole student toward one mode rather than leaving it between the two.
3. Deriving the two-score identity
Fix one noise level \(t\). Write the reparameterized noisy sample as
The target \(p_t\) stays fixed while the student distribution \(q_{\theta,t}\) moves. The difficulty is that KL grades an entire density, whereas backpropagation moves individual generated samples. We first need an identity that connects these two views.
Convert density motion into particle motion
First distinguish two similar-looking symbols. In an integral, \(\mathbf x\) is only a dummy coordinate: it runs over all possible locations and does not itself have a distribution. The density \(q_{\theta,t}(\mathbf x)\) supplies the weight at each location. By contrast, \(\mathbf x_t\) is a random sample whose distribution is \(q_{\theta,t}\).
We obtain that random sample from base noise whose distribution does not depend on \(\theta\):
Now let \(g\) be any differentiable test function held fixed during the perturbation. Each equality below performs one separate conversion:
The first line moves the derivative through the integral. The second uses the definition of expectation: integrating \(g(\mathbf x)\) against the density \(q_{\theta,t}(\mathbf x)\) is the same as averaging \(g(\mathbf x_t)\) over samples \(\mathbf x_t\sim q_{\theta,t}\). The third is the actual reparameterization step: it replaces sampling from the moving distribution \(q_{\theta,t}\) with sampling fixed noises \((\mathbf z,\boldsymbol\epsilon)\) and passing them through \(T_\theta\). The final line is the ordinary chain rule.
Here we used the fact that the sampled \(\mathbf z\), \(\boldsymbol\epsilon\), and the fixed-time coefficients \(\alpha_t,\sigma_t\) do not change when differentiating with respect to \(\theta\). Thus the left side of Equation (2) describes how the whole density moves, while the right side describes how its generated particles move.
Compute the first variation of reverse KL
Temporarily write \(q=q_{\theta,t}\) and \(p=p_t\). Perturb the density to \(q+\eta\,\delta q\):
This is ordinary product rule, applied to a function whose input is now a density. Differentiating the leading \(q\) gives \(\delta q\log(q/p)\); differentiating the \(q\) inside the logarithm gives one more \(\delta q\). Hence
Let the generator produce the perturbation
This step uses the functional version of the chain rule. For an ordinary function \(f(u)\), where the intermediate variable \(u\) depends on \(\theta\), the usual chain rule is
A density is different only because the intermediate object is no longer one number. It contains one value \(q(\mathbf x)\) at every location \(\mathbf x\). If space were a finite grid, the multivariable chain rule would sum the contribution from every grid point:
For a continuous density, the sum becomes an integral and the partial derivative becomes a functional derivative:
The quantity \(\delta F/\delta q(\mathbf x)\) asks how sensitive \(F\) is to a small density change at location \(\mathbf x\). The integral adds the effects from all locations. Thus this is the same chain rule as before, with an integral replacing the finite sum.
For reverse KL, Equation (3) supplies the functional derivative. Evaluate it at the current density, then apply Equation (2) with \(g=\log(q_{\theta,t}/p_t)+1\):
The spatial gradient kills the constant \(1\) and splits the log ratio into two scores:
Translate scores into denoiser predictions
For Gaussian corruption, noise prediction and score prediction are related by
Putting the time expectation back gives the familiar computational form:
This equation is not the starting assumption. It is the end of the density-to-particle calculation.
4. General \(f\)-divergence: same direction, different weight
The previous result is not special to KL. Many common distribution distances belong to the \(f\)-divergence family. The useful surprise is that they all point in the same teacher-minus-student score direction; they mainly disagree about how strongly to weight each location.
At one spatial point, hold \(p\) fixed and differentiate \(qf(p/q)\) with respect to \(q\):
Therefore the first variation is \(f(r)-rf'(r)\). Its spatial gradient is
where \(\nabla r=r(\nabla\log p-\nabla\log q)\). Applying the same density-to-particle identity gives
So every smooth \(f\)-divergence uses the same teacher-minus-student score direction. The scalar \(h(r)\) decides where training effort goes. If \(r=p/q\) is large, the target has much more probability than the student at that location.
| Divergence | \(f(r)\) | \(h(r)\) | Effect |
|---|---|---|---|
| Reverse KL | \(-\log r\) | \(1\) | No density-ratio estimate; mode-seeking |
| Jensen–Shannon | \(r\log r-(r+1)\log\frac{r+1}{2}\) | \(\frac{r}{r+1}\) | Bounded, saturating coverage weight |
| Squared Hellinger | \(1-\sqrt r\) | \(\frac14\sqrt r\) | Intermediate emphasis |
| Forward KL | \(r\log r\) | \(r\) | Amplifies teacher-heavy, student-light regions |
Forward KL is coverage-seeking because \(r=p/q\) becomes large precisely where the teacher has mass and the student does not. But that same factor can have high variance. Any nonconstant \(h(r)\) also requires a density-ratio estimator—often a discriminator—in addition to the fake-score estimator. Reverse KL is computationally attractive partly because \(h\equiv1\) makes the ratio disappear.
5. The fake score is the student's entropy gradient
Split reverse KL into negative entropy and cross-entropy:
Applying the same first-variation argument to the two pieces separately gives
In plain language, the real score says, “move toward places the target considers likely.” The fake score says, “do not let all student samples pile into the same place.” It is not merely a variance-reduction baseline: it is the gradient of the student's negative entropy. If it is missing or badly estimated, attraction remains but the pressure that spreads samples out becomes too weak.
What Part I establishes
The complete chain is now visible:
What remains is estimation. The teacher score is available from a pretrained diffusion model; the student marginal score is not. SDS, VSD, Diff-Instruct, DMD, and adversarial variants differ primarily in what they substitute or learn for that missing quantity, what weight they apply, and at which state the comparison is formed.
References
[1] Yin et al. “One-step Diffusion with Distribution Matching Distillation.” CVPR 2024.
[2] Xu, Nie, and Vahdat. “One-step Diffusion Models with \(f\)-Divergence Distribution Matching.” 2025.
[3] Wang et al. “ProlificDreamer: High-Fidelity and Diverse Text-to-3D Generation with Variational Score Distillation.” NeurIPS 2023.