Back to all posts
Distributional Distillation · Part II

What SDS, VSD, and DMD Actually Estimate

SDS, VSD, and DMD can look almost identical in code. They are not identical mathematically. This article follows the one term that changes between them and shows what each method keeps, learns, or accidentally removes.

Fu-Yun Wang · 2026 · Mathematical notes

1. The same-looking update can mean different things

Part I derived the reverse-KL generator gradient

\[ \nabla_\theta\mathcal L =\mathbb E\!\left[ \frac{\gamma(t)}{\sigma_t} \bigl( \boldsymbol\epsilon_\varphi(\mathbf x_t,t) -\boldsymbol\epsilon_\psi(\mathbf x_t,t) \bigr)^\top \frac{\partial\mathbf x_t}{\partial\theta} \right], \qquad \mathbf x_t=\alpha_tG_\theta(\mathbf z)+\sigma_t\boldsymbol\epsilon. \] (1)

Before comparing names, it helps to turn this equation into three plain questions:

\[ \boxed{ \nabla_\theta\mathcal F =\mathbb E\!\left[ \underbrace{w}_{\text{divergence}} \bigl( \underbrace{\text{target}}_{\text{teacher or data}} -\underbrace{\text{student}}_{\text{how is }q\text{ represented?}} \bigr)^\top \underbrace{\frac{\partial\mathbf x}{\partial\theta}}_{\text{where is it formed?}} \right].} \] (2)

Reading Equation (2) from left to right gives three independent decisions:

  1. Where should training focus? Reverse KL weights every sampled location equally; other divergences emphasize places the student is missing.
  2. How do we know what the student distribution looks like? We can substitute one noise sample, train a second denoiser, or estimate a density ratio with a discriminator.
  3. At which state is the comparison valid? A formula derived for a noised clean image may become wrong at an intermediate phase state.

These questions are easy to mix together. The first controls mode coverage, the second controls estimator error, and the third controls whether the training target is correct at all.

The book's LaTeX figure showing the difference between real and student scores, followed by the alternating generator and online critic update used in distribution matching.
The original LaTeX distribution-matching figure from the book. The left panel shows the two-score direction; the right panel shows why the student critic must be updated as the generator moves.

2. SDS: a conditional score substituted for a marginal score

The hard term in Equation (1) is the score of the student's whole output distribution. SDS avoids learning it. Instead, it inserts the particular noise vector \(\boldsymbol\epsilon\) used to create the current \(\mathbf x_t\):

\[ \nabla_\theta\mathcal L_{\mathrm{SDS}} =\mathbb E\!\left[ \frac{\gamma(t)}{\sigma_t} \bigl(\boldsymbol\epsilon_\varphi(\mathbf x_t,t,c) -\boldsymbol\epsilon\bigr)^\top \frac{\partial\mathbf x_t}{\partial\theta} \right]. \] (3)

One corrupted sample is not the whole student distribution

Conditioned on one latent \(\mathbf z\), the corruption law is

\[ q(\mathbf x_t\mid\mathbf z) =\mathcal N\!\left( \alpha_tG_\theta(\mathbf z),\sigma_t^2\mathbf I \right), \qquad \nabla_{\mathbf x_t}\log q(\mathbf x_t\mid\mathbf z) =-\frac{\boldsymbol\epsilon}{\sigma_t}. \]

The same noisy point \(\mathbf x_t\) could have come from many different clean student outputs. Reverse KL needs the score after considering all of those possibilities—the mixture over all latents, \(q_{\theta,t}(\mathbf x_t)=\int q(\mathbf x_t\mid\mathbf z)p(\mathbf z)d\mathbf z\). Differentiating that mixture gives

\[ \begin{aligned} \nabla_{\mathbf x_t}\log q_{\theta,t}(\mathbf x_t) &=\frac{\int p(\mathbf z)\nabla_{\mathbf x_t} q(\mathbf x_t\mid\mathbf z)d\mathbf z} {q_{\theta,t}(\mathbf x_t)}\\ &=\int \frac{p(\mathbf z)q(\mathbf x_t\mid\mathbf z)} {q_{\theta,t}(\mathbf x_t)} \nabla_{\mathbf x_t}\log q(\mathbf x_t\mid\mathbf z)d\mathbf z\\ &=\mathbb E\!\left[ -\frac{\boldsymbol\epsilon}{\sigma_t} \,\middle|\,\mathbf x_t \right]. \end{aligned} \] (4)

So the correct fake score averages over all latent/noise explanations that could have produced the observed \(\mathbf x_t\). SDS keeps only the explanation sampled in the current iteration.

One SDS step is a reconstruction step

Let \(\mathbf x=G_\theta(\mathbf z)\), and form the teacher's clean prediction

