Sliding Mode Control CFG (SMC-CFG)
- SMC-CFG is a control-theoretic formulation of classifier-free guidance that integrates sliding-mode correction to robustly manage semantic error dynamics in diffusion-based generative models.
- The method replaces linear amplification with a switching law that directs the semantic error onto an exponential sliding manifold, addressing instability and overshoot issues at high guidance scales.
- Empirical evaluations demonstrate that SMC-CFG improves semantic alignment and model robustness compared to vanilla CFG, with clear benefits in text-to-image and text-to-video applications.
Sliding Mode Control CFG (SMC-CFG) is a control-theoretic formulation of classifier-free guidance introduced for flow-based diffusion sampling in "CFG-Ctrl: Control-Based Classifier-Free Diffusion Guidance" (Wang et al., 3 Mar 2026). It treats guidance as a feedback controller acting on the first-order continuous-time generative flow, uses the conditional–unconditional prediction discrepancy as a semantic error signal, interprets vanilla CFG as proportional control with fixed gain, and replaces purely linear amplification with a sliding-mode correction designed to drive the semantic error dynamics onto an exponential sliding manifold. The stated motivation is that linear CFG variants can become unstable or overshoot at large guidance scales, whereas SMC-CFG aims at robust, finite-time convergence of the sliding variable under bounded model nonlinearities (Wang et al., 3 Mar 2026).
1. Definition and terminological scope
In the diffusion setting, CFG combines unconditional and conditional model predictions at each denoising step. In the flow-matching notation used by the method, the standard guided velocity is
where is the guidance scale. SMC-CFG keeps this guidance interface but changes the control law applied to the discrepancy term. The semantic error is defined as
The paper’s premise is that, ideally, this error and its derivative should decay as semantic information becomes incorporated into the latent state, but linear amplification alone can instead produce instability, overshooting, oscillatory or divergent behavior, and degraded semantic fidelity, especially at large guidance scales (Wang et al., 3 Mar 2026).
The acronym is specific in this paper: here CFG means classifier-free guidance. A broader control-theoretic reading is possible, because several nonlinear-control papers layer sliding-mode robustness with corrective guidance, learned feedforward, or safety filtering, but those works do not explicitly define the term SMC-CFG. A representative antecedent is a nominal-SMC-plus-learned-correction architecture for partially known nonlinear systems, which the source material explicitly describes as naturally interpretable as an SMC plus corrective guidance framework (Mosharafian et al., 2022).
2. CFG-Ctrl as a unified control framework
The paper introduces a general controlled generative dynamics
and, because guidance acts directly in latent coordinates, sets
The feedback input is parameterized as
Under this interpretation, vanilla CFG is a proportional controller with and (Wang et al., 3 Mar 2026).
The framework is used to reinterpret several guidance variants as control laws rather than ad hoc heuristics.
| Variant | Control interpretation | Key element |
|---|---|---|
| Vanilla CFG | Proportional control | Fixed gain |
| Weight Scheduler | Gain-scheduled proportional control | |
| APG | Projection-based feedback | Parallel/orthogonal decomposition |
| Rectified-CFG++ | Model predictive control | Future-step correction |
| SMC-CFG | Sliding mode control | Switching term on 0 |
This re-description matters because it shifts the design question from “how should the conditional and unconditional predictions be mixed?” to “what feedback law should regulate the semantic error dynamics?” In that language, SMC-CFG is the nonlinear robust-control answer.
3. Sliding manifold, switching law, and Lyapunov analysis
The target semantic dynamics are exponential decay, so SMC-CFG defines the sliding variable
1
with sliding manifold
2
When the system reaches 3, the semantic error follows
4
which is the desired exponentially decaying behavior. The control modifies the semantic error by
5
with 6. The supplementary formulation also writes the switching term in normalized vector-sign form as
7
Thus, relative to vanilla CFG, the method does not simply scale 8; it first applies a nonlinear correction determined by whether the error dynamics are moving toward or away from the sliding manifold (Wang et al., 3 Mar 2026).
The Lyapunov candidate is
9
The analysis assumes bounded intrinsic drift,
0
and nominal control dominance,
1
Under these assumptions, the paper proves finite-time convergence of the sliding variable if
2
The guarantee is therefore on the regulated semantic error dynamics: the switching law forces 3 in finite time, after which the error evolves on the exponential sliding manifold. The theoretical claim is robust convergence of the sliding variable, not a direct theorem on image-level semantic scores (Wang et al., 3 Mar 2026).
4. Discrete-time sampler realization and tuning
SMC-CFG is implemented at sampler time, without retraining the diffusion or flow model. At each step it evaluates the conditional and unconditional velocities, computes
4
approximates the sliding variable by
5
applies the switching correction
6
updates the semantic error, and finally forms the guided velocity
7
The resulting 8 is then passed to the sampler’s ODE update rule (Wang et al., 3 Mar 2026).
The two SMC-specific hyperparameters are 9 and 0. The reported grid search uses
1
The selected settings are 2 for Stable Diffusion 3.5, 3 for Flux-dev, and 4 for Qwen-Image. The default model guidance scale 5 is retained from each official implementation (Wang et al., 3 Mar 2026).
A practical caveat is that the main method uses a hard switching sign law; it does not introduce a boundary-layer saturation or soft-sign replacement in the final formulation. The paper therefore discusses chattering in discrete sampling and proposes a practical tuning corridor,
6
to balance convergence against numerical oscillation. This suggests that SMC-CFG preserves the classical SMC tradeoff between robustness and switching-induced artifacts, even though the application domain is generative modeling rather than physical control (Wang et al., 3 Mar 2026).
5. Empirical evaluation in generative modeling
The evaluation spans multiple text-to-image and text-to-video systems. The main text-to-image experiments use Stable Diffusion 3.5, Flux-dev, and Qwen-Image, with an MS-COCO subset of 5,000 image-text pairs. The reported metrics include FID, CLIP Score, Aesthetic Score, ImageReward, PickScore, HPSv2, HPSv2.1, and MPS. Additional evaluation uses T2I-CompBench with 6,000 prompts for color, shape, texture, and spatial compositionality, plus VQAScore or GenAI-Bench on Stable Diffusion 3.5. The paper also includes text-to-video experiments on Wan2.2-TI2V-5B (Wang et al., 3 Mar 2026).
The stated empirical conclusion is that SMC-CFG outperforms standard CFG in semantic alignment and improves robustness across a wide range of guidance scales. The qualitative motivation given in the method description is that standard linear guidance can yield oversaturated colors, warped structures, and texture inconsistency at large scales, whereas the sliding-mode correction stabilizes the semantic correction dynamics. The comparative baselines discussed in the control reinterpretation are vanilla CFG, CFG-Zero7, Rectified-CFG++, weight scheduling, and APG, but the headline claim is specifically superiority over standard CFG rather than a universal best result against every alternative under every metric (Wang et al., 3 Mar 2026).
The evaluation also supports a broader methodological point: the paper argues that guidance-scale sensitivity is not merely a prompt-conditioning problem but a closed-loop stability problem in the denoising dynamics. SMC-CFG is presented as evidence that robust nonlinear control design can improve semantic alignment without changing model training.
6. Broader control-theoretic context and limitations
SMC-CFG belongs to a wider family of architectures that preserve a nominal command-generation mechanism while adding a robust sliding-mode correction layer. In partially known nonlinear control, one closely related pattern is to design a nominal SMC on an available model, treat the nominal closed-loop trajectory as the desired behavior, and learn an additive correction so the true plant tracks that guidance; the source material explicitly describes this as naturally interpretable as sliding mode control plus a learned corrective guidance framework (Mosharafian et al., 2022). In flight control, a later hybrid formulation uses a deep reinforcement learning policy as feedforward and an SMC law as feedback, with Lyapunov-based conditions linking SMC gains to the admissible learned authority under saturation (Sayyed et al., 19 Jan 2026). In safe marine control, a nominal SMC command is minimally modified by a high-order control-barrier-function projection layer, which functions as a safety filter on top of the sliding-mode law (Syntakas et al., 30 Dec 2025). In data-driven nonlinear control, a nominal controller synthesized from trajectory data is combined with a robust sliding-mode term to enforce reachability of a disturbance-dependent manifold neighborhood (Lan et al., 2024).
These analogues clarify what is distinctive about SMC-CFG. It is not merely “SMC applied to diffusion”; it is an instance of a broader design pattern in which a pre-existing nominal mechanism—here classifier-free guidance—is reinterpreted as a baseline controller and then wrapped with a discontinuous robustification term. At the same time, the term remains domain-specific. In the diffusion paper, CFG means classifier-free guidance; in the broader nonlinear-control literature, “CFG” is at most an interpretive shorthand for corrective guidance, configuration, or filtering, not an established name (Wang et al., 3 Mar 2026).
Two limitations follow directly from the paper’s own formulation. First, the stability proof is on the semantic error dynamics and sliding variable, not on downstream perceptual metrics. Second, the implemented switching law is hard-sign based, so the classical SMC concern with chattering is not eliminated at the formulation level; it is managed empirically through moderate gain selection and discrete-time tuning. A plausible implication is that future variants may explore softened switching, higher-order sliding laws, or adaptive gain scheduling, but such extensions are not part of the method as defined here.