VerifiedarXiv:2105.0523326 min
Diffusion · Generative models

Diffusion Models Beat GANs on Image Synthesis

A classifier's gradient steers a diffusion model past the best GAN.

The gap to GANs closes in two moves: a better denoising network, then classifier guidance, a single dial that trades diversity for fidelity by nudging each sampling step along a classifier's gradient.

Explaining the paperDiffusion Models Beat GANs on Image SynthesisDhariwal, Nichol · OpenAI · NeurIPS 2021 · arXiv:2105.05233

In 2021 GANs held the image-generation record and everyone knew their weakness: they drop whole regions of the data. This paper closes the quality gap without inheriting that weakness.

By 2021 the sharpest synthetic images came from GANs, generative adversarial networks: a generator and a discriminator locked in a forgery game until the fakes pass. On ImageNet, BigGAN-deep held the best FID\text{FID} (the standard image-quality score, defined below). But GANs pay for that fidelity in two ways. They are delicate to train, collapsing without carefully chosen regularizers, and they cover less of the data than the best likelihood-based models: they tend to lock onto a handful of convincing modes and skip the rest.

Diffusion models sit on the other side of that trade. They are stable to train, they scale predictably, and they cover the distribution well, but in 2021 their samples still looked a notch softer than a good GAN's on hard datasets like ImageNet. Dhariwal and Nichol set out to close that gap from both ends. Their diagnosis had two parts: the diffusion architecture had simply been explored less than the GAN one, and diffusion models had no knob for trading coverage for per-sample sharpness the way a GAN's truncation trick does.

So the paper is two contributions bolted together. First, a careful architecture sweep produces a stronger denoising network, which the authors call ADM (their ablated diffusion model). Second, classifier guidance: a way to steer sampling toward a class using the gradients of an image classifier, with one scalar dial that trades diversity for fidelity. Together they reach an FID of 2.972.97 on ImageNet 128×128, 4.594.59 on 256×256, and 7.727.72 on 512×512, past BigGAN-deep on every one, while keeping more of the distribution. And with a fast sampler the guided model matches BigGAN using as few as 2525 forward passes.

The plan below: build the diffusion model just enough to see where a class label and a classifier can enter, fix the architecture, pin down what "fidelity" and "diversity" actually measure, then derive classifier guidance and watch the trade-off it buys.

A diffusion model in one page

This is not the paper's contribution, so it goes fast; for the full construction see the DDPM explainer this one leans on. A diffusion model turns noise into an image by reversing a fixed noising process. The forward process takes a clean image x0x_0 and, over many steps, mixes in Gaussian noise until nothing is left but static. In the variance-preserving convention this paper uses, you can jump straight to any noise level tt with one formula:

q(xtx0)=N ⁣(xt; αˉtx0, (1αˉt)I),xt=αˉtx0+1αˉtϵq(x_t \mid x_0) = \mathcal{N}\!\big(x_t;\ \sqrt{\bar\alpha_t}\,x_0,\ (1-\bar\alpha_t)\mathbf{I}\big),\qquad x_t = \sqrt{\bar\alpha_t}\,x_0 + \sqrt{1-\bar\alpha_t}\,\epsilon
(1)

Here αˉt\bar\alpha_t slides from near 11 (clean) down to near 00 (pure noise) as tt grows, and ϵN(0,I)\epsilon \sim \mathcal{N}(0,\mathbf{I}) is the noise. Two things move at once: the signal is scaled down by αˉt\sqrt{\bar\alpha_t} while noise of standard deviation 1αˉt\sqrt{1-\bar\alpha_t} is added. Because the two variances sum to one for unit-scaled data, the total variance stays pinned near one throughout, which is what "variance-preserving" names. (That contrasts with the variance-exploding convention some diffusion papers use, where the signal is left untouched and only the noise grows. Same family, different bookkeeping, and the algebra below is specific to this one.)

To generate, you learn to walk the process backward. The move that makes it tractable, from Ho et al., is to train a network ϵθ(xt,t)\epsilon_\theta(x_t,t) to predict the noise ϵ\epsilon that was added, not the clean image. That gives a plain regression target: noise an image yourself so you know the answer, then penalize the squared error.

