research28 min studyLesson 776 in Engineering

Conditioning dropout: train a null branch before choosing a guidance scale

Separate random conditioning removal during training from classifier-free extrapolation during inference, with an explicit guidance convention.

On this page

What you’ll understand

  • Define a conditioning-dropout distribution and null representation.
  • Compute classifier-free guidance under an explicitly named scale convention.
  • Evaluate conditional and null branches without treating guidance as a guaranteed posterior sampler.

Classifier-free guidance uses conditional and null-conditioned predictions from a model trained to support both inputs. Training dropout determines which conditioning examples the network sees; inference guidance chooses how predictions are combined. These are separate controls. Their conventions, null representation, and sampling protocol must be recorded before a guidance sweep can be interpreted as a modeling result.

Randomly remove the declared conditioning, not an unspecified tensor

In the teaching setup, independently replace the complete external condition with a designated null representation with probability p_drop. Keep the noisy input, timestep, target, and clean-data population otherwise unchanged. A learned null class embedding, an encoded empty prompt, and a zero tensor are different representations; use the one the model was trained to understand. Dropping individual text tokens or leaving another condition channel visible does not necessarily train the same null branch.

With a constant condition-independent dropout probability, the null branch sees the corresponding marginal training-data mixture. If dropout depends on class or sample properties, that mixture can change. Conditioning masks can be per example or follow another declared grouping, which alters finite-batch behavior. Record the random-generator state and mask construction. The expected number of null examples in a batch is not a promise that every batch contains one, and a tiny dropout rate can leave that branch poorly trained under a limited budget.

b∼Bernoulli(pdrop),c~={∅,b=1,c,b=0.b\sim{\rm Bernoulli}(p_{\rm drop}),\qquad \widetilde c=\begin{cases}\varnothing,&b=1,\\c,&b=0.\end{cases}
This setup assumes 0≤p_drop≤1 and a mask independent of data, noise, and timestep. The symbol ∅ denotes the explicitly trained null representation, not an arbitrary zero tensor. The target parameterization and objective remain as declared.↔ Scroll wide equations horizontally.

Guidance extrapolates two predictions under a stated convention

Use the convention epsilon_guided=epsilon_null+w(epsilon_cond−epsilon_null). Here w=0 selects the null prediction, w=1 selects the conditional prediction, and w>1 extrapolates beyond it. Some papers write conditional plus another coefficient times conditional-minus-null, shifting the numerical scale by one. Record the actual formula instead of comparing a number called guidance scale across implementations. Both predictions must use the same noisy sample, time, and compatible target parameterization.

Guidance changes the vector field used by the sampler and commonly trades conditional adherence against other quality or diversity properties. It is not the same operation as increasing training dropout or multiplying the training loss. Even with ideal score estimates, a pointwise guided score expression does not by itself prove a numerical sampler draws exactly from a desired global powered posterior. Finite steps, model errors, clipping, rescaling, and negative-prompt substitutions add further assumptions. Evaluate the actual inference configuration rather than treating guidance as a guarantee.

ϵ^guided=ϵ^∅+w(ϵ^c−ϵ^∅)\widehat\epsilon_{\rm guided}=\widehat\epsilon_{\varnothing}+w\left(\widehat\epsilon_c-\widehat\epsilon_{\varnothing}\right)
This module's dimensionless w convention makes w=1 conditional-only. Predictions are at the same x_t and timestep and use the same noise-target interpretation. A negative prompt is another conditioning input, not automatically the learned unconditional marginal; nonlinear postprocessing can change conversion equivalences.↔ Scroll wide equations horizontally.

Separate training and inference ablations

To study dropout, keep architecture, target, data budget, and an evaluation guidance protocol fixed. To study guidance, freeze the checkpoint and vary only the declared inference scale and sampler controls. Measure null and conditional branch behavior, conditional alignment, sample quality, diversity, and failures across prompt groups. Two forward branches can be batched together, but they still require computation and memory under the chosen implementation. A better-looking selected grid does not replace a fixed prompt and seed portfolio with quantitative and human evaluation.

The probability lab models independent null-mask counts. Reset, set p=0.10 and n=20, predict mean two null examples and zero-null probability about 0.1216, then Play or Step. Separately Reset, set p=0.20 and n=20, predict mean four and zero-null probability about 0.01153, then Play or Step. The exact binomial has no denoiser, text encoder, or inference guidance. It illustrates why training exposure is a distribution, while the hand calculation determines the separate extrapolated prediction.

Keep dropout exposure and guidance arithmetic separate

Use independent conditioning dropout p=0.1 in a batch of twenty. At one inference point, null noise prediction is [1,−1], conditional prediction is [0.5,0], and guidance uses this module's w=3 convention.

  1. The expected null-example count is 20×0.1=2, while probability of no null examples is 0.9²⁰≈0.1216. This is a training-exposure calculation.

  2. The prediction difference is [0.5,0]−[1,−1]=[−0.5,1].

  3. The guided prediction is [1,−1]+3[−0.5,1]=[−0.5,2]. Its scale three is an inference choice and is not determined by the dropout probability 0.1.

The result

Training supplies a null-conditioning branch; inference combines predictions under a separately defined formula and scale.

Explore the model

Interactive lab

Interactive lab · probability

A dropout expectation is not a per-batch quota

Reset, set p=0.10 and n=20, predict mean 2 and P(K=0)=0.9²⁰≈0.1216, then Play or Step. Separately Reset, set p=0.20 and n=20, predict mean 4 and P(K=0)=0.8²⁰≈0.01153, then Play or Step. The iid binomial does not implement conditioning or guidance.

A dropout expectation is not a per-batch quotaThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forNull-branch exposure during training and extrapolation strength during inference are separate variables.

Check your understanding

Under this module's guidance convention, what does w=1 produce?

Try it yourself

For scalar null prediction two and conditional prediction one, compute guided predictions at w=0,w=1,w=2 under the stated convention. Is w=2 a convex average?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Substitute each scale into 2+w(1−2), then inspect the two branch coefficients.

Compare with the solution

The predictions are two, one, and zero. At w=2, the coefficients are −1 on null and 2 on conditional, so this is extrapolation rather than a convex average. It need not stay between the two original predictions or guarantee a particular image-quality outcome.

Take it with you

  • The null representation and dropout distribution define a training task.
  • Guidance scale requires an explicit inference formula.
  • Guidance benefits and tradeoffs need controlled checkpoint-level evaluation.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.