---
title: 'CFG-Ctrl: Control-Based Guidance'
url: https://www.emergentmind.com/topics/cfg-ctrl
type: topic
---

# CFG-Ctrl: Control-Based Guidance

CFG-Ctrl denotes a control-oriented treatment of classifier-free guidance (CFG) in conditional diffusion and flow-based generative models, in which the guidance term is handled as an inference-time control signal rather than as a single fixed heuristic. In its standard form, CFG mixes unconditional and conditional predictions as
$$
\epsilon^w(x_t)=\epsilon^u(x_t)+w\big(\epsilon^c(x_t)-\epsilon^u(x_t)\big),
$$
or, in flow-based models,
$$
\hat{\mathbf{v}}_\theta(\mathbf{x}_t,t,\mathbf{c})=\mathbf{v}_\theta(\mathbf{x}_t,t,\varnothing)+w\bigl(\mathbf{v}_\theta(\mathbf{x}_t,t,\mathbf{c})-\mathbf{v}_\theta(\mathbf{x}_t,t,\varnothing)\bigr).
$$
Recent work reinterprets this operation as fixed-point calibration, dynamic scheduling, nonlinear feedback control, group-wise conditioning control, contrastive concept control, or predictor-corrector transport correction, all aimed at improving semantic alignment, visual fidelity, stability, or efficiency [2510.21512, 2603.03281, 2603.08155].

## 1. Foundational formulation and mechanistic interpretation

Classifier-free guidance operates by contrasting conditional and unconditional model outputs. In score form, the standard guided score is
$$
\hat s_\theta(x_t,c)=s_\theta(x_t,\varnothing)+w\big(s_\theta(x_t,c)-s_\theta(x_t,\varnothing)\big),
$$
and in discrete diffusion language models the analogous logit-level form is
$$
\ell_t^{\mathrm{guided}}=\ell_t^{\mathrm{uncond}}+(1+y_t)(\ell_t^{\mathrm{cond}}-\ell_t^{\mathrm{uncond}}).
$$
This common structure underlies image, audio, and language settings, but static guidance scales impose a single trade-off across all timesteps, prompts, and tasks [2605.07701, 2603.08155].

A control-theoretic reading makes this explicit. In flow-based diffusion, the semantic discrepancy
$$
\mathbf{e}(t)=\mathbf{v}_\theta(\mathbf{x}_t,t,\mathbf{c})-\mathbf{v}_\theta(\mathbf{x}_t,t,\varnothing)
$$
acts as an error signal, and vanilla CFG is a proportional controller with fixed gain $w$:
$$
\frac{d\mathbf{x}_t}{dt}=\mathbf{v}_\theta(\mathbf{x}_t,t,\varnothing)+w\,\mathbf{e}(t).
$$
This formalization places standard CFG, time-varying schedules, projection-based rules, and predictive correctors inside a broader state-feedback family [2603.03281].

Mechanistic analysis further decomposes CFG into three additive effects in an optimal linear diffusion model: a mean-shift term, a positive Contrastive Principal Components term that amplifies class-specific features, and a negative Contrastive Principal Components term that suppresses generic features prevalent in unconditional data. The same work reports that, over a broad range of noise levels, linear CFG resembles the behavior of its nonlinear counterpart, while divergence becomes pronounced at low noise levels [2505.19210]. This suggests that CFG-Ctrl is not merely a matter of choosing a larger or smaller scale, but of selectively regulating distinct semantic and geometric effects across the trajectory.

A recurrent misconception is that stronger CFG monotonically improves condition adherence. Multiple control-oriented papers reject that premise: large fixed guidance can induce overshooting, off-manifold drift, prompt overfitting, reduced diversity, and artifacts, especially late in sampling or in deterministic rectified-flow settings [2603.03281, 2510.07631, 2603.08155].

## 2. Fixed-point calibration and the golden path

