Ask what should change under a concrete input, then trace that expectation through the equation.
Foundation Lab
Classifier-Free Guidance in Diffusion
CFG is why Stable Diffusion/DALL-E/Midjourney produce high-quality, on-prompt images
Selected Foundation Object
Keep the equation fixed; move through the evidence.
CFG extrapolates beyond the data distribution—high guidance can produce unrealistic but more "prompt-adherent" images
Use the key equation and canonical papers as the available witnesses, without implying that a runnable panel exists.
The useful learning product is the reusable mechanism you can carry into another model, paper, or engineering tradeoff.
Use prerequisites, dependents, and semantic links to repair the next gap without leaving the object behind.
Why It Matters for Modern Models
- CFG is why Stable Diffusion/DALL-E/Midjourney produce high-quality, on-prompt images
- The guidance scale is the main user-facing knob for text-to-image quality vs diversity
- Trains one model that handles both conditional and unconditional generation via dropout on conditioning
What Tutorials Skip
What is still poorly explained in textbooks and papers:
- CFG extrapolates beyond the data distribution—high guidance can produce unrealistic but more "prompt-adherent" images
- There is an optimal guidance scale: too low = ignores prompt, too high = artifacts and oversaturation
- CFG relates to temperature in LLMs: both are post-hoc distribution shaping at inference time
Visualization Status
Core Math (Optional Deep Dive)
If you want intuition first, start with the key equation and cited sources. Come back here for the full walkthrough.
CFG interpolates between conditional and unconditional scores:
where is the guidance scale (typically 3-15 for text-to-image).
Equivalently in score space:
Higher amplifies the conditioning signal, trading diversity for fidelity.