\[ \widehat{\mathbf x}_{0,\varphi} =\frac{\mathbf x_t-\sigma_t \boldsymbol\epsilon_\varphi(\mathbf x_t,t,c)}{\alpha_t}. \]

Because \(\mathbf x_t=\alpha_t\mathbf x+\sigma_t\boldsymbol\epsilon\),

\[ \begin{aligned} \mathbf x-\widehat{\mathbf x}_{0,\varphi} &=\mathbf x- \frac{\alpha_t\mathbf x+\sigma_t\boldsymbol\epsilon -\sigma_t\boldsymbol\epsilon_\varphi}{\alpha_t}\\ &=\frac{\sigma_t}{\alpha_t} \bigl(\boldsymbol\epsilon_\varphi-\boldsymbol\epsilon\bigr). \end{aligned} \]

Therefore, up to a positive time-dependent scalar and with gradients stopped through the teacher, one sampled SDS update is the gradient of

\[ \frac12\left\| \mathbf x-\operatorname{sg}[ \widehat{\mathbf x}_{0,\varphi}] \right\|^2. \]

This makes “pointwise” literal: each iteration moves one current render toward one teacher-denoised pseudo-target. No term here checks whether the collection of all renders remains diverse.

The fake-score term vanishes in expectation

The difference is not merely extra Monte Carlo noise. Since

\[ \frac{\partial\mathbf x_t}{\partial\theta} =\alpha_t\frac{\partial G_\theta(\mathbf z)}{\partial\theta} \]

depends on \(\mathbf z\) but not on the independently sampled zero-mean \(\boldsymbol\epsilon\),

\[ \begin{aligned} \mathbb E\!\left[ \boldsymbol\epsilon^\top \frac{\partial\mathbf x_t}{\partial\theta}\right] &=\alpha_t\, \mathbb E_{\mathbf z}\!\left[ \mathbb E_{\boldsymbol\epsilon}[\boldsymbol\epsilon]^\top \frac{\partial G_\theta(\mathbf z)}{\partial\theta} \right]\\ &=\mathbf0. \end{aligned} \] (5)
SDS does not merely make the reverse-KL gradient noisier Under the assumptions above, its substituted fake-score term averages to exactly zero. What remains is the attraction \(\mathbb E_q[-\log p_t]\); the term that encourages the student population to spread out, \(-H(q_t)\), is gone. This gives a direct reason to expect collapse pressure.

Why strong classifier-free guidance moves SDS

With target prompt \(c\), source branch \(u\), and guidance scale \(\omega\), decompose the residual:

\[ \widetilde{\boldsymbol\epsilon}_\varphi-\boldsymbol\epsilon = \underbrace{ \boldsymbol\epsilon_\varphi(\mathbf x_t,t,u) -\boldsymbol\epsilon}_{\text{pointwise SDS}} +\omega\underbrace{\left[ \boldsymbol\epsilon_\varphi(\mathbf x_t,t,c) -\boldsymbol\epsilon_\varphi(\mathbf x_t,t,u) \right]}_{\text{target--source contrast}}. \] (6)

At the very large guidance scales used in SDS, the second term often dominates. It pulls toward the conditional target and pushes away from the unconditional source. This can be useful, but the unconditional branch is still not the score of the stochastic student's full output distribution.

3. VSD and Diff-Instruct: reconstruct the student score

VSD and Diff-Instruct pay the cost SDS avoids: they train a second denoiser to describe the student's current output distribution. For any differentiable image-producing system \(\mathbf x=R_\theta(\boldsymbol\xi)\), they generate current outputs, add noise, and solve an ordinary denoising problem:

\[ \min_\psi\; \mathbb E_{t,\boldsymbol\xi,\boldsymbol\epsilon} \left\| \boldsymbol\epsilon_\psi\!\left( \alpha_t\operatorname{sg}[R_\theta(\boldsymbol\xi)] +\sigma_t\boldsymbol\epsilon,t \right)-\boldsymbol\epsilon \right\|^2. \] (7)

Condition on \(\mathbf x_t\). The standard square-loss decomposition is

\[ \mathbb E\!\left[ \|f(\mathbf x_t)-\boldsymbol\epsilon\|^2 \mid\mathbf x_t\right] = \|f(\mathbf x_t)-\mathbb E[\boldsymbol\epsilon\mid\mathbf x_t]\|^2 +\operatorname{Var}(\boldsymbol\epsilon\mid\mathbf x_t). \]

The variance term is independent of \(f\), so the population minimizer is

\[ \boldsymbol\epsilon_\psi^\star(\mathbf x_t,t) =\mathbb E[\boldsymbol\epsilon\mid\mathbf x_t] =-\sigma_t\nabla\log q_{\theta,t}(\mathbf x_t). \] (8)