A fixed-point formulation is developed in “Towards a Golden Classifier-Free Guidance Path via Foresight Fixed Point Iterations” [2510.21512]. The paper identifies a “golden path” on which latents yield consistent outputs under unconditional and conditional generation:
$$
f^u_{t\to 0}(\hat{x}_t)=f^c_{t\to 0}(\hat{x}_t).
$$
The control objective is to calibrate $x_t$ toward such a latent $\hat x_t$ before denoising, so that unconditional sampling from $\hat x_t$ yields the desired conditional image without sharp trajectory deviations.

This view introduces a fixed-point operator $F$ satisfying
$$
\hat{x}_t=F(\hat{x}_t)\Rightarrow f^u_{t\to 0}(\hat{x}_t)=f^c_{t\to 0}(\hat{x}_t),
$$
with iterations
$$
x_t^{(k)}=F(x_t^{(k-1)}),\quad \hat{x}_t=x_t^{(K)}.
$$
Standard CFG and CFG++ appear as linear short-interval fixed-point operators. For CFG,
$$
F_{\mathrm{CFG}}(x_t)=x_t-w\,\xi_t\big(\epsilon^c(x_t)-\epsilon^u(x_t)\big),
$$
and for CFG++,
$$
F_{\mathrm{CFG++}}(x_t)=x_t-\lambda\,\tilde{\xi}_t\big(\epsilon^c(x_t)-\epsilon^u(x_t)\big).
$$
Reflective operators similarly unify Z-sampling and Resampling as backward-forward operators over extended intervals.

The central theoretical result is that solving many short-interval subproblems with a single iteration each is inefficient under a fixed inference-time budget. Using the average calibration loss
$$
\mathcal{L}=\frac{1}{T}\sum_{t=1}^T \big\|\epsilon^c(\hat{x}_t)-\epsilon^u(\hat{x}_t)\big\|_2^2,
$$
the paper derives
$$
\mathcal{L}\le B^2T\big((\Theta(1)+\Theta(L^2))r^{2\beta N}+2L^2\beta^2\big),\quad \beta=\tfrac{1}{M},
$$
and shows that the minimizer $\beta^\ast$ is generally not $\frac{1}{T}$, implying that single-step-per-timestep calibration is suboptimal when $N$ is finite.

The proposed replacement, Foresight Guidance (FSG), prioritizes longer-interval subproblems early in diffusion with more fixed-point iterations. Its operator is
$$
F_{\mathrm{FSG}}(x_t)=\big(\mathrm{id}-\lambda\tilde{\xi}_t\Delta\epsilon\big)\circ f^u_{t-\Delta t\to t}\circ f^\gamma_{t\to t-\Delta t}(x_t),
$$
where $\gamma>1$ governs the forward conditional move and $\lambda\in[0,1]$ controls a light linear calibration. FSG is sampler-agnostic and is reported for DDIM and DDPM.

Empirically, the method is strong across multiple settings. On Geneval, FSG reaches 57.95% overall versus CFG 48.39%, with counting 43.75%, two-object 79.80%, color 86.17%, and color attribution 28% [2510.21512]. On ImageNet $256\times256$ with DiT, FSG achieves FID 7.91 versus best baseline $\approx 8.62$ at NFE=50, while Vendi rises to 5.79 from 4.64, supporting the claim that diversity does not collapse. On SDXL at NFE=50, wall-clock times are reported as 6.71 s/image for CFG, 6.82 s/image for CFG++, and 6.77 s/image for FSG, indicating negligible overhead despite additional foresight iterations. The paper also reports synergy with NPNet and SPO, including Pick-a-Pic IR 112.64 with NPNet+FSG100 and 117.93 with SPO+FSG100.

## 3. Dynamic schedules, online feedback, and sequential decision-making

