Skip to content

Classifier-free guidance: the guidance scale is an exponent on an implicit classifier

Classifier-free guidance trains one network with condition dropout and extrapolates between its conditional and unconditional predictions.

Line diagram: from the iterate x_t, the unconditional and conditional predictions, and the guided step at s = 3 extrapolating along their difference past the conditional one

Classifier-free guidance (CFG) runs one network with and without its condition and extrapolates along the difference; the guidance scale is an exponent on an implicit classifier.

Two readings of the guidance scale

"Conditioning strength"

Predicts the benefit, stronger adherence to the condition, and none of the costs.

An exponent on an implicit classifier

Predicts the costs too:

  • a second forward pass per step
  • diversity traded for per-sample fidelity
  • off the training distribution at high scales
  • no portable "good value"
What CFG is, and why the exponent reading holds

The exponent reading says CFG sharpens the sampling distribution rather than improving the model, and has no portable "good value" because the exponent multiplies a quantity whose magnitude is system-specific.

Classifier-free guidance (CFG) trains a conditional generative model with condition dropout, so one network can predict both with and without the conditioning signal. At sampling time the two predictions are combined by extrapolating along their difference, scaled by a guidance weight. Nearly every modern conditional generator exposes that weight: image diffusion models, the per-token diffusion heads that autoregressive TTS systems run on top of an LLM backbone, and, per decoding step, token language models.

The scale is widely described as conditioning strength. By Bayes rule, though, the difference between the conditional and unconditional predictions estimates the gradient of a classifier the generative model already contains, and the guidance weight is an exponent on that classifier's probability. That one fact is what makes the rest predictable.

LatentLM ablation of CFG scale and sampling steps for zero-shot TTS
Turning guidance on (scale 1 to 2) gives most of the gain; the optimum at 4 sits on a broad plateau. Source: LatentLM paper, Figure 10, p. 14.What to see

intelligibility (1 - WER-C, where WER-C is word error rate from a Conformer-Transducer ASR transcription) and speaker similarity over CFG scales 1 to 8 and over diffusion sampling steps. The jump from scale 1 (guidance off) to 2 dwarfs everything after it, and the optimum at 4 sits on a broad plateau.

View full size: LatentLM ablation of CFG scale and sampling steps for zero-shot TTS

Classifier guidance needed a separate noise-aware classifier

CFG replaced classifier guidance, which splits a diffusion model's conditional score by Bayes rule:

∇xlog⁡pt(x∣c)=∇xlog⁡pt(x)+∇xlog⁡pt(c∣x)\begin{aligned} \nabla_x \log p_t(x \mid c) &= \nabla_x \log p_t(x) \\ &\quad + \nabla_x \log p_t(c \mid x) \end{aligned}

Dhariwal and Nichol trained a separate noise-aware classifier and added its gradient, scaled by ss; the scale was already an exponent, turning p(c∣x)p(c \mid x) into p(c∣x)sp(c \mid x)^s.

How classifier guidance works, and the s = 1 failure

A diffusion model's denoising network ϵ(xt,c)\epsilon(x_t, c) predicts the noise mixed into the current iterate xtx_t, and up to a known negative scale factor that prediction estimates the score, the gradient of the log density of the noised data. Bayes rule splits the conditional score into the two terms above.

Dhariwal and Nichol exploited the second term directly: train a separate classifier p(c∣xt)p(c \mid x_t) and add its input-gradient, multiplied by a scale ss, to the diffusion model's score at every sampling step. The classifier must be trained on noised inputs at every noise level the sampler visits, because a clean-data classifier produces meaningless gradients on the noisy iterates the sampler actually queries.

The scale was already an exponent there. Multiplying the gradient by ss turns p(c∣x)p(c \mid x) into p(c∣x)sp(c \mid x)^s inside the log. As a function of xx that term up-weights the inputs the classifier assigns to cc most confidently, more aggressively as ss grows. The exponent was not optional. Guiding an unconditional ImageNet model at s=1s = 1, which is exactly the Bayes decomposition, produced samples that did not visibly match their classes even though the classifier scored them near 50%: the estimated gradient is too weak in practice to carry the conditioning alone.

Pushing ss from 1 to 10 on ImageNet traded recall (a coverage measure of diversity) from 0.52 down to 0.32 while precision rose from 0.82 to 0.88.

Classifier guidance on ImageNet, scale s = 1 versus s = 10

Recall (diversity)

s = 1
0.52
s = 10
0.32

Precision (fidelity)

s = 1
0.82
s = 10
0.88

The burden: a separate noise-aware classifier per conditioning type, and none to train for a free-text prompt.

Bayes rule removes the classifier network, not the classification