This auxiliary loss is not arbitrary. At its optimum, the second denoiser returns exactly the conditional average needed for the student's marginal score—and therefore restores the entropy term that SDS loses. Training alternates between teaching this denoiser what the student currently generates and using it to update the student.

Critic lag produces a systematic outer-gradient error

Let \(\boldsymbol\epsilon_\psi^\star\) be the exact conditional mean and \(\boldsymbol\epsilon_\psi\) the learned estimate. Subtract the ideal generator gradient from the applied one:

\[ \widehat{\nabla_\theta\mathcal L} -\nabla_\theta\mathcal L = \mathbb E\!\left[ \frac{\gamma(t)}{\sigma_t} \bigl(\boldsymbol\epsilon_\psi^\star -\boldsymbol\epsilon_\psi\bigr)^\top \frac{\partial\mathbf x_t}{\partial\theta} \right]. \]

Using \(\|\mathbf a^\top B\|\leq\|\mathbf a\|\|B\|\) and the triangle inequality,

\[ \left\| \widehat{\nabla_\theta\mathcal L} -\nabla_\theta\mathcal L \right\| \leq \mathbb E\!\left[ \frac{\gamma(t)}{\sigma_t} \|\boldsymbol\epsilon_\psi^\star-\boldsymbol\epsilon_\psi\| \left\|\frac{\partial\mathbf x_t}{\partial\theta}\right\| \right]. \] (9)

The difficulty is that the student changes after every generator update. A fake-score model trained on yesterday's generator still describes yesterday's distribution. Its error can therefore point the generator in the wrong direction, not merely add random noise. Equation (9) also shows why a small denoising loss is not enough: the remaining error is magnified by the time weight, \(1/\sigma_t\), and the generator Jacobian.

4. Why GANs and two-score methods are related

The two-score bracket is the spatial gradient of a log density ratio:

\[ \nabla\log q_t-\nabla\log p_t =\nabla\log\frac{q_t}{p_t}. \]

For the original GAN classification problem, the optimal discriminator is

\[ D^\star(\mathbf x)=\frac{p(\mathbf x)}{p(\mathbf x)+q(\mathbf x)}, \qquad \log\frac{D^\star}{1-D^\star} =\log\frac pq. \] (10)

A discriminator estimates the value of the log density ratio \(\log(p/q)\). Two score networks estimate the direction in which that ratio changes. They expose the same population quantity in two forms, but only when the estimators are ideal. In practice, a discriminator is informed mainly by the batches it sees and can be unstable; score matching compares multiple noise scales but must keep its fake-score model synchronized with a moving student.

This also clarifies hybrid methods. ADD combines a teacher-derived score-distillation term with a real-data adversarial term. Core LADD uses teacher-generated positives in latent feature space, so its adversarial term remains teacher-derived. “Adversarial” tells us how a ratio is estimated, not where the reference distribution came from.

5. DMD keeps a safety rope; DMD2 replaces it with a different signal

The original DMD objective is a hybrid:

\[ \boxed{ \mathcal L_{\mathrm{DMD}} = \underbrace{\mathbb E_t[ \gamma(t)\mathrm{KL}(q_{\theta,t}\|p_t)]} _{\text{teacher-derived marginal}} +\lambda \underbrace{\mathbb E_{(\mathbf z,\mathbf x)\sim\mathcal D} \|G_\theta(\mathbf z)-\mathbf x\|^2} _{\text{teacher-derived coupling}}.} \] (11)

The dataset \(\mathcal D\) contains noise–image pairs created by running the full teacher ODE. The reverse-KL term asks whether all outputs look right as a population. The regression term still tells each individual noise input where the teacher sent it. They solve different problems:

DMD2 removes the expensive pair dataset and adds a discriminator trained with real images. That is useful, but it is not the same safety rope. The discriminator can tell whether the output population differs from real data—and can even expose teacher errors—but it still does not assign a destination to each latent.

ComponentConstrainsReferenceMain role
DMD score termMarginalTeacherSharp teacher-distribution matching
DMD regressionCouplingTeacherCoverage anchor for every latent
DMD2 score termMarginalTeacherTeacher prior
DMD2 discriminatorMarginalReal dataCorrect teacher/data mismatch
rCM consistency termCouplingTeacher/data constructionCoverage-seeking regression
rCM score termMarginalTeacherCounter limited-capacity averaging
Classify loss components, not method names “DMD is distribution matching” hides the point of its regression term. “DMD2 replaces the dataset with a GAN” hides the fact that a coupling constraint was removed and a data-derived marginal constraint was added. Those changes alter both coverage behavior and the teacher ceiling.