A second line of work treats CFG strength as explicitly time-dependent. “C$^2$FG: Control Classifier-Free Guidance via Score Discrepancy Analysis” derives strict upper bounds on the score discrepancy between conditional and unconditional distributions for VP-SDE and VE-SDE settings, including
$$
\|\nabla \log p(x,t)-\nabla \log \tilde p(x,t)\|\le \frac{\alpha(t)}{\sigma^2(t)}\,C
$$
for VP-SDE and
$$
\|\nabla \log p(x,t)-\nabla \log \tilde p(x,t)\|\le \frac{C}{\sigma^2(t)}
$$
for VE-SDE [2603.08155]. The resulting control law is an exponential reverse-time schedule,
$$
\omega(t)=\omega_0\cdot \exp\!\big(\lambda(1-t/t_{\max})\big),
$$
used in place of a fixed guidance weight. The method is training-free and plug-in. On ImageNet-256 with 250 steps, DiT-XL/2 improves from FID 2.29 and IS 276.8 to FID 2.07 and IS 291.5; SiT-XL/2 (REPA, SDE) improves from FID 1.80 and IS 284.0 to FID 1.51 and IS 315.0 [2603.08155]. On MS-COCO latent text-to-image, SD1.5 improves CLIPScore from 31.8 to 31.9.

A more sample-specific alternative appears in “Dynamic Classifier-Free Diffusion Guidance via Online Feedback” [2509.16131]. There, the guidance scale is selected greedily at each timestep by evaluating a discrete candidate set $S$ with latent-space evaluators for alignment, fidelity, and reward:
$$
F_t(s)=\sum_{i=1}^{M}\lambda_{i,t}f_t^{(i)}(s),\qquad s_t^\ast=\operatorname*{arg\,max}_{s\in S}F_t(s).
$$
The weights are adaptive and depend on stepwise score changes,
$$
\lambda_{i,t}\propto \frac{f_t^{(i)}-f_{t+1}^{(i)}}{|f_{t+1}^{(i)}|+\varepsilon}.
$$
On LDM\_large, adaptive Alignment+VQ improves Gecko from 43.8 to 47.2 while reducing FID from 25.6 to 24.8. On Imagen 3, Alignment+Reward reaches 53.6% human preference on Gecko, 53.8% on GenAI-Bench, 54.7% on MARIO-eval, and 53.6% on GeckoNum, while text-rendering-focused variants reach up to 55.5%.

Dynamic control has also been learned by reinforcement learning in discrete diffusion language models. “Guidance Is Not a Hyperparameter: Learning Dynamic Control in Diffusion Language Models” casts scale selection as an MDP with discrete actions $A=\{0.0,0.25,0.5,\dots,3.0\}$ and optimizes a PPO policy over state features such as step ratio, mask ratio, task progress, previous scale, and model confidence [2605.07701]. The paper reports, for 60-step keyword generation, improvement from 71.4% coverage and PPL 61.3 under fixed CFG to 74.6% coverage and PPL 56.2 under RL-Mean. For length control, accuracy rises from 76.0% to 92.8%, content from 90.4% to 91.8%, and PPL drops from 301.9 to 205.6. The learned trajectories are task-specific: hump-shaped for structural constraints such as keyword and length control, monotonically decreasing for sentiment transfer.

Taken together, these results suggest that temporal control can be analytic, evaluator-driven, or policy-learned, but in each case the fixed-scale assumption is treated as the primary source of suboptimality.

## 4. Nonlinear feedback and rectified-flow control

Control laws that depart from linear extrapolation are developed most explicitly in “CFG-Ctrl: Control-Based Classifier-Free Diffusion Guidance” [2603.03281]. The paper defines an exponential sliding manifold over the semantic error,
$$
\mathbf{s}(t)=\dot{\mathbf{e}}(t)+\lambda\,\mathbf{e}(t),
$$
and augments the standard control with a switching term,
$$
\mathbf{u}(t)=w\bigl(\mathbf{e}(t)+\Delta\mathbf{e}(t)\bigr),\qquad
\Delta\mathbf{e}(t)=-k\,\mathrm{sign}\bigl(\mathbf{s}(t)\bigr),
$$
or smoothed variants based on $\mathrm{sat}$ and $\tanh$. Using the Lyapunov function $V(\mathbf{s})=\tfrac12\|\mathbf{s}\|_2^2$, the paper derives finite-time convergence under a gain condition such as $k>\delta/b_{\min}$, and in a robustness refinement
$$
k>\frac{\delta}{w-\rho}+\epsilon.
$$
The discrete-time implementation uses
$$
\mathbf{s}_k=\frac{\mathbf{e}_k-\mathbf{e}_{k+1}}{\Delta t_k}+\lambda\,\mathbf{e}_{k+1},
\qquad
\Delta\mathbf{e}_k=-k\,\tanh(\mathbf{s}_k/\beta).
$$