The implicit classifier inside any conditional model is p(c∣x)∝p(x∣c)/p(x)p(c \mid x) \propto p(x \mid c) / p(x), so the subtraction ϵ(xt,c)−ϵ(xt)\epsilon(x_t, c) - \epsilon(x_t) replaces the external classifier.

Diagram: the same network runs twice per sampling step, once on the iterate x_t with the condition c and once with the null token; the guided step combines the conditional and unconditional predictions as epsilon_u + s (epsilon_c - epsilon_u)
Both predictions come from one network; the guided step extrapolates along their difference.

Condition-dropout ablation (Ho and Salimans)

  • 0.1 and 0.2dropout rates that perform about equally
  • 0.5consistently worse
How one network learns both branches

One network, two branches at every sampling step

Conditional branch

Input: the iterate xtx_t and the condition cc.

Output: ϵ(xt,c)\epsilon(x_t, c), the conditional prediction.

Unconditional branch

Input: the same xtx_t with the null token in place of cc.

Output: ϵ(xt)\epsilon(x_t), the unconditional prediction.

Guided step

Extrapolate along the difference: past the conditional prediction, directly away from the unconditional one.

Ho and Salimans inverted the classifier-guidance identity: the gradient of the implicit classifier is the difference between the conditional and unconditional scores, so a diffusion model that can produce both predictions does not need the external classifier.

Both predictions come from one network. During training the condition cc is replaced with probability puncondp_{\text{uncond}} by a null token, a learned embedding standing for "no condition", so the same weights learn p(x∣c)p(x \mid c) and p(x)p(x) jointly. In their ablation, dropout rates of 0.1 and 0.2 perform about equally and 0.5 is consistently worse: the unconditional branch needs only a minority of training capacity.

Sampling combines the two outputs, in the form most codebases use (s=1s = 1 is guidance off):

ϵguided=ϵuncond+s (ϵcond−ϵuncond)\epsilon_{\text{guided}} = \epsilon_{\text{uncond}} + s\, (\epsilon_{\text{cond}} - \epsilon_{\text{uncond}})
On the line through the unconditional and conditional predictions, s = 0 is the unconditional prediction, s = 1 the conditional prediction, and s = 3 extrapolates beyond it
Guidance above s = 1 extrapolates past the conditional prediction.
The original (1 + w) convention, and the cost of the second pass

Ho and Salimans write the combination with guidance strength ww, where w=0w = 0 is plain conditional sampling:

ϵguided=(1+w) ϵ(xt,c)−w ϵ(xt)\epsilon_{\text{guided}} = (1 + w)\, \epsilon(x_t, c) - w\, \epsilon(x_t)

Most codebases reparameterize with s=1+ws = 1 + w. The two conventions differ by exactly one, and both are in active use, so published "guidance scale" numbers are not comparable without the accompanying equation.

The cost is structural: two full forward passes per step, usually a doubled batch, unless the guided pair is distilled into one student network (Meng et al. 2022), a one-time training job.

The scale tilts the sampling distribution toward the implicit classifier's modes

Substituting the implicit classifier back into the classifier-guidance formula shows what the sampler is being pointed at, per noise level:

∇xlog⁡[ pt(x∣c)  pimplicit(c∣x)w ]\nabla_x \log \bigl[\, p_t(x \mid c)\; p_{\text{implicit}}(c \mid x)^w \,\bigr]

Each step moves toward the model's conditional times the implicit classifier to the power ww.

Two gaps from exact sampling: not a classifier gradient, and per-step tilts that do not compose

Each denoising step moves toward a tilted distribution: the model's own conditional, multiplied by the implicit classifier raised to the guidance power. Geometrically, the update extrapolates past the conditional prediction, directly away from the unconditional one: away from what the model expects regardless of the condition, deeper into the region that only the condition explains.

Ho and Salimans state the first gap themselves: the epsilon outputs are unconstrained network outputs, so their difference is not in general the gradient of any actual classifier. For the second, even with exact scores, steering each noise level toward its tilted marginal does not compose into sampling the tilted data distribution; Bradley and Nakkiran later showed that CFG instead matches a predictor-corrector sampler, alternating a denoising step with a sharpening correction.

CFG is a per-step correction that reliably lands in high-confidence regions of the implicit classifier, not exact inference over a known distribution.

Concentrating mass on classifier modes should hurt distribution-level metrics first and per-sample metrics last, and it does:

Ho and Salimans' guidance sweep, ImageNet 64x64

  • w = 0.1best FID, guidance barely on
  • About 17xFID degradation by w = 4
  • RisesInception Score, monotonically over the same sweep
What FID and Inception Score measure in this sweep