6. Phased DMD: the input distribution determines the target

Phased DMD introduces a different issue. In an early phase, the input \(\mathbf x_s\) is already noisy; it is not a clean image. We must therefore derive the denoising target from the transition that actually produced the later state \(\mathbf x_t\), rather than reuse the familiar clean-image target.

\[ \mathbf x_t =\alpha_{t|s}\mathbf x_s+\sigma_{t|s}\boldsymbol\epsilon, \qquad \alpha_{t|s}=\frac{\alpha_t}{\alpha_s}, \] \[ \sigma_{t|s}^2 =\sigma_t^2-\alpha_{t|s}^2\sigma_s^2, \qquad \tau\equiv\sigma_{t|s}. \] (12)

The observable conditional score of this actual transition is

\[ \nabla_{\mathbf x_t}\log q(\mathbf x_t\mid\mathbf x_s) =-\frac{\boldsymbol\epsilon}{\tau}. \]

Project it over the posterior of \(\mathbf x_s\) exactly as in Equation (4):

\[ \begin{aligned} \nabla_{\mathbf x_t}\log q_t(\mathbf x_t) &= \frac{\int q_s(\mathbf x_s) \nabla_{\mathbf x_t}q(\mathbf x_t\mid\mathbf x_s)d\mathbf x_s} {q_t(\mathbf x_t)}\\ &=\mathbb E\!\left[ \nabla_{\mathbf x_t}\log q(\mathbf x_t\mid\mathbf x_s) \,\middle|\,\mathbf x_t\right]\\ &=\mathbb E\!\left[ -\frac{\boldsymbol\epsilon}{\tau} \,\middle|\,\mathbf x_t\right]. \end{aligned} \] (13)

Squared regression onto \(-\boldsymbol\epsilon/\tau\) therefore recovers the required marginal score. Every prediction parameterization follows from one affine conversion. If

\[ \widehat{\mathbf y}(\mathbf x_t,t) =A_t\mathbf x_t+B_t\widehat{\mathbf s}(\mathbf x_t,t), \]

then substitute the transition score to obtain

\[ \boxed{ \mathbf y_{\mathrm{target}}^{(s)} =A_t\mathbf x_t-\frac{B_t}{\tau}\boldsymbol\epsilon.} \] (14)
PredictionConversion from score \(\mathbf s_t\)Phased target
Score\(\widehat{\mathbf s}\)\(-\boldsymbol\epsilon/\tau\)
Noise\(\widehat{\boldsymbol\epsilon}=-\sigma_t\widehat{\mathbf s}\)\((\sigma_t/\tau)\boldsymbol\epsilon\)
Clean sample\(\widehat{\mathbf x}_0=(\mathbf x_t+\sigma_t^2\widehat{\mathbf s})/\alpha_t\)\((\mathbf x_t-\sigma_t^2\boldsymbol\epsilon/\tau)/\alpha_t\)

When \(s=0\), \(\tau=\sigma_t\), and these reduce to the usual clean-sample targets. When \(s>0\), regressing directly onto \(\boldsymbol\epsilon\), \(\mathbf x_s\), or \(\boldsymbol\epsilon-\mathbf x_s\) is biased. The formulas may still look dimensionally plausible, which is exactly why this mistake is easy to make.

The phase boundary is singular As \(t\to s\), \(\tau=\sigma_{t|s}\to0\), so targets containing \(1/\tau\) diverge. Implementations must rescale the residual algebraically or avoid sampling arbitrarily close to the boundary.

The clean method map

MethodStudent-side quantityWhat the derivation says
SDSOne sampled conditional noisePointwise pseudo-target; entropy term vanishes in expectation
VSD / Diff-InstructLearned marginal fake scorePrincipled two-score gradient; moving-critic error matters
DMDLearned marginal fake scoreReverse-KL marginal term plus paired coupling anchor
DMD2Fake score plus real-data discriminatorTwo marginal signals; no equivalent latent-wise anchor
Phased DMDTransition-correct marginal scoreTarget must be derived from \(q(\mathbf x_t\mid\mathbf x_s)\)

References

[1] Poole et al. “DreamFusion: Text-to-3D using 2D Diffusion.” ICLR 2023.

[2] Wang et al. “ProlificDreamer.” NeurIPS 2023.

[3] Luo et al. “Diff-Instruct.” NeurIPS 2023.

[4] Yin et al. “One-step Diffusion with Distribution Matching Distillation.” CVPR 2024.

[5] Yin et al. “Improved Distribution Matching Distillation for Fast Image Synthesis.” NeurIPS 2024.

[6] Fan et al. “Phased DMD: Few-step Distribution Matching Distillation via Score Matching within Subintervals.” CVPR 2026.