Empirical evaluation on SD3.5, Flux-dev, and Qwen-Image over an MS-COCO subset reports consistent metric gains. For SD3.5, FID improves from 21.421 to 20.044, CLIP from 0.3681 to 0.3694, ImageReward from 0.8889 to 0.9486, and MPS from 7.2476 to 7.5719. For Flux-dev, FID improves from 27.323 to 26.398, CLIP from 0.3692 to 0.3743, and ImageReward from 0.8749 to 1.0558. Spatial scores on T2I-CompBench also rise, for example from 0.1625 to 0.2563 on SD3.5 and from 0.2968 to 0.4085 on Qwen-Image [2603.03281].

A related but flow-specific correction is provided by “Rectified-CFG++ for Flow Based Models” [2510.07631]. The method replaces naive RF extrapolation with a predictor-corrector update. A conditional predictor half-step anchors the latent near the learned transport path,
$$
x_{t-\Delta t/2}^{\mathrm{pred}}=x_t-(\Delta t/2)\,v_c(x_t,t),
$$
and the corrector uses a mid-point interpolation,
$$
v_{\mathrm{RCFG++}}(x_t,t;s)=v_c(x_t,t)+\alpha(t;s)\big(v_c^{\mathrm{mid}}-v_u^{\mathrm{mid}}\big),
$$
followed by
$$
x_{t-\Delta t}=x_t-\Delta t\,v_{\mathrm{RCFG++}}(x_t,t;s).
$$
The paper proves marginal consistency and a bounded tubular-neighborhood property, including
$$
\mathrm{dist}(x_{t-\Delta t},M_{t-\Delta t})\le C\epsilon\Delta t.
$$

On MS-COCO 10K, the method improves Lumina FID from 26.93 to 22.49 and HPSv2 from 0.2797 to 0.3004; Flux-dev improves from FID 37.86 to 32.23, CLIP 0.3351 to 0.3493, PickScore 0.3248 to 0.6752, and HPSv2 0.2621 to 0.2996 [2510.07631]. Flux-dev also shows a strong low-NFE result, with FID at 5 steps improving from 177.8 under CFG to 71.2 under Rectified-CFG++.

These nonlinear and RF-specific controllers share a common premise: guidance should not only amplify the conditional signal, but also regulate the trajectory geometry that the amplification induces.

## 5. Structured semantic control: concepts, attributes, and counterfactuals

Scalar guidance acts uniformly across all conditioning factors. Several CFG-Ctrl methods replace that uniformity with structured semantic control.

“Contrastive CFG: Improving CFG in Diffusion Models by Contrasting Positive and Negative Concepts” addresses negative guidance [2411.17077]. Naive negative CFG uses
$$
\epsilon_{\mathrm{nCFG}}(x_t,c^-;\gamma)=\epsilon_\theta(x_t,\varnothing)-\gamma\big(\epsilon_\theta(x_t,c^-)-\epsilon_\theta(x_t,\varnothing)\big),
$$
which corresponds to
$$
p^{\mathrm{neg}}(x\mid c^-)\propto \frac{p(x)}{p(c^-\mid x)^\gamma},
$$
and is described as inverting the posterior, potentially driving samples off the data manifold. The proposed contrastive guidance defines $d_t=\|\epsilon_\theta(x_t,c)-\epsilon_\theta(x_t,\varnothing)\|_2^2$ and uses bounded coefficients
$$
\lambda^+(d_t;\tau)=\frac{2}{1+e^{-\tau d_t}},\qquad
\lambda^-(d_t;\tau)=-\frac{2e^{-\tau d_t}}{1+e^{-\tau d_t}}.
$$
This yields a positive mode close to standard CFG near the concept and a negative mode that cancels guidance as the state becomes unrelated. On a COCO 10k synthesized positive-negative benchmark with SD1.5, CCFG preserves FID near the unguided baseline, with FID 19.963 versus 19.616 for None and 21.064 for nCFG, while reducing negative alignment comparably to nCFG.

