Intuition The One Core Idea
Classifier-free guidance runs a diffusion model twice — once knowing your prompt, once ignoring it — and then exaggerates the difference between the two answers to make the output obey your prompt more strongly. Everything below is just the vocabulary you need to read that one sentence with full understanding.
This page assumes you know nothing about the notation in Classifier-free guidance . We will build every letter, every subscript, and every operator from scratch, in an order where each idea leans only on the ones before it. If a symbol appears in the parent note, it is defined here first.
Before any symbol, picture the process it lives in.
Intuition The picture behind everything
Start with a real image. Slowly sprinkle random static ("noise") on top, step by step, until it's pure television snow. A diffusion model learns to run this backwards : given a noisy picture, it guesses what static to peel off to make it slightly cleaner. Repeat many times → a fresh image appears out of noise.
Every symbol in the parent note is a label somewhere on this forward-and-backward pipeline. Let's name the pieces.
x (bold x)
x is an image stored as a big list of numbers . Each number is one pixel's brightness (or colour channel value). The bold font is a convention meaning "this is a whole list (a vector ), not a single number."
Picture: a photo is a grid of pixels; unroll that grid into one long line of numbers. That line is x .
Why the topic needs it: guidance manipulates images, and to do maths on an image we must treat it as a vector of numbers.
t and x t
t is a time / step counter for how much noise has been added. t = 0 means the clean image; large t means almost pure static. So x t reads as "==the image at noise-level t ==."
Picture: a dial from clean (small t ) to snow (big t ). x 500 = the image when the dial sits at 500.
t is not "seconds"
t is a step index along the noising ladder, not clock time. During sampling we walk t downward (… → x 500 → x 499 → … ), removing noise.
ϵ (Greek "epsilon")
ϵ is the random static that was added to make an image noisy — also a list of numbers, the same length as x . It is drawn from a bell-curve (Gaussian) of random values.
Picture: the exact snow pattern sitting on top of the clean image. If you knew ϵ perfectly, you could subtract it and recover the clean picture.
Why the topic needs it: modern diffusion models don't predict the clean image directly — they predict the noise ϵ . Guessing the static and removing it is easier to train.
θ and ϵ θ
θ (Greek "theta") stands for all the tunable numbers inside the neural network (its weights). Writing ϵ θ means "==the network's prediction of the noise ϵ ==, using its current weights θ ."
Picture: a machine with millions of adjustable knobs (θ ). You feed it a noisy image; out comes its best guess of the static, ϵ θ .
ϵ θ ( … ) aloud
"ϵ " = true noise. "ϵ θ " = the model's noise guess. The subscript θ is the little flag that says "predicted, not real."
c (bold c)
c is the extra instruction you hand the model: a text prompt like "a golden retriever," a class number, anything. Bold again because a prompt is turned into a list of numbers (an embedding ) before the model can use it. See Conditional generation .
Picture: a sticky note taped to the model's input saying "make it a golden retriever."
∅ (the "null" symbol)
∅ means "no instruction at all." It is a special placeholder — an empty prompt, or a zero embedding — that tells the model to generate anything , ignoring guidance.
Picture: the same sticky-note slot, but the note is blank .
Why the topic needs it: classifier-free guidance is entirely built on comparing two runs — one with the note (c ) and one with the blank note (∅ ).
Now that ϵ θ is a vector (a list of numbers), we combine two such vectors. Three simple operations do all the work.
Δ ϵ (delta-epsilon)
The triangle Δ means "the change / difference." So
Δ ϵ = ϵ θ ( x t , t , c ) − ϵ θ ( x t , t , ∅ )
is what you get by subtracting the blank-note guess from the prompt guess, entry by entry.
Why subtraction and not something else? Subtraction isolates only what the prompt added . Whatever both runs agree on cancels out; what's left, Δ ϵ , is a direction — an arrow pointing "toward more prompt-ness."
w (the guidance scale)
w is a single positive number you choose that multiplies the direction Δ ϵ . Multiplying a vector by a number just makes the arrow longer (if w > 1 ) or shorter (if w < 1 ) without changing its direction.
Picture: Δ ϵ is an arrow; w Δ ϵ is that same arrow stretched to w times its length.
w = 0 : arrow vanishes → ignore prompt.
w = 1 : normal conditional generation.
w > 1 : overshoot past the conditional → stronger prompt adherence (see Prompt engineering ).
Multiply out and you land on the parent's boxed formula:
ϵ ~ θ = ( 1 − w ) ϵ θ ( x t , t , ∅ ) + w ϵ θ ( x t , t , c )
Common mistake Where the negative sign comes from
When w > 1 , the coefficient ( 1 − w ) is negative . That is not an error — it means we actively push away from the blank (generic) prediction while pulling toward the prompt one.
∇ (nabla) and the score
∇ x t means "the direction of steepest increase with respect to the image x t " — an arrow pointing whichever way makes a quantity grow fastest. p ( x t ) is the probability of an image, and log is a squashing function that keeps the numbers manageable.
Together, ∇ x t log p ( x t ) is the score : an arrow at each noisy image pointing toward more realistic images.
Picture: a hilly landscape where height = "how realistic." The score is the arrow telling you which way is uphill. This is the heart of Score-based diffusion models , and it links to noise via ∇ x t log p ( x t ) ∝ − ϵ θ — the score points opposite to the predicted static (peel the noise off → become more realistic).
∣ " means "given"
p ( x t ∣ c ) reads "the probability of image x t given the prompt c ." Bayes' rule lets the parent split this conditional probability into an unconditional part plus a "how well does c fit" part — which is exactly the trick that replaces a separate classifier .
You don't need to re-derive Bayes here — just know that this bar-notation is where the whole idea "subtract unconditional from conditional" is born.
noisy image x_t at step t
model noise guess epsilon_theta
guided noise epsilon tilde
Read top-to-bottom: raw images become noisy inputs, the model turns them into noise guesses, running it with a prompt vs a blank note gives two guesses, their difference times w is added back — and that guided guess feeds the DDPM sampling loop that produces your final image. See also Negative prompting for what happens when the "blank note" is replaced by an unwanted prompt.
Cover the right side and test yourself. If any answer is fuzzy, re-read that section before the main note.
What does bold x represent? An entire image flattened into one list (vector) of pixel numbers.
What does the subscript t in x t mean? The noise level / step index — small t is clean, large t is static.
What is ϵ versus ϵ θ ? ϵ is the real added noise; ϵ θ is the network's guess of it (the θ flags "predicted").
What does θ stand for? All the tunable weights inside the neural network.
What is c ? The conditioning / prompt, turned into a number vector.
What does ∅ mean? No conditioning — a blank prompt (the null/empty token).
What is Δ ϵ and why subtract? Conditional guess minus unconditional guess; subtraction isolates the pure "direction the prompt adds."
What does w do to that direction? Scales its length — w > 1 overshoots for stronger prompt adherence.
Why can the coefficient ( 1 − w ) be negative? For w > 1 it pushes away from the generic unconditional prediction.
What does the tilde in ϵ ~ θ signify? The guided (modified) noise prediction.
What is the "score" ∇ x t log p ? An arrow pointing toward more realistic images; it is proportional to − ϵ θ .
What does the bar in p ( x t ∣ c ) mean? "Probability of x t given the prompt c ."