Lsimple=Et,x0,ϵ[ϵϵθ(xt,t)2]L_{\text{simple}} = \mathbb{E}_{t,\,x_0,\,\epsilon}\big[\,\lVert \epsilon - \epsilon_\theta(x_t,t)\rVert^2\,\big]
(2)

Once you can predict the noise, algebra recovers a slightly cleaner image and you repeat. Written out, the reverse step is a Gaussian whose mean comes straight from the noise prediction (with 1αt=βt1-\alpha_t = \beta_t):

μθ(xt,t)=1αt(xt1αt1αˉtϵθ(xt,t))\mu_\theta(x_t,t) = \frac{1}{\sqrt{\alpha_t}}\Big(x_t - \frac{1-\alpha_t}{\sqrt{1-\bar\alpha_t}}\,\epsilon_\theta(x_t,t)\Big)
(3)

The paper inherits two upgrades from Improved DDPM (Nichol & Dhariwal's companion work). Instead of fixing the reverse-step variance, it is learned as a per-coordinate interpolation, in log space, between the two natural bounds βt\beta_t and β~t\tilde\beta_t, with a network output vv:

Σθ(xt,t)=exp ⁣(vlogβt+(1v)logβ~t)\Sigma_\theta(x_t,t) = \exp\!\big(v\log\beta_t + (1-v)\log\tilde\beta_t\big)
(4)

Because the two bounds differ by orders of magnitude near t0t \to 0, interpolating in log space keeps that blend well-conditioned. Learning the variance this way buys graceful degradation when you take fewer, larger sampling steps, so the paper's 25-step guided sampling stays accurate later. When it wants even fewer steps, the paper switches to the deterministic DDIM sampler.

The last identity in this section carries the guidance argument that follows, so I will state it on its own. Because the noised image in (1) is a Gaussian around αˉtx0\sqrt{\bar\alpha_t}\,x_0, the gradient of its log-density, the score, equals the predicted noise rescaled and flipped in sign:

xtlogpθ(xt)=11αˉtϵθ(xt)\nabla_{x_t}\log p_\theta(x_t) = -\frac{1}{\sqrt{1-\bar\alpha_t}}\,\epsilon_\theta(x_t)
(5)

Read (5) with two things in mind. You divide by the standard deviation 1αˉt\sqrt{1-\bar\alpha_t}, not the variance 1αˉt1-\bar\alpha_t: the Gaussian score carries a factor (xtαˉtx0)/(1αˉt)(x_t-\sqrt{\bar\alpha_t}x_0)/(1-\bar\alpha_t), and the numerator is itself 1αˉtϵ\sqrt{1-\bar\alpha_t}\,\epsilon, cancelling one power of the root. The minus sign follows from the geometry: the predicted noise points away from the data, so density increases against it. This equivalence, that a noise predictor is a score estimator, is the same one the score-matching line of work rests on, made precise by Song et al.. Through it, a classifier's gradient can enter the sampler.

A better denoising network

The first half of the paper is unglamorous and effective: take the U-Net that diffusion models had been using and sweep its knobs on ImageNet 128×128, keeping what lowers FID. Each change is borrowed from elsewhere in the literature. Every later experiment in the paper uses the network this sweep produces.

The changes they test, each applied on its own to the old baseline: making the network deeper rather than wider at a fixed size; using more attention heads (a head is one self-attention pass, where every spatial location reads from every other; more heads run more passes in parallel, each on its own slice of the channels); adding self-attention at the 32, 16, and 8 resolutions instead of only at 16×16; swapping in BigGAN's residual blocks (layers whose output is added back onto their input) for up- and down-sampling; and rescaling every residual branch, the added-back path, by 1/21/\sqrt{2}. Drag through them below. Four help; the last one hurts and is dropped, and depth helps FID but trains too slowly to keep. The kept three, stacked, beat the sum of their parts.

Figure 1 · architecture ablation
all three kept

kept · The three keepers together (4 heads, multi-resolution attention, BigGAN up/down). The combined -3.14 beats the -2.46 they sum to: the gains compound.

FID change from each architecture change on ImageNet 128×128, versus the old UNet baseline (FID 15.33). Bars left of the line are improvements. BigGAN up/downsampling is the single largest gain; rescaling residuals by 1/√2 is the only change that raises FID. Select a bar to read what it changes and whether the paper kept it.

The attention sweep hides a second lever. Beyond raising the head count from one to four, the authors also try fixing the channels per head instead. Fewer channels per head means more heads at a given width, and the sweep shows that helps: 32 channels per head gives the best FID, but 64 is chosen as the wall-clock compromise, which also matches how a Transformer usually sizes its heads. So raising the head count and lowering the channels per head adjust the same quantity.

Injecting the timestep and class

Every residual block has to be told which noise level it is working at, and, for a class-conditional model, which class. The old way added a projection of that information to the activations. The paper's block instead uses adaptive group normalization (AdaGN): first group-normalize the activations (split the channels into a few groups and rescale each group to zero mean and unit variance, from the activations' own statistics), then scale and shift them per channel using values read from the timestep-and-class embedding.