“Decoupled Classifier-Free Guidance for Counterfactual Diffusion Models” introduces group-wise conditioning control for counterfactual generation [2506.14399]. Instead of a single global weight, conditioning is split into attribute groups and combined as
$$
\epsilon_{\mathrm{DCFG}}(\mathbf{x}_t,t,\mathbf{c})=
\epsilon_\theta(\mathbf{x}_t,t,\varnothing)+
\sum_{m=1}^{M}\omega_m\big(\epsilon_\theta(\mathbf{x}_t,t,\mathbf{c}^{(m)})-\epsilon_\theta(\mathbf{x}_t,t,\varnothing)\big).
$$
For counterfactuals, two groups are used: affected attributes and invariant attributes, derived from the causal graph. On CelebA-HQ for $\mathrm{do}(\mathrm{Smiling})$, global CFG with $\omega=2.5$ raises Smiling AUC to 98.6 but also amplifies Male to 99.7 and Young to 89.3, whereas DCFG with $(\omega_{\mathrm{aff}}=2.5,\omega_{\mathrm{inv}}=1.2)$ achieves Smiling 98.9 while reducing Male to 96.1 and Young to 77.8, and improves reversibility from LPIPS 0.142 to 0.112 and MAE 0.234 to 0.164. Similar reductions in attribute amplification are reported on EMBED and MIMIC-CXR, including a MIMIC-CXR finding intervention with finding 98.8, race 80.1, sex 96.4, MAE 0.151, and LPIPS 0.212.

These structured methods address a second misconception: that the conditioning vector is semantically homogeneous. The evidence indicates that concept exclusion, invariant preservation, and intervention fidelity often require separate control channels rather than a single scalar multiplier.

## 6. Distillation, efficiency, and deployment-time control

A separate direction moves control from the sampling trajectory into the model weights. “Diversity-Rewarded CFG Distillation” studies this for autoregressive music generation [2410.06084]. The teacher is a CFG-augmented policy with logits
$$
z^{\mathrm{CFG}_\gamma}_n=\gamma\cdot m_\theta(s_n\mid y_{<n},x)+(1-\gamma)\cdot m_\theta(s_n\mid y_{<n},x^-),
$$
using $\gamma=3$ and the negative prompt “Bad audio quality.” The student is trained with an on-policy token-level KL distillation objective and a diversity reward
$$
r_D(y_1,y_2)=1-\frac{E(y_1)\cdot E(y_2)}{\|E(y_1)\|\,\|E(y_2)\|},
$$
combined as
$$
\mathbb{QD}(\theta)=\mathbb{Q}(\theta)+\beta\,\mathbb{D}(\theta).
$$
The method eliminates the approximately $2\times$ inference overhead of CFG, since deployment requires only one forward pass. Distillation alone matches CFG quality but reduces diversity; adding the diversity reward raises diversity beyond CFG, and deployment-time weight interpolation
$$
\theta(\lambda)=(1-\lambda)\theta_q+\lambda\theta_d
$$
provides a quality-diversity control knob. Human evaluation shows that the merged model LERP(0,15) is more diverse than base+CFG with a 57% win rate while preserving quality at approximately 51% win rate.

This weight-space perspective is orthogonal to sampler-side controllers such as FSG, SMC-CFG, or C$^2$FG. It shifts CFG-Ctrl from online guidance design to offline compression of guidance behavior. The broader pattern across methods suggests several control dimensions: calibration of latent trajectories, temporal scheduling of guidance strength, nonlinear stabilization, semantic factorization, and deployment-time distillation. That taxonomy is interpretive rather than formal, but it captures the common research move away from the view of CFG as a single scalar hyperparameter.

Across the literature, the unifying conclusion is consistent. Guidance is most effective when treated as a structured control problem whose design depends on noise level, prompt semantics, transport geometry, and conditioning decomposition, rather than as a fixed extrapolation rule [2510.21512, 2603.08155, 2603.03281, 2510.07631, 2506.14399, 2411.17077, 2410.06084, 2605.07701, 2509.16131].

Source: https://www.emergentmind.com/topics/cfg-ctrl