Skip to content

CFG Scale Explained: What Classifier-Free Guidance Does

10 min read · updated August 4, 2026

The guidance scale is a coefficient in a two-term linear combination. At a scale of 7.5 the model is weighting its prompt-conditioned noise prediction by 7.5 and its unconditioned prediction by minus 6.5. Once you see the two coefficients, everything else about the parameter — why 1.0 means off, why high values burn, why it doubles your bill — follows from them.

The short answer

During training, the text conditioning is randomly dropped for a fraction of examples — commonly around ten per cent. One network therefore learns two things at once: how to denoise given a prompt, and how to denoise given nothing. The technique was published as classifier-free guidance by Ho and Salimans in 2022, replacing an earlier approach that needed a separately trained classifier.

At sampling time you evaluate both, and combine them so that the result is pushed past the conditional prediction, away from the unconditional one.

The equation, and what it does at eight values

eps_hat = eps_uncond  +  w · ( eps_cond − eps_uncond )

Expand it and the two coefficients appear:

eps_hat = w · eps_cond  +  (1 − w) · eps_uncond

That is the entire mechanism. The scale w is the weight on the conditional prediction, and 1 − w is the weight on the unconditional one. Written out:

  w      weight on         weight on          what this is
         eps_cond          eps_uncond
------------------------------------------------------------------------
  0.0      0.00             +1.00     ignores the prompt entirely
  0.5      0.50             +0.50     halfway to unconditional; incoherent
  1.0      1.00              0.00     guidance OFF — plain conditional model
  2.0      2.00             −1.00     mild extrapolation
  3.5      3.50             −2.50     typical for larger, better-conditioned models
  5.0      5.00             −4.00     common default band
  7.5      7.50             −6.50     the value everybody copies
 15.0     15.00            −14.00     heavy extrapolation; expect damage
 30.0     30.00            −29.00     far outside the trained region

Three things in that table are worth stating in words, because they are routinely got wrong.

  • A scale of 1.0 is not weak guidance. It is no guidance. The second term vanishes and you get the plain conditional prediction. Implementations detect this and skip the second forward pass, so 1.0 is also half the cost.
  • A scale of 0 is not “no prompt effect” in a gentle sense. It is the unconditional model, which produces whatever the training distribution looks like on average.
  • Above 1.0 the unconditional weight is negative. You are subtracting a prediction. That is extrapolation beyond the segment between the two predictions, not interpolation between them, and extrapolation is where all the artefacts come from.

Why it costs exactly double

Two predictions per step means two forward passes per step. Nearly every implementation runs them as a single batch of two, which is efficient on a GPU but does not change the arithmetic: twice the FLOPs, and on hardware that was already saturated, close to twice the time.

NFE = steps × (2 if w != 1 else 1)

  30 steps, w = 7.5  →  60 network evaluations
  30 steps, w = 1.0  →  30 network evaluations

At 55 ms per evaluation:  3.3 s versus 1.65 s.

This is the single largest cost lever in a generation pipeline after step count, and unlike step count it is binary: on or off. Anything that lets you turn guidance off — a guidance-distilled checkpoint, a model trained with strong enough conditioning not to need it — halves the compute per image. The full cost model is in the GPU-seconds page, and the money side of image generation more generally is in how pictures are priced.

Why extrapolation improves prompt adherence

The difference eps_cond − eps_uncond is the part of the model’s prediction that is attributable to the prompt. Everything the model would have done anyway cancels. What remains is a direction in noise space that points from “a generic sample from this model” towards “a sample that matches this text”.

Multiplying that direction by w and adding it back is asking for more of whatever the prompt was contributing. In the score-based reading of diffusion, it is equivalent to sampling from a distribution in which the conditional likelihood has been raised to the power w — a sharpened distribution, with the modes exaggerated and the tails suppressed.

Sharpening is exactly the trade you are making. You get better prompt adherence and more typical, more prototypical images. You lose diversity: high guidance makes different seeds converge towards the same composition, and makes unusual requests get pulled towards common ones. If your outputs all look alike, guidance is the first parameter to reduce.

What goes wrong at high scales

The failure has a specific mechanism. The predicted noise eps_hat is supposed to be a sample of standard Gaussian noise, and the sampler’s update assumes its statistics. Extrapolation inflates its magnitude: the further apart the two predictions are, the larger the guided result, and the multiplier is w.

An over-large noise estimate means the sampler removes too much at each step, driving latent values towards the extremes of their range. After decoding, the symptoms are consistent and recognisable:

  • Oversaturation and blown highlights. Colours clipping at the top of the range, whites with no detail, skin taking on an orange cast.
  • Contrast that keeps climbing with the scale. The most reliable visual tell that guidance is too high.
  • Hard, over-defined edges and a plastic surface quality.
  • Composition collapse at very high values — the image stops being a scene and becomes a poster of the prompt’s nouns.
  • Structural artefacts at extreme values, as the latent leaves the region the decoder was trained on.
The usable range differs by model family by a large factor. Some models are documented for a range around 2 to 4 and are visibly damaged at 7.5; older ones were tuned around 7 to 9. Copying a scale across model families is the most common cause of “this model looks worse than the last one”. Start from the model card, not from habit.

The four fixes for guidance damage

TechniqueDescription
lower the scaleAlways try this first. Most burn complaints are a scale copied from a different model family. Halve it and see what actually got worse.
rescalingAfter computing the guided prediction, renormalise it so its standard deviation matches that of the conditional prediction, then blend back towards the unguided result by a fixed fraction. This directly attacks the inflated-magnitude cause rather than the symptom.
dynamic thresholdingClip the implied clean image to a percentile of its own values at each step rather than to a fixed range, then rescale. Introduced for pixel-space models operating at high guidance, and applicable wherever the implied x0 is available.
guidance intervalsApply guidance only over a middle range of noise levels, running unguided at the very start and the very end. The reasoning: at the highest noise levels the two predictions barely differ so guidance mostly amplifies noise, and at the lowest levels the composition is settled and guidance only damages texture. This also saves the second forward pass on the excluded steps.

The last of these is worth noticing as a cost lever as well as a quality one: guidance applied on 60 per cent of steps costs 1.6 passes per step rather than 2.

Models where the number means something else

Some checkpoints are guidance-distilled: the two-pass behaviour has been trained into a single network, which takes the desired guidance strength as an explicit input. These run one forward pass per step and still respond to a guidance parameter.

Two practical consequences. First, the parameter’s scale is not comparable to a classifier-free guidance scale, so a value carried over from another model will be wrong. Second, and less obviously, there is no unconditional branch left to put anything in — which is why negative prompts have nowhere to go on these models, and why a UI may accept the field and silently ignore it.