On ImageNet 64x64, FID (a distribution distance that punishes diversity loss and per-sample artifacts alike) is best at the barely-on w = 0.1 and degrades about seventeenfold by w = 4, while Inception Score, which rewards confidently recognizable individual samples, rises monotonically over the same sweep. Ho and Salimans describe the visual version plainly: sample variety decreases as individual sample fidelity increases.

Pushed further, guidance breaks the sampler's own input distribution (Imagen):

How high guidance breaks an image sampler (Imagen)

  1. Extrapolateimplied clean images leave the [-1, 1] training range
  2. Feed backthe sampler iterates on its own out-of-range outputs
  3. Failsaturated, unnatural images, or divergence
  4. Fixdynamic thresholding re-clamps the estimate every step

What breaks first is your domain's analog of pixel range.

The portable lesson: the mechanism, not the fix

Extrapolation queries the network off its training manifold, and what breaks first is whatever your domain's analog of pixel range is; dynamic thresholding is Imagen's fix for pixels, not a general one.

The same extrapolation runs per token on logits in autoregressive models

Koel-TTS, a TTS token model, runs the same extrapolation once per decoding step on logits:

logitsguided=logitsuncond+γ (logitscond−logitsuncond)\begin{aligned} \text{logits}_{\text{guided}} &= \text{logits}_{\text{uncond}} \\ &\quad + \gamma\, (\text{logits}_{\text{cond}} - \text{logits}_{\text{uncond}}) \end{aligned}

before the softmax (γ=1\gamma = 1 is guidance off). Here the tilt is exact per token, where diffusion's is heuristic.

Koel-TTS logit guidance

  • 0.1probability of dropping text and speaker audio together
  • gamma = 2.5optimum in a sweep from 1 to 3
  • DoubledKV cache and per-token compute for two branches

In TTS, error rate and speaker similarity improve together up to gamma = 2.5.

Why the per-token tilt is exact, what the unconditional branch sees, and why TTS trades differently

Nothing in the construction is diffusion-specific; it needs only two predictions from one network that differ in conditioning. In discrete autoregressive models the combination runs once per decoding step, on logits. Koel-TTS, an encoder-decoder TTS token model, trains with both the text and the reference speaker audio dropped together at probability 0.1, and γ\gamma sits in the ss-convention.

The softmax renormalizes, so each token is sampled from precisely p_cond^gamma times p_uncond^(1-gamma), normalized. The exactness is per token: the product of per-token tilts is not the tilted distribution over whole sequences, where the same caveat reappears one level up.

The unconditional branch consumes the same generated token history with no text or speaker prefix, so its prediction answers "how would this audio continue with no instructions", and the guided difference amplifies exactly what the instructions explain. Text LLMs use the same per-step recipe to amplify a prompt, contrasting predictions with and without it (Sanchez et al. 2023), and the two branches' different prefixes mean AR CFG doubles the KV cache as well as the per-token compute.

The trade-off lands differently in TTS than in images. Sweeping gamma from 1 to 3, Koel-TTS finds character error rate and speaker-embedding similarity improve together, with the optimum at 2.5: both metrics measure adherence to a conditioning input being amplified, and much of the "diversity" being burned is the unconditioned failure mode, hallucinated words and drifting voice. The cost surfaces where the paper notes it, as reduced variation at higher scales, not in the adherence metrics.

The unconditional branch defines what you extrapolate away from

What the second branch conditions on is a design choice, and systems diverge on it:

System Extrapolates away from
Koel-TTS no text, no speaker
VibeVoice the start token's state
SemaVoice the last acoustic patch
Negative prompt an unwanted description
InstructPix2Pix image, instruction: two scales
Autoguidance a weaker model's errors
The design choices in detail
System The negative branch conditions on Consequence
Koel-TTS The generated token history alone: text and speaker context dropped together Guidance amplifies both at once
VibeVoice The start-of-sequence token's hidden state, a minimally conditioned input the model computes anyway The report describes no trained null token
SemaVoice The previous acoustic patch, with the LLM hidden state dropped Only the semantic conditioning is sharpened
Negative prompt (image generators) An unwanted description Away from what is specified
InstructPix2Pix Two differences, two scales Image agreement and instruction amplified separately
Autoguidance A smaller, less-trained version of the same model Away from the weaker model's errors

Koel-TTS drops text and speaker context together, so guidance amplifies both at once. VibeVoice's report describes no trained null token: its diffusion head's unconditional branch conditions on the hidden state of the start-of-sequence token, a minimally conditioned input the model computes anyway. SemaVoice drops the LLM hidden state but keeps the previously generated acoustic patch in the unconditional branch, so patch-to-patch continuity stays unguided and only the semantic conditioning is sharpened. The negative-prompt field in image generators is this same equation with the null condition replaced by an unwanted description, turning "away from what is typical" into "away from what is specified".