AdaGN(h,y)=ysGroupNorm(h)+yb,[ys,yb]=W(et+eclass)+b\text{AdaGN}(h, y) = y_s\,\text{GroupNorm}(h) + y_b,\qquad [y_s, y_b] = W\,(e_t + e_{\text{class}}) + b
(6)

Only the GroupNorm uses statistics of the activations hh. The scale ysy_s and shift yby_b are a learned linear projection of the embedding, applied after normalization. (In an unconditional model there is no class term, so yy is only the timestep's projection.) This is the feature-wise modulation of FiLM (Perez et al. 2018) and the adaptive instance norm of StyleGAN, applied to a diffusion U-Net. The reason it beats plain addition is that addition can only move a normalized channel, while a scale-and-shift can also stretch or compress it, a strictly richer control. Toggle between the two below and watch the widths: under addition every channel keeps the reference spread.

Figure 2 · AdaGN vs additive conditioning
Each channel is a bell curve; the grey reference is the group-normalized activation. AdaGN scales and shifts each channel from the timestep/class embedding, so the coloured bells can widen or narrow. Addition + GroupNorm can only shift them; their width is pinned. On the ablation, AdaGN reaches FID 13.06 versus 15.08 for addition.

With those choices settled, ADM already sets a new state of the art on the unconditional LSUN datasets and on ImageNet 64×64. On harder, higher-resolution ImageNet it is close to BigGAN-deep but not past it. Closing that last gap is the job of the second half of the paper.

Measuring fidelity and diversity

The paper's argument is a trade between two things, so both need definitions before the trade makes sense. Sample quality has more than one axis, and the metrics capture different ones.

FID (Fréchet Inception Distance) is the default overall score. Push both the real images and the generated ones through an Inception-V3 network, fit a Gaussian to each cloud of feature vectors, and measure the distance between those two Gaussians:

FID=μrμg22+Tr ⁣(Σr+Σg2(ΣrΣg)1/2)\text{FID} = \lVert\mu_r - \mu_g\rVert_2^2 + \text{Tr}\!\big(\Sigma_r + \Sigma_g - 2(\Sigma_r\Sigma_g)^{1/2}\big)
(7)

Lower is better. Because it compares whole distributions, FID penalizes a model that drops coverage (its Σg\Sigma_g shrinks) as well as one that makes ugly samples. Be precise about what it is, though: FID is the squared 2-Wasserstein distance (the least total work to slide one Gaussian's probability mass onto the other's) between Gaussian fits of the features, not between the true (non-Gaussian) feature distributions, so it inherits that modelling error. A spatial variant, sFID, uses spatial feature maps instead of pooled ones to catch structure the pooled statistics average away.

Inception Score rewards samples that a classifier labels confidently and that spread across many classes. Its blind spot is coverage within a class: a model that memorizes one perfect example per class scores near the top. So the paper leans on a pair of metrics that separate the two axes cleanly. Precision measures fidelity as the fraction of generated samples that land inside the real-data manifold, the region of feature space real images actually occupy. Recall measures diversity as the fraction of real data that lands inside the generated manifold. Both manifolds are estimated the nonparametric way, as the union of small nearest-neighbour spheres around each point.

The two directions are not interchangeable: precision tests your samples against the real manifold, recall tests the real data against your manifold, two different sets and not one counted twice. Drag the concentration knob below: as the model's samples pull onto one dominant mode, every sample stays inside the real manifold (precision holds high) while whole modes of real data go uncovered (recall falls). A truncated GAN does that collapse to gain fidelity, and classifier guidance is about to do it on purpose.

Figure 3 · precision and recall
full
Real data sits in four modes; model samples start covering all of them. The shaded region is one set's manifold (a union of nearest-neighbour spheres). Precision = teal samples inside the amber manifold (fidelity); recall = amber data inside the teal manifold (coverage). Concentrating the samples keeps precision high while recall falls: fidelity bought with coverage.

The reference point for that trade is BigGAN's truncation trick: sample the GAN's latent from a normal distribution truncated toward its centre. Truncating harder concentrates on the modes, which raises fidelity and drops diversity, the dial diffusion models were missing. The rest of the paper builds that dial.

Guiding with a classifier: the exact part

Suppose you have a trained unconditional diffusion model and you want class-yy images out of it, without retraining. GANs bake in class information through class-conditional statistics; the diffusion problem is getting a label into a model that never saw one. The paper's answer is to bring in a separate classifier pϕ(yxt)p_\phi(y\mid x_t) and let its gradients pull sampling toward the class.

Part of this is correct with no approximation. One later step is not exact, so keep the two apart. To condition each reverse step on yy, it suffices to multiply the model's step by the classifier and renormalize:

pθ,ϕ(xtxt+1,y)=Zpθ(xtxt+1)pϕ(yxt)p_{\theta,\phi}(x_t \mid x_{t+1}, y) = Z\,p_\theta(x_t \mid x_{t+1})\,p_\phi(y \mid x_t)
(8)

with ZZ a normalizing constant. The appendix proves the companion fact this rests on: adding a label to the forward noising process changes nothing about it, so the unconditional reverse process the model already learned is still the right thing to multiply. Both of those are exact. The trouble is only that sampling from a product of a Gaussian and an arbitrary classifier is intractable, so the next step approximates it. This product-of-distributions form of guiding a diffusion step goes back to Sohl-Dickstein et al. (2015); the score version comes from Song et al. (2021).

The mean shift

The mean shift below rests on one approximation, and its accuracy sets the limits of everything after. The model's reverse step is a Gaussian N(μ,Σ)\mathcal{N}(\mu, \Sigma). The classifier logpϕ(yxt)\log p_\phi(y\mid x_t) is some curved function of xtx_t; over the small region the Gaussian covers, replace it by its first-order Taylor expansion around the mean μ\mu, a straight-line stand-in for the curved classifier that is trustworthy only close to μ\mu. A linear term added to a Gaussian's log-density just moves its mean, and completing the square shows the move is by Σg\Sigma g:

log(pθpϕ)12(xtμΣg)Σ1(xtμΣg)+C    xtN(μ+Σg, Σ)\log\big(p_\theta\,p_\phi\big) \approx -\tfrac12(x_t-\mu-\Sigma g)^\top\Sigma^{-1}(x_t-\mu-\Sigma g) + C \;\Longrightarrow\; x_t \sim \mathcal{N}(\mu + \Sigma g,\ \Sigma)
(9)

where g=xtlogpϕ(yxt)xt=μg = \nabla_{x_t}\log p_\phi(y\mid x_t)\big|_{x_t=\mu} is the classifier gradient at the mean. The covariance is unchanged; only the mean slides, and it slides by Σg\Sigma g, not by the raw gradient gg. The Σ\Sigma in front rescales the shift by the step's own uncertainty: since the reverse-step covariance is roughly β~tI\tilde\beta_t\mathbf{I}, the shift is large when the step is uncertain and small once the sample is nearly settled. The sampler adds one scalar dial, the gradient scale ss, in front of the shift:

xt1N ⁣(μθ+sΣθxtlogpϕ(yxt), Σθ)x_{t-1} \sim \mathcal{N}\!\big(\mu_\theta + s\,\Sigma_\theta\,\nabla_{x_t}\log p_\phi(y\mid x_t),\ \Sigma_\theta\big)
(10)

Drag μ\mu and the scale ss in the figure. The gradient gg points from wherever you are toward the target class, the shift carries the sampling mean that way, and the readout shows the classifier's probability of the target climbing as ss grows. Put the point out near the other class, where an unconditional sample would be ambiguous, and watch guidance rescue it toward the target.

Figure 4 · classifier guidance as a mean shift
s = 3.0
Two classes; a Bayes classifier plays the role of pϕp_\phi. At the draggable mean μ the unconditional step would sample from N(μ,Σ)\mathcal{N}(\mu,\Sigma) (dashed ring). Guidance shifts the mean by sΣgs\,\Sigma g toward class A (bright ring). Raising s slides the mean further and drives p(target)p(\text{target}) on the shifted mean from about a half toward one.

The approximation in (9) is exact only in the limit of many, tiny steps, where the reverse-step covariance Σ\Sigma shrinks toward zero and the classifier looks locally linear. The paper says as much: the Taylor expansion is justified "in the limit of infinite diffusion steps, where Σ0\lVert\Sigma\rVert \to 0." That gap is why the fast, few-step sampler later needs a larger, hand-tuned scale to offset the coarser steps.

Turning up the gradient

The scale ss should logically be 11: that is the value the derivation produces for genuine conditional sampling. But the authors found that on unconditional ImageNet, s=1s=1 barely worked. At scale 11 the classifier reported only about 50% confidence in the intended class on the finished samples, and the images did not look like the class. Pushing the scale up fixed it: the class probabilities climbed toward 100%, and the samples snapped into the class. The paper's corgi figure reports it on the unconditional model: classifier scale 1.01.0 gives FID 33.033.0 (worse than the unguided 26.2126.21) and unconvincing dogs, while scale 10.010.0 gives FID 12.012.0 and clear corgis.

There is a clean reason a bigger scale sharpens rather than distorts. Scaling the gradient by ss is the gradient of a classifier raised to the power ss:

sxlogpϕ(yx)=xlog ⁣(1Zpϕ(yx)s)s\,\nabla_x\log p_\phi(y\mid x) = \nabla_x\log\!\Big(\tfrac{1}{Z}\,p_\phi(y\mid x)^{s}\Big)
(11)

Raising a probability distribution to a power s>1s>1 and renormalizing is temperature sharpening at T=1/sT = 1/s: it amplifies the peaks, so guidance concentrates harder on the classifier's modes and produces higher-fidelity, less diverse samples. Read (11) precisely, though. The identity treats ZZ as a constant, which is the gradient of an unnormalized energy; a genuinely per-input normalized psp^s would add a xlogZ(x)-\nabla_x\log Z(x) term. So psp^s is the right intuition, a temperature knob, not a literal claim about sampling from a renormalized classifier.

Amplifying a classifier's gradient by ten is also the standard recipe for an adversarial example, a tiny gradient step that fools a classifier into full confidence on an image that looks like noise. So why does guidance produce corgis instead of adversarial static? The relevant fact from the paper is that the classifier is trained on noised images, the same noising the diffusion model uses. A classifier that has only ever seen clean images has brittle, high-frequency input gradients, the ones adversarial attacks exploit. Training on noise forces it to rely on features robust to noise, so its gradients point toward class-meaningful structure a human would recognize. (The paper states the noised-classifier training and the outcome; reading it through the adversarial-robustness lens is the interpretation offered here, supported by later work on perceptually-aligned gradients, not a claim the paper makes.)

A naming caution, because a sibling paper reuses the letter differently. This paper's ss is a raw multiplier on a separate classifier's gradient. Classifier-free guidance, the follow-up that removes the separate classifier entirely, uses a guidance weight ww with its own scale scfg=w+1s_{\text{cfg}} = w+1. They are different parameterizations of related ideas; do not read one paper's number into the other.

Guiding the fast sampler

The mean-shift in (10) is a statement about the stochastic reverse step, so it cannot be dropped into a deterministic sampler like DDIM, which has no per-step covariance to shift. Identity (5) does the work here. The joint distribution's score is the model's score plus the classifier's gradient, because the log of a product is a sum:

xtlog(pθ(xt)pϕ(yxt))=11αˉtϵθ(xt)+xtlogpϕ(yxt)\nabla_{x_t}\log\big(p_\theta(x_t)\,p_\phi(y\mid x_t)\big) = -\frac{1}{\sqrt{1-\bar\alpha_t}}\,\epsilon_\theta(x_t) + \nabla_{x_t}\log p_\phi(y\mid x_t)
(12)

Match that back to a noise prediction using (5), and you get a single guided noise ϵ^\hat\epsilon you can feed into ordinary DDIM in place of ϵθ\epsilon_\theta:

ϵ^(xt)=ϵθ(xt)s1αˉtxtlogpϕ(yxt)\hat\epsilon(x_t) = \epsilon_\theta(x_t) - s\,\sqrt{1-\bar\alpha_t}\,\nabla_{x_t}\log p_\phi(y\mid x_t)
(13)

The sign flips here. Adding the classifier gradient to the score means subtracting it from the noise, because the score is minus the noise over 1αˉt\sqrt{1-\bar\alpha_t} by (5). Plug (13) back into (5) and the joint score comes out exactly, so this is the same guidance, rewritten for a sampler that speaks in ϵ\epsilon rather than in a mean and covariance. Two algorithms, one idea:

# classifier-guided sampling (stochastic), gradient scale s
x = randn(shape)                       # start: x_T ~ N(0, I)
for t in reversed(range(T)):           # T .. 1
    mu, Sigma = model(x, t)            # unconditional reverse step
    g = grad_x(log p_phi(y, x, t))     # classifier gradient at x
    x = sample_normal(mu + s * Sigma @ g, Sigma)
return x                               # x_0
# classifier-guided DDIM (deterministic), gradient scale s
x = randn(shape)
for t in reversed(range(T)):
    eps = eps_theta(x, t)              # predicted noise
    g   = grad_x(log p_phi(y, x, t))   # classifier gradient
    eps_hat = eps - s * sqrt(1 - abar[t]) * g
    x = ddim_step(x, eps_hat, t)       # ordinary DDIM, using eps_hat
return x

The classifier is cheap next to the generator: only the U-Net's downsampling trunk with an attention pooling head, trained on the same noised images. So guidance can ride the 25-step DDIM sampler and still match a GAN.

The trade-off, and beating BigGAN

Now the dial has real numbers on it. Sweeping the gradient scale traces a curve in the precision/recall plane. The figure plots the paper's measured points on ImageNet 256×256: raise ss and each point climbs (more precision, more fidelity) and slides left (less recall, less coverage). FID, annotated at each point, is lowest not at the extreme but in the middle.

Figure 5 · the measured trade-off
s = 1
Precision versus recall on ImageNet 256×256 (Table 5). Each point is a gradient scale ss; raising it trades recall for precision. FID is best at the middle point (s=1s=1, FID 4.59), not the extreme. BigGAN-deep sits in the high-precision, low-recall corner; guided diffusion reaches similar precision at far higher recall.

Read the conditional curve. With no guidance the model has FID 10.9410.94, precision 0.690.69, recall 0.630.63. At s=1s=1 it hits FID 4.594.59, precision 0.820.82, recall 0.520.52: sharper samples, some coverage given up, and the best FID on the sweep. Push to s=10s=10 and precision climbs to 0.880.88 while recall collapses to 0.320.32 and FID worsens to 9.119.11. FID is U-shaped because it responds to both axes: too little fidelity or too little diversity both raise it, so its minimum sits at an intermediate scale. That is why the paper tunes the scale per dataset rather than cranking it, using values from 0.50.5 up to 9.09.0 across resolutions and samplers.

Set against BigGAN-deep, the numbers make the paper's case. The GAN reaches precision 0.870.87 at recall 0.280.28, deep in the corner where fidelity is bought by abandoning coverage. Guided diffusion reaches comparable precision while keeping much more recall, and it wins outright on FID: 2.972.97 on ImageNet 128, 4.594.59 on 256, 7.727.72 on 512, each past the corresponding BigGAN-deep number. When guidance is combined with a second, upsampling diffusion stage (ADM-U), FID improves further to 3.943.94 on 256 and 3.853.85 on 512. And because the learned variance tolerates coarse sampling, the guided model matches BigGAN using as few as 25 forward passes, cutting deep into the speed advantage that was diffusion's last real disadvantage.

The recipe reads as two independent wins that happen to combine. A denoising network tuned like a modern vision model closes most of the quality gap on its own. A classifier's gradient, folded into each sampling step, supplies the fidelity dial GANs had and diffusion models lacked, and it does so without a second adversarial network to train or a whole conditional model to retrain. Within a year the field had taken the next steps: classifier-free guidance removed the separate classifier, and guided diffusion became the backbone of text-to-image systems like Stable Diffusion.

Provenance Verified against primary literature
DDPM (Ho et al. 2020)The VP forward/reverse process and the epsilon-prediction objective ADM builds on.
Improved DDPM (Nichol & Dhariwal 2021)Learned reverse variance, the hybrid objective, and the cosine schedule.
DDIM (Song et al. 2020)Deterministic few-step sampling; the fast sampler guidance rides.
Score SDE (Song et al. 2021)The score view, and the classifier-gradient conditioning adapted for DDIM.
Sohl-Dickstein et al. (2015)The original product-of-distributions form of guiding a diffusion step.
BigGAN (Brock et al. 2018)The truncation trick, the fidelity/diversity baseline ADM is measured against.
caveatThe guided reverse step is written as a single Gaussian with its mean shifted by sΣg. That is a first-order Taylor approximation of the classifier's log-probability, exact only in the many-steps limit where the step covariance shrinks to zero. What it approximates (the reverse step times the classifier, renormalized) is itself exact, and the gap is why fast few-step sampling needs a larger, hand-tuned scale.

Questions you might still have

?

Is classifier guidance the same as classifier-free guidance?
No. Classifier guidance uses a separate classifier trained on noised images, and its gradient shifts each reverse step toward the class. Classifier-free guidance (Ho and Salimans, covered in our Classifier-Free Diffusion Guidance explainer) removes the separate classifier and instead uses the diffusion model’s own conditional-minus-unconditional prediction. They also parameterize the dial differently: this paper’s scale s is a raw gradient multiplier, while classifier-free guidance uses a weight w with s = w+1.

?

Why does amplifying the classifier gradient not just make adversarial noise?
The classifier is trained on noised images, the same noise the diffusion model adds. A clean-image classifier has brittle, high-frequency input gradients, which is what adversarial attacks exploit; training on noise forces reliance on noise-robust features, so the gradients point at class-meaningful structure. The paper states the noised training and the outcome; the adversarial-robustness reading is an interpretation, not a claim the paper makes.

?

Is the guided reverse step exact?
Partly. The factorization of the conditional step into the model times the classifier, renormalized, is exact, as is the proof that adding a label leaves the forward process unchanged. The single Gaussian with mean shifted by sigma-g is a first-order Taylor approximation of the classifier, exact only as the step covariance shrinks to zero (many steps). That gap is why 25-step guided sampling needs a larger, tuned scale.

?

Why is FID lowest at an intermediate gradient scale, not the highest?
FID compares whole distributions, so it penalizes both low fidelity and low diversity. A large scale buys fidelity but collapses coverage, which FID also punishes, so the score bottoms out in the middle. On conditional ImageNet 256 the best FID (4.59) is at scale 1, not at scale 10 (9.11).

?

Does high guidance just make the model memorize the training set?
The paper checks this by finding each sample’s nearest neighbours in Inception feature space and shows the guided samples are not copies of training images. Guidance concentrates on class modes, but the samples it produces are still novel.

Footnotes & further reading

  1. The paper: Dhariwal & Nichol, Diffusion Models Beat GANs on Image Synthesis (OpenAI, NeurIPS 2021). Code.
  2. The diffusion foundations: Ho et al., Denoising Diffusion Probabilistic Models (our explainer), and Nichol & Dhariwal, Improved Denoising Diffusion Probabilistic Models (learned variance, hybrid loss, cosine schedule).
  3. The score view and the score-based conditioning trick: Song et al., Score-Based Generative Modeling through SDEs (our explainer), building on score matching with Langevin dynamics. The deterministic sampler is DDIM.
  4. The original product-of-distributions guidance: Sohl-Dickstein et al., Deep Unsupervised Learning using Nonequilibrium Thermodynamics (our explainer).
  5. The GAN baselines and the truncation trick: Brock et al., Large Scale GAN Training (BigGAN), and the original GAN. The precision/recall metrics are from Kynkäänniemi et al., Improved Precision and Recall Metric, and FID from Heusel et al..
  6. The direct follow-up that removes the separate classifier: Ho & Salimans, Classifier-Free Diffusion Guidance (our explainer). Feature-wise modulation, the lineage of AdaGN: FiLM and adaptive instance norm.