Every time you type a prompt and a stunning image appears, a simple arithmetic trick is doing most of the work. It is called classifier-free guidance (CFG), and it was introduced by Jonathan Ho and Tim Salimans in 2022.
A diffusion model learns to reverse noise: given a noisy image, predict the noise that was added. Doing that conditioned on a text prompt should push the result toward your description — but in practice the model drifts. Without extra pressure it hedges, averaging over everything consistent with the words and producing flat, unconvincing samples.
CFG fixes this with a remarkably small change. At each denoising step the model runs twice: once with your prompt and once with an empty prompt (no condition at all). Then it extrapolates — pushes further in the direction the conditional score differs from the unconditional one:
where is the guidance scale. At you get the raw conditional prediction. Push higher and the output becomes sharper and more faithful to the prompt — at the cost of less variety and eventually over-saturation.
That single number is the creative control sitting behind the slider in every major image generator today.
Comments
Loading comments...