Two refinements push the lever further. InstructPix2Pix decomposes the condition and runs two differences with two scales, one amplifying agreement with the input image and one with the edit instruction, the practical alternative to dropping all conditions jointly the way Koel-TTS does. Autoguidance (Karras et al. 2024) replaces the unconditional branch with a smaller, less-trained version of the same model, so the extrapolation points away from that weaker model's errors rather than away from the condition's absence, and recovers fidelity without the diversity collapse.

In every case the guided sample is defined as much by the negative branch as by the positive one.

Tuned scales do not transfer across systems, tasks, or notation conventions

Speech systems that all cite the same CFG paper (located in our map of the modern speech stack) ship settings spanning a factor of three:

Published guidance setting, in the s-convention (s = 1 is off)

VibeVoice
1.3
LatentLM (ImageNet)
1.65
Koel-TTS
2.5
SemaVoice
3.5
LatentLM (TTS)
4

LatentLM needs 1.65 for ImageNet but 4 for TTS: the task pins the value, not the architecture.

Each setting with its CFG site and step count, and why the right scale is system-specific
System CFG site Published setting In s-convention (s = 1 is off) Head denoising steps
VibeVoice per-token diffusion head 1.3 1.3 10
Koel-TTS AR token logits gamma = 2.5 2.5 none (token model)
SemaVoice per-patch diffusion head w = 2.5 3.5 not stated
LatentLM (TTS) per-token diffusion head 4 4 5
LatentLM (ImageNet) per-token diffusion head 1.65 1.65 not stated

Source: VibeVoice Sec. 3.2 and Fig. 3; Koel-TTS Secs. 2.5 and 3.4; SemaVoice Sec. 3.2.3 (which uses the (1+w) convention, hence the conversion); LatentLM Secs. 3.1 and 3.3.6.

LatentLM is one architecture family, and it needs 1.65 for class-conditional ImageNet but 4 for TTS: neither the architecture nor the codebase pins the value, the task does. And SemaVoice's published 2.5 is 3.5 in the convention the other rows use, because its paper writes the Ho-Salimans (1+w) form; copying a guidance number without its equation silently changes the strength by one full unit.

The spread follows from the exponent reading: the scale multiplies the implicit classifier's log-likelihood ratio, and the magnitude of that ratio depends on how strongly the conditioning pins the output (a transcript plus a speaker prompt constrains speech far harder than a class label constrains an image), on what the unconditional branch conditions on, and on the sampler's step count.

The guidance scale is a coefficient on a system-specific signal, not an absolute strength in shared units.

Published sweeps differ in shape, not just in optimum:

VibeVoice Figure 3 redrawn as two grids over CFG scales 1.35, 1.3 and 1.25 and denoising steps 5, 10, 15 and 35: WER is lowest (1.55) at scale 1.25 and 10 steps and highest (3.83) at scale 1.3 and 5 steps; SIM-O is highest at 5 steps (0.601 to 0.603)
Within a narrow scale window, WER swings from 3.83 to 1.55 depending on the scale-step pair. Source: VibeVoice paper, Figure 3, p. 8, redrawn with its values.

Sweep the scale and step count as one pair per system, and publish the combination equation next to the number.

The paper's Figure 3, what it plots, and why a scale needs its equation
VibeVoice ablation heatmaps of CFG scale and denoising steps: WER is lowest (1.55) at scale 1.25 and 10 steps and highest (3.83) at scale 1.3 and 5 steps; speaker similarity is highest at 5 steps
VibeVoice paper, Figure 3, p. 8, as published. Source: VibeVoice paper, Figure 3, p. 8.What to see

word error rate and SIM-O (speaker-embedding similarity to the reference audio) over CFG scales 1.25 to 1.35 and denoising steps 5 to 35. Within that narrow scale window, WER still swings from 3.83 to 1.55 depending on the scale-step pair, and the WER optimum (scale 1.25 at 10 steps) disagrees with the similarity optimum (5 steps), so the shipped setting of 1.3 at 10 steps is a compromise.

View full size: VibeVoice ablation heatmaps of CFG scale and denoising steps: WER is lowest (1.55) at scale 1.25 and 10 steps and highest (3.83) at scale 1.3 and 5 steps; speaker similarity is highest at 5 steps

The operational consequence: treat the guidance scale and step count as one jointly swept pair per system, and when reporting the result, publish the combination equation next to the number. A scale without its equation is not a reproducible setting.

Sources

All 12 sources and what each supports