Paper deep dive
CACFG: Curvature-Aware Classifier-Free Guidance and Optimal Control
Max Collins, Dasith de Silva Edirimuni, Jordan Vice, Tim French, Ajmal Mian
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Diffusion models generate samples by learning to reverse a fixed corruption process, and classifier-free guidance (CFG) is the standard mechanism for conditioning this process on a desired class or prompt. CFG can be applied at varying guidance strengths, and while higher strengths improve image quality and conditional alignment, too high a guidance strength can degrade image quality and diversity. Furthermore, CFG violates principled diffusion sampling dynamics, and existing explanations for why it works despite the violation disagree on the underlying theory or do not extend to deterministic samplers used in practice. We address both these issues. We first frame CFG sampling as a continuous-time optimal control problem, treating the sampling trajectory as a sequence of controls chosen to maximise the probability of the desired condition. Solving the resulting Hamilton--Jacobi--Bellman equation shows that CFG is recovered under specific path costs when using an unconstrained control set. We argue this lack of constraint is responsible for CFG's failure at high guidance strengths, since it permits the sampling path to move arbitrarily far from the current image estimate. To fix this, we propose curvature-aware CFG (CACFG), which constrains the control set to a hypersphere informed by the Gaussian regularisation used when training variational autoencoders. We show that the control inputs produced by CFG sampling routinely violate this bound, and that across diffusion models, datasets, and guidance schedules, CACFG achieves superior generative quality at mid-to-high guidance strengths with a less severe quality-diversity tradeoff than regular CFG.
Tags
Links
- Source: https://arxiv.org/abs/2610.05845v1
- Canonical: https://arxiv.org/abs/2610.05845v1
Trouble viewing inline? Open PDF directly →
Full Text
165,280 characters extracted from source content.
Expand or collapse full text
CACFG: Curvature-Aware Classifier-Free Guidance and Optimal Control Max Collins Affiliation: School of Physics, Maths and Computing Affiliation: The University of Western Australia Affiliation: Perth, WA 6009 Email: max.collins@research.uwa.edu.au Dasith de Silva Edirimuni Affiliation: School of Physics, Maths and Computing Affiliation: The University of Western Australia Affiliation: Perth, WA 6009 Email: dasith.desilva@uwa.edu.au Jordan Vice Affiliation: School of Physics, Maths and Computing Affiliation: The University of Western Australia Affiliation: Perth, WA 6009 Email: jordan.vice@uwa.edu.au Tim French Affiliation: School of Physics, Maths and Computing Affiliation: The University of Western Australia Affiliation: Perth, WA 6009 Email: tim.french@uwa.edu.au Ajmal Mian Affiliation: School of Physics, Maths and Computing Affiliation: The University of Western Australia Affiliation: Perth, WA 6009 Email: ajmal.mian@uwa.edu.au Abstract Diffusion models generate samples by learning to reverse a fixed corruption process, and classifier-free guidance (CFG) is the standard mechanism for conditioning this process on a desired class or prompt. CFG can be applied at varying guidance strengths, and while higher strengths improve image quality and conditional alignment, too high a guidance strength can degrade image quality and diversity. Furthermore, CFG violates principled diffusion sampling dynamics, and existing explanations for why it works despite the violation disagree on the underlying theory or do not extend to deterministic samplers used in practice. We address both these issues. We first frame CFG sampling as a continuous-time optimal control problem, treating the sampling trajectory as a sequence of controls chosen to maximise the probability of the desired condition. Solving the resulting Hamilton–Jacobi–Bellman equation shows that CFG is recovered under specific path costs when using an unconstrained control set. We argue this lack of constraint is responsible for CFG’s failure at high guidance strengths, since it permits the sampling path to move arbitrarily far from the current image estimate. To fix this, we propose curvature-aware CFG (CACFG), which constrains the control set to a hypersphere informed by the Gaussian regularisation used when training variational autoencoders. We show that the control inputs produced by CFG sampling routinely violate this bound, and that across diffusion models, datasets, and guidance schedules, CACFG achieves superior generative quality at mid-to-high guidance strengths with a less severe quality-diversity tradeoff than regular CFG. 1 Introduction Diffusion models generate samples by learning to iteratively reverse a fixed process that gradually corrupts data with noise (Ho et al., 2020; Song et al., 2021b). Classifier-free guidance (CFG) (Ho & Salimans, 2022) provides a mechanism to control the content of generated images by using a variable guidance strength parameter to target a tilted conditional distribution. However, this tilted distribution is not the marginal of any true diffusion process, and excessive CFG guidance can reduce image diversity and degrade image quality by introducing visual artefacts (Sadat et al., 2025; Karras et al., 2024). Despite this, CFG is frequently used in practice, and practitioners select the largest guidance strengths that do not harm image quality (Dhariwal & Nichol, 2021; Ho & Salimans, 2022). Previous work has proposed methods of fixing CFG artefacts: CFG++ (Chung et al., 2025) and Interval-CFG (IntCFG) (Kynkänniemi et al., 2024) each attribute CFG’s artefacts to the sampling trajectory departing the image manifold, correcting for this by varying guidance strength across the trajectory. A separate line of work asks why CFG works despite violating diffusion sampling dynamics. Hypotheses attribute its effectiveness to a shared bias in the conditional and unconditional denoisers (Karras et al., 2024), an implicit correction for the poorly-approximated tilted distribution (Moufad et al., 2025), or an equivalence with a predictor-corrector scheme in the continuous-time SDE limit (Bradley & Nakkiran, 2025). However, these explanations disagree on the mechanism responsible, and they do not rigorously extend to commonly used deterministic samplers. We address this gap by reformulating CFG sampling as a continuous-time optimal control problem: rather than fixing the sampling trajectory as a function of stochastic transition kernels, we treat it as a sequence of controls chosen to maximise the terminal reward p(ξ∣0)p(ξ x_0), i.e., how probable it is that the sample is of the desired condition/class ξ. Solving the resulting Hamilton–Jacobi–Bellman (HJB) equation shows that the optimal control recovers CFG when the control set is unconstrained and the traversal penalty is expressed in the same scale as the diffusion training loss. To the best of our knowledge, we are the first to frame CFG as a deterministic optimal control problem in this way. Additionally, existing guidance scheduling methods such as CFG++ and IntCFG also emerge from this same optimal control formulation under alternative choices of the traversal penalty (Appendix B). By examining the path costs of this optimisation problem, we find that the CFG diffusion sampling trajectory is encouraged to: align the conditional and CFG scores at early-to-mid sampling times; converge towards a local maximum at late sampling times; and avoid traversing near a maximum too early. This provides significant insight into how CFG works, and why it exhibits certain pathologies. (a) CFG (b) CACFG Figure 1: Tweedie’s magnitude (∥^0(t,t,ξ)∥2 x_0(t, x_t,ξ) _2) of diffusion sampling trajectories across time with ω=7.5ω=7.5 and using (a) CFG (Ho & Salimans, 2022) and (b) CACFG (ours), alongside a representative sample generated by each method. Note that 40%40\% of CFG sampling paths violate the theoretical 95%95\% upper magnitude bound. CACFG restricts permissible controls to lie within a time-varying bounded control set. Our optimal control formulation shows that traditional CFG imposes no constraint on the control set. This permits the sampling path to move arbitrarily far from the current image estimate given sufficiently low traversal penalty. We argue this is directly responsible for CFG’s failure modes in high-guidance regimes. To address this, we propose a constrained control set and corresponding curvature-aware CFG scheme (CACFG) that relies on a property latent diffusion models have by construction: the training objective of their variational autoencoder (VAE) is explicitly regularised towards an isotropic Gaussian. We hypothesise that this forces most encodings to lie within a hypersphere of an estimable radius, and we show empirically that the Tweedie estimates produced by traditional CFG sampling frequently violate this theoretical upper bound, while those of CACFG do not (Figure 1). We find that across diffusion models, datasets, and guidance schedules, CACFG has superior generative quality at mid-to-high guidance strengths as measured by various quality metrics. Our core contributions are as follows: (i) We show that diffusion guidance can be interpreted as a continuous-time control problem; (i) We show that classifier-free guidance (CFG) is one solution to this control problem, and that existing guidance scheduling methods, such as CFG++ (Chung et al., 2025) and IntCFG (Kynkänniemi et al., 2024), arise from the same framework under alternative choices of the traversal penalty; (i) We propose a method of using the Gaussian regularisation term of the VAE training loss to infer the structure of the embedded image manifold; (iv) We propose a constrained control set for the continuous-time optimisation problem that results in a diffusion guidance (CACFG) that provides superior conditional generation with a less severe quality-diversity tradeoff than unconstrained guidance methods, at negligible additional computational cost. 2 Preliminaries Denoising diffusion models generate data by learning to reverse a fixed diffusion (noising) process. We write t∈ℝm x_t ^m for t∈[0,T]t∈[0,T] to denote the state acted on by this process. The diffusion itself is driven by the stochastic differential equation (SDE) (Ho et al., 2020; Song et al., 2021b), dt=f(t)tdt+g(t)dt,∀t∈[0,T],d x_t=f(t) x_t\,dt+g(t)\,d B_t, ∀\,t∈[0,T], (1) where f(t),g(t):ℝ→ℝf(t),g(t):R are continuous and ⋅dt· d B_t denotes an Itô integral with respect to the m-dimensional Brownian motion process, t B_t. The form of f and g is chosen such that (1) gradually erases structure in 0 x_0 as t→Tt→ T, leaving a state that is approximately isotropic Gaussian at termination, p(T)≈(,σT2I)p( x_T) ( 0, _T^2I). Modern image diffusion models leverage both unconditional and conditional modes, where the initial measure of the state X0X_0 is conditioned on a measurable event ξ of an auxiliary variable Y that takes values in ΩY _Y, i.e. P(0|ξ)P( X_0|ξ). This allows for ξ=ΩYξ= _Y to denote unconditional generation, and ξ≠ΩYξ≠ _Y to describe conditional generation with target ξ. We formally define the above diffusion as the canonical image diffusion in Definition E.1, and in Theorem E.1 we show that it admits the transition kernel p(t∣0)=(αt0,βt2I(m×m))p( x_t x_0)=N ( _t x_0,\ _t^2I^(m× m) ) with αt,βt:ℝ→ℝ _t, _t:R and where I(m×m)I^(m× m) denotes the m-dimensional identity. Generating a sample amounts to reversing (1), which can be done stochastically via Anderson’s reverse-time SDE (Anderson, 1982), or (more commonly) deterministically via the probability-flow ODE (Song et al., 2021b), dt/dt=f(t)t−g(t)2∇tlogp(t∣ξ)/2,d x_t/dt=f(t) x_t-g(t)^2 _ x_t p( x_t ξ)/2, (2) both of which require an estimate of the score, ∇tlogp(t∣ξ) _ x_t p( x_t ξ). This is obtained by training a denoiser ϵθ:ℝm×ℝ×→ℝm ε_θ:R^m×R×Y ^m to recover 0 x_0 from a noised observation using the objective, minθ0∼P(0∣ξ),t∼p(t∣0),t∼p(t)[‖0−^0‖22],^0(t,t,ξ,θ)≜t−βtϵθ(t,t,ξ)αt. _θ\ E_ x_0 P( x_0 ξ),\ x_t p( x_t x_0),\ t p(t) [ x_0- x_0 _2^2 ], x_0(t, x_t,ξ;θ) x_t- _t ε_θ(t, x_t,ξ) _t. (3) For a minimiser θ⋆θ of (3), the score is proportional to the denoiser (see Theorem E.2), ∇tlogp(t∣ξ)=−ϵθ⋆(t,t,ξ)/βt, _ x_t p( x_t ξ)=- ε_θ (t, x_t,ξ)/ _t, (4) so either reverse-process formulation (SDE or ODE) can be run with ϵθ⋆ ε_θ in place of the score. Additionally, by Tweedie’s formula (Efron, 2011) the optimal denoiser’s output is equal to the posterior mean (see Theorem E.3), ^0(t,t,ξ)=(t−βtϵθ⋆(t,t,ξ))/αt=[0∣t,ξ], x_0(t, x_t,ξ)=( x_t- _t ε_θ (t, x_t,ξ))/ _t=E[ X_0 x_t,ξ], (5) and note that we are taking ^0(t,t,ξ)≜^0(t,t,ξ,θ⋆) x_0(t, x_t,ξ) x_0(t, x_t,ξ;θ ) for brevity. Classifier-free guidance (CFG). In many cases the conditional score alone is not sufficient to reconstruct high-quality images of the desired class. Although ϵθ⋆(t,t,ξ) ε_θ (t, x_t,ξ) recovers ∇tlogp(t∣ξ) _ x_t p( x_t ξ) exactly at optimality (Theorem E.2), faithfully sampling p(0∣ξ)p( x_0 ξ) is not the same as adhering strongly to ξ: a specific conditioning event is typically supported by a small number of training samples compared to the entire training dataset. Thus, the model constructs a noisy estimate of P(0∣ξ)P( X_0 ξ), which places significant probability mass over samples weakly consistent with ξ (Dhariwal & Nichol, 2021; Ho & Salimans, 2022). To strengthen class adherence, guidance methods target a tilted distribution in place of p(t∣ξ)p( x_t ξ), p¯(t∣ξ)∝p(ξ∣t)ωp(t),ω∈ℝ>0. p( x_t ξ) p(ξ x_t)^ω\,p( x_t), ω _>0. (6) Increasing ω concentrates probability mass around these maximal-density regions, whilst leaving its maximisers unchanged. Differentiating the log of (6) and substituting (4) at ξ=ΩYξ= _Y gives ∇tlogp¯(t∣ξ) _ x_t p( x_t ξ) =ω∇tlogp(ξ∣t)−ϵθ⋆(t,t,ΩY)/βt =ω _ x_t p(ξ x_t)- ε_θ (t, x_t, _Y)/ _t (7) =−[ϵθ⋆(t,t,ΩY)+ω(ϵθ⋆(t,t,ξ)−ϵθ⋆(t,t,ΩY))]/βt, =- [ ε_θ (t, x_t, _Y)+ω ( ε_θ (t, x_t,ξ)- ε_θ (t, x_t, _Y) ) ]/ _t, (8) where the second line eliminates ∇tlogp(ξ∣t) _ x_t p(ξ x_t) via Bayes’ rule and the score identity in (4). Classifier guidance (Dhariwal & Nichol, 2021) evaluates (7) by training a separate model pθ(ξ∣t)p_θ(ξ x_t); classifier-free guidance (Ho & Salimans, 2022) instead uses (8), interpolating the class-conditional and unconditional noise models defined above. Note that this guidance does not represent a true diffusion process: p¯(t∣ξ) p( x_t ξ) is not the marginal induced by diffusing 0∼P¯(0∣ξ) x_0 P( X_0 ξ), so following this score abandons the reverse-time SDE/flow ODE dynamics of (2) (Karras et al., 2024); however, it empirically improves perceptual sample quality (Dhariwal & Nichol, 2021; Ho & Salimans, 2022). Latent diffusion models. Let ∈ℝn Z ^n be an ℝnR^n-valued random variable representing a natural image in n-dimensional pixel-space, sharing the auxiliary (label) variable Y defined above (and in Definition E.1). As above, for ξ∈ξ we write P(∣ξ)P( Z ξ) for the conditional law, and ∼P(∣ξ) z P( Z ξ) for a realised image. Taking 0≜ X_0 Z (so m=nm=n) equates the diffusion state with the image directly, giving P(0∣ξ)=P(∣ξ)P( X_0 ξ)=P( Z ξ) and recovering ordinary pixel-space diffusion. Latent diffusion models (Rombach et al., 2022) instead diffuse over a compressed representation of z, obtained from a variational autoencoder (VAE) (Kingma & Welling, 2014). The encoder maps a realised image to a distribution of latents, qϕ(0∣)≜(0,ϕ(),diag(ϕ()2))q_φ( x_0 z) ( x_0;\, μ_φ( z),\,diag\! ( σ_φ( z)^2 ) ), and the decoder gives the reconstruction likelihood, pψ(∣0)≜(,ψ(0),diag(ψ(0)2))p_ψ( z x_0) ( z;\, ν_ψ( x_0),\,diag\! ( γ_ψ( x_0)^2 ) ). The density of 0|ξ X_0 ξ can then be obtained via p(0∣ξ)≜∫ℝnqϕ(0∣)P(∣ξ)p( x_0 ξ) _R^nq_φ( x_0 z)\,dP( z ξ). The encoder and decoder are trained jointly, over parameters ϕ,ψφ,ψ respectively, to minimise the negative evidence lower bound ℒVAE(ϕ,ψ)≜∼P()[−qϕ(0∣)[logpψ(∣0)]⏟reconstruction+DKL(qϕ(0∣)∥(,I(m×m)))⏟regularisation],L_VAE(φ,ψ) _ z P( Z) [\, -\,E_q_φ( x_0 z)\! [ p_ψ( z x_0) ]_reconstruction\;+\; D_KL\! (q_φ( x_0 z)\, \|\,N( 0,I^(m× m)) )_regularisation ], (9) following Kingma & Welling (2014), where P()≜P(∣ΩY)P( Z) P( Z _Y) is the unconditional image law. Note that the KL term regularises the encoder distribution towards the same isotropic standard normal that the forward process of (1) itself converges to as t→Tt→ T–a fact we leverage later. 3 Related Work Chung et al. (2025) attributes CFG artefacts such as colour oversaturation and broken invertibility to an off-manifold effect: since ω>1ω>1 extrapolates beyond the conditional and unconditional denoiser outputs, the resulting noise estimate can fall off the data manifold. By reformulating guidance as a manifold-constrained score-matching problem, Chung et al. (2025) appeal to the linear manifold hypothesis (Chung et al., 2022) to compute a manifold constrained gradient to force the sample to remain on the theorised linear image manifold. Alternatively, Interval-CFG (IntCFG) (Kynkänniemi et al., 2024) hypothesises that CFG artefacts can be attributed to when guidance is applied: guidance at high noise levels collapses diversity by prematurely committing the trajectory to a small set of modes, while guidance at low noise levels has minimal effect. Thus, IntCFG disables guidance outside an interval of intermediate noise levels. Though motivated differently, both methods let the guidance scale of (8) vary across the sampling trajectory, a fact we make concrete in Appendix B. Alternatively, techniques such as Adaptive Projected Guidance (APG) (Sadat et al., 2025) reshape the CFG update itself. However, none of this work provides a rigorous explanation as to why CFG is able to generate conditional images, despite violating diffusion sampling dynamics. Karras et al. (2024) attributes CFG’s effectiveness to a shared model bias: a capacity-limited denoiser over-covers sparsely populated regions of the data manifold, and because the unconditional model exhibits this bias more severely than the conditional one, their ratio acts as an attractive force that pulls samples towards the image manifold. Moufad et al. (2025) show that the tilted distribution of (6) can be recovered by augmenting CFG with a corrective Rényi-divergence term, and they argue that CFG is just poorly approximating the true tilted distribution. Bradley & Nakkiran (2025) instead prove that in the continuous-time SDE limit, the stochastic (DDPM) variant (Ho et al., 2020) of CFG is identical to a predictor-corrector scheme that pairs DDIM (Song et al., 2021a) denoising with a Langevin-dynamics corrector on the tilted distribution. However, this does not account for deterministic (flow ODE) variants of CFG, and the explanations of Karras et al. (2024) and Moufad et al. (2025) disagree on the key mechanisms. 4 Reframing CFG as an Optimal Control We first consider the tilted density of (6), and note that raising p(ξ∣t)p(ξ x_t) to any power ω>0ω>0 leaves its maximiser (w.r.t. t x_t) unchanged. Thus, the CFG update of (8) can be viewed as naively moving towards a local maximum of p(ξ∣t)p(ξ x_t) at each timestep; however, this does not guarantee maximisation with respect to the terminal state, 0 x_0. Treating CFG sampling as purely an optimisation problem leads to the natural question: does CFG sampling construct a path that maximises p(ξ∣0)p(ξ x_0) subject to some reasonable path constraints? More concretely, we wish to understand whether CFG constructs trajectories that terminate at a state, 0 x_0, that maximise p(ξ∣0)p(ξ x_0) subject to interpretable path costs that punish/reward movement from the initial position, T x_T. We treat the sequence of denoising targets used along the trajectory as free decisions rather than following a fixed set of transition kernels, and we introduce a time-dependent control variable t∈U(t)⊆ℝm u_t∈ U(t) ^m taking values in a nonempty, closed, and convex time-varying control set U(t)U(t). Additionally, note that maximising p(ξ|0)p(ξ| x_0) w.r.t. 0 x_0 is equivalent to maximising p(0∣ξ)/p(0)p( x_0 ξ)/p( x_0) via Bayes’ rule. Under this framework, diffusion guidance is the solution to max[tl,T]∫tlTL(s,s,s)s+ϕ(tl,tl),˙s=(s,s,s), _ u_[t_l,T] \ _t_l^TL(s, x_s, u_s)\,ds+φ(t_l, x_t_l) \, x_s= b(s, x_s, u_s), (10) with running reward L:ℝ×ℝm×ℝp→ℝL:R×R^m×R^p , dynamics constraint :ℝ×ℝm×ℝp→ℝm b:R×R^m×R^p ^m, and terminal reward ϕ(tl,tl)φ(t_l, x_t_l), where ϕ(s,s)≜log(p(s∣ξ)p(s))∀s∈[tl,T]φ(s, x_s) ( p( x_s ξ)p( x_s) )\ ∀\ s∈[t_l,T]. (10) defines a reverse-time, continuous-time maximisation problem, and we write V^(t,t)≜sup[tl,t]∫tltL(s,s,s)s+ϕ(tl,tl), V(t, x_t) _ u_[t_l,t] \ _t_l^tL(s, x_s, u_s)\,ds+φ(t_l, x_t_l) \, (11) to define the best accumulated reward achievable by time t. Bellman’s principle of optimality (Bellman, 1957) shows that V V must satisfy the reverse-time Hamilton--Jacobi--Bellman (HJB) equation11 1 We state the reverse-time HJB equation in Lemma E.9, and provide a rigorous HJB derivation in Appendix E.2 based on Bellman (1957); Liberzon (2012); Berkovitz & Medhin (2012). V^t(t,t)=supt∈U(t)L(t,t,t)−⟨V^t(t,t),(t,t,t)⟩,∀t∈(tl,T], V_t(t, x_t)= _ u_t∈ U(t) \L(t, x_t, u_t)- V_ x_t(t, x_t),\, b(t, x_t, u_t) \, ∀\,t∈(t_l,T], (12) with boundary condition V^(tl,tl)=ϕ(tl,tl) V(t_l, x_t_l)=φ(t_l, x_t_l). Throughout, we take the termination time tl∈(0,T)t_l∈(0,T), which keeps βs2>0 _s^2>0 (and hence the relevant densities well-defined) over the whole horizon. Additionally, we require that L, V V, and b be regular22 2 See Problem E.5 for full conditions, and note that many are immediately satisfied due to the differentiability of the trained denoiser and Gaussian transition kernels. and C1C^1 differentiable in t, t x_t, and t u_t. We now choose L and b. For the running reward, we penalise the divergence of the control s u_s from the unconditional sample, multiplied by some time-dependent cost scale r(s)>0r(s)>0, alongside an additional, as-yet-unspecified term h capturing further path costs/rewards, L(s,s,s)≜−r(s)‖s−^0(s,s,ΩY)‖22+h(s,s,s).L(s, x_s, u_s) -r(s) u_s- x_0(s, x_s, _Y) _2^2+h(s, x_s, u_s). (13) The choice of ^0(s,s,ΩY) x_0(s, x_s, _Y) as the anchor for the ℓ2 _2 penalty is deliberate: by Tweedie’s formula (5), it is the unconditional posterior mean of s x_s, i.e. the most plausible denoising target available at that noise level. Penalising the ℓ2 _2 deviation of s u_s from this quantity therefore encodes a natural prior: a candidate target should only be preferred over the unconditional estimate if there is sufficient reward for doing so. Framing guidance this way turns the question of why CFG works into a question about h and b: is there a choice of h and b whose optimal control recovers the CFG update of (8)? To connect this to diffusion sampling, we take the dynamics b to be the probability-flow ODE of (2), written in Tweedie form via (4) and (5), with the denoising target replaced by the control u itself, ˙s=(s,s,s)≜f(s)s−g(s)2(αss−s)/(2βs2). x_s= b(s, x_s, u_s) f(s) x_s-g(s)^2 ( _s u_s- x_s )/(2 _s^2). (14) Setting s=^0(s,s,ΩY) u_s= x_0(s, x_s, _Y) at every step recovers ordinary unconditional sampling, while any other choice of control defines an equally valid, but different, flow-ODE trajectory. What remains is to specify h, and here we make a significant assumption: we posit that the value function is equal to the quantity CFG attempts to maximise at each timestep: V^(t,t)≜ϕ(t,t)=log(p(t∣ξ)/p(t)). V(t, x_t) φ(t, x_t)= (p( x_t ξ)/p( x_t) ). (15) We argue that this is a reasonable assertion: CFG is already effective at conditioning the diffusion trajectory–so choosing a value function whose gradients align with the CFG score incentivises movement in that direction, and this assumption immediately satisfies the boundary condition of (12). We now ask what constraints (what h) has ϕφ as its value function under (12). Substituting (14) and (15) into the reverse-time HJB equation (12) and using the Kolmogorov forward equation to derive V^t V_t allows us to solve for a unique h. We show in Theorem E.11 that V^=ϕ V=φ solves (12) for every s∈[tl,T]s∈[t_l,T] when h(s,s)= h(s, x_s)= 12g(s)2⟨∇sϕ(s,s),∇slogp(s∣ξ)⟩⏟conditional score alignment+r(s)‖Υ(s,s)‖22⏟CFG score magnitude 12g(s)^2 _ x_sφ(s, x_s), _ x_s p( x_s ξ) _conditional score alignment+ r(s) (s, x_s) _2^2_CFG score magnitude −12g(s)2αsβs2⟨∇sϕ(s,s),Υ(s,s)⟩⏟CFG score regularisation+12g(s)2Δsϕ(s,s)⏟early-convergence penalty,where - 12 g(s)^2 _s _s^2 _ x_sφ(s, x_s), (s, x_s) _CFG score regularisation+ 12g(s)^2 _ x_sφ(s, x_s)_early-convergence penalty, (16) Υ(s,s)≜ (s, x_s) projU(s)−^0(s,s,ΩY)14g(s)2αsr(s)βs2∇sϕ(s,s). _U(s)- x_0(s, x_s, _Y) \ 14 g(s)^2 _sr(s) _s^2 _ x_sφ(s, x_s) \. (17) The corresponding optimal control is then given by t⋆≜^0(t,t,ΩY)+Υ(t,t). u_t x_0(t, x_t, _Y)+ (t, x_t). (18) CFG-like guidance can then be recovered by reversing Tweedie’s formula (5), and using (4) to solve for the score imposed by the optimal control: ∇tlogp¯(t∣ξ)=−t−αtt⋆βt2=−1βt[ϵθ⋆(t,t,ΩY)−αtβtΥ]. _ x_t p( x_t ξ)=- x_t- _t u_t _t^2=- 1 _t [ ε_θ (t, x_t, _Y)- _t _t ]. (19) Traditional CFG, scheduled variants, and Kingma’s SNR. CFG and other scheduled guidance variants with a positive guidance-weight function ω(t)>0ω(t)>0 can be recovered by setting r(t)=g(t)2αt2βt4⋅14ω(t),U(t)=ℝm∀t∈(0,T],r(t)= g(t)^2 _t^2 _t^4· 14ω(t), U(t)=R^m\ ∀\ t∈(0,T], (20) and substituting (17) and (20) into (19). Traditional CFG (Ho & Salimans, 2022) follows when ω(t)=w>0ω(t)=w>0, and we cover CFG++ (Chung et al., 2025) and IntCFG (Kynkänniemi et al., 2024) in Appendix B. Note that for CFG, CFG++, and IntCFG, the r(t)r(t) of (20) is proportional to −dSNR(t)/dt=g(t)2αt2/βt4-d\,SNR(t)/dt=g(t)^2 _t^2/ _t^4, with SNR(t)≜αt2/βt2SNR(t) _t^2/ _t^2. Let λt≜logSNR(t) _t (t) (Kingma’s log-SNR), then Kingma & Gao (2023) show −dλt/dt-d _t/dt is the weighting that converts the uniform noise-matching ELBO objective into an equivalent image-matching objective, and ∥ϵ−ϵ^∥22=SNR(t)∥0−^0∥22 ε- ε _2^2=SNR(t) x_0- x_0 _2^2. Thus, minimising ∥0−^0∥22E x_0- x_0 _2^2 weighted by g(t)2αt2/βt4g(t)^2 _t^2/ _t^4 is the same training objective as the (unweighted) noise-prediction ELBO. In other words, CFG, CFG++, and IntCFG are optimal controls with an ℓ2 _2 penalty that is specified with the same scale as the denoising training objective. We now ask: what do the constraints of (16) imply about the paths constructed by CFG-like guidance? The conditional score alignment term in (16) rewards paths that align the conditional and CFG scores, which is reasonable, given we seek trajectories that converge to high-density conditional regions. This term is scaled by g(s)2g(s)^2, which decreases as s→0s→ 0 under most diffusion parameterisations (Karras et al., 2022), suggesting that the conditional alignment matters most in early-to-mid sampling times. The CFG score projection, Υ , can be thought of as the maximum allowable CFG movement given the current Tweedie estimate, ^0(s,s,ΩY) x_0(s, x_s, _Y), at time s. Assuming that ^0∈U(s) x_0∈ U(s) (the control set should contain all Tweedie estimates), then Υ is either 0 or aligned with the CFG score, ∇sϕ _ x_sφ, in the sense that ⟨∇sϕ(s,s),Υ(s,s)⟩≥0 _ x_sφ(s, x_s), (s, x_s) ≥ 0 (by Bertsekas, 2009, Prop. 1.1.9), and thus, the CFG score regularisation term is ≤0≤ 0. This term is negligible at early sampling times, αs→0 _s→ 0 as s→Ts→ T, but grows as βs→0 _s→ 0 as s→0s→ 0, and the only way to avoid this penalty is to find a local optimum (∇ϕ=0∇φ=0) or enter a region that no longer has viable movement in the direction of the CFG score, Υ=0 =0. Thus, we can view this term as a penalty for not finding a local maximum, or not maximising allowable growth of ϕφ. The CFG score magnitude term blindly rewards large CFG score magnitudes regardless of sign; however, this is entirely negated by the ℓ2 _2 penalty of (13) at the optimal control, t⋆ u _t. The early-convergence penalty term is negative at a mode of ϕφ (Δsϕ<0 _ x_sφ<0) and is scaled by g(s)2g(s)^2 (which shrinks as s→0s→ 0), so this term penalises trajectories that sit near a sharp maximum at early sampling times, discouraging them from settling into a mode too early (reducing mode collapse). Thus, CFG-like guidance is an optimal control specified in the same loss scale as the denoising training objective, and it finds paths that: (i) are encouraged to align the conditional and CFG scores at early-to-mid sampling times; (i) are encouraged to converge to a local maximum at late sampling times; and (i) are penalised for nearing local maximums at early sampling times. 5 Curvature-Aware CFG (CACFG) Section 4 shows that CFG-style guidance solves an optimal control problem, but says nothing about whether the resulting control is a safe one to take. Compensating for weak class adherence with a large guidance scale ω (or small r(s)r(s)) may move the sampling trajectory into regions with few training samples, and thus, require the model to extrapolate. This is a known failure mode of neural networks–adversarial regions populate extrapolated sections of the learned manifold, and they cause networks to behave erratically (Szegedy et al., 2014; Goodfellow et al., 2015; Madry et al., 2018). Algorithm 1 Curvature-Aware Guidance diffusion model: ϵθ⋆ ε_θ ; target y∈ΩYy∈ _Y; sampling steps with t0=tl≈0<⋯<tn=Tt_0=t_l≈ 0<…<t_n=T; noise schedules αt _t, βt _t; guidance weight schedule ω(t)ω(t); control set U(t)U(t); upper radius rur_u; interpolation parameter γ. tn∼(0,I) x_t_n (0,I) for i=n,…,1i=n,…,1 do ϵΩ←ϵθ⋆(ti,ti,ΩY) ε_ ← ε_θ (t_i, x_t_i, _Y) ϵξ←ϵθ⋆(ti,ti,ξ) ε_ξ← ε_θ (t_i, x_t_i,ξ) ϵ~←ϵΩ+ω(ti)(ϵξ−ϵΩ) ε← ε_ +ω(t_i)( ε_ξ- ε_ ) ^0cfg←(ti−βtiϵ~)/αti x_0^cfg←( x_t_i- _t_i ε)/ _t_i ρi2←(1−γ)αti2αti2+βti2ru2+γru2 _i^2←(1-γ) _t_i^2 _t_i^2+ _t_i^2\,r_u^2+γ\,r_u^2 i⋆←projUγ(ti)(^0cfg) u_i _U_γ(t_i)\! ( x_0^cfg ) ⊳ clip to ∥⋅∥2≤ρi\|·\|_2≤ _i ϵi⋆←(ti−αtii⋆)/βti ε_i ←( x_t_i- _t_i u_i )/ _t_i ti−1←Reverse flow-ode step with ϵi⋆,ti x_t_i-1 flow-ode step with ε_i ,\ x_t_i end for return t0 x_t_0 Existing corrections to CFG address this by assuming the underlying image manifold has some known geometry (Chung et al., 2022; Chung et al., 2025). Such hypotheses are reasonable when 0 x_0 is itself a natural image, but for the latent diffusion models used in practice (Rombach et al., 2022), 0 x_0 is instead a VAE latent code, and the manifold it occupies is whatever geometry that particular VAE has learned. A manifold hypothesis tuned to one model’s VAE carries no guarantee of transferring to another’s. We instead propose a correction built on a property the VAE is trained to have: the regularisation term of the VAE objective in (9) penalises the encoder distribution for departing from an isotropic standard normal, qϕ(0∣)≈(,I(m×m))q_φ( x_0 z) ( 0,I^(m× m)) (Kingma & Welling, 2014). This term rewards encodings that are close to the origin, and we hypothesise that valid encodings become more sparse as distance from the origin increases (Appendix C.2), which means that these regions are likely adversarial from the perspective of the diffusion denoiser. We propose restricting the control set from Section 4 to latents contained within a hypersphere with radius rur_u. That is, we consider a situation where ∥0∥22≤ru2 X_0 _2^2≤ r_u^2, and then by Lemma E.4, the magnitude of Tweedie’s estimate is also upper bounded by rur_u33 3 There exists no measure on the truncated distribution that would permit ∥x^0(t,t,ξ)∥22>ru2 x_0(t, x_t,ξ) _2^2>r_u^2.: ‖^0(t,t,ξ)‖22≤ru2 x_0(t, x_t,ξ) _2^2≤ r_u^2. This limits the ability of large control inputs to direct the sample into these hypothesised adversarial regions. Unfortunately, restricting the generative domain in this way would require knowledge of the learned VAE latent space. To circumvent this we again leverage the Gaussian regularisation of the VAE loss and assume 0∼(,I(m×m)) X_0 ( 0,I^(m× m)), under which ∥0∥22 X_0 _2^2 follows a chi-squared distribution with m degrees of freedom. We then define a confidence level p and a corresponding radius rur_u such that: P(∥0∥22≤ru2)=p.P\! ( X_0 _2^2≤ r_u^2 )=p. (21) Empirically, we find that the Tweedie estimates (i.e. the unclipped control input) of standard CFG sampling routinely violate the 95.0%95.0\% bound imposed by this assumption (Figure 1). Furthermore, under 0∼(,I(m×m)) X_0 ( 0,I^(m× m)) and the transition kernel of Theorem E.1, 0 X_0 and t x_t are jointly Gaussian, so the Tweedie estimate ^0(t,t,ξ) x_0(t, x_t,ξ) is itself Gaussian, and thus, P(‖^0(t,t,ξ)‖22≤αt2αt2+βt2ru2)=p∀t∈[tl,T].P\! ( x_0(t, x_t,ξ) _2^2≤ _t^2 _t^2+ _t^2\,r_u^2 )=p ∀\ t∈[t_l,T]. (22) That is, for t>0t>0 the Tweedie estimate is expected to lie closer to the origin than the raw bound rur_u. A curvature-aware control set. The two bounds above represent the two extremes of the Gaussian hypothesis: (21) assumes only the raw radius rur_u, while (22) assumes the hypothesis holds exactly. We interpolate between the two with a single tuneable parameter γ∈[0,1]γ∈[0,1], and take the interpolated radius to define a time-varying convex control set within the optimal control framework of Section 4, Uγ(t)≜t∈ℝm:∥t∥22≤αt2αt2+βt2ru2+γ(ru2−αt2αt2+βt2ru2)∀t∈[tl,T].U_γ(t) \ u_t ^m: u_t _2^2≤ _t^2 _t^2+ _t^2\,r_u^2+γ (r_u^2- _t^2 _t^2+ _t^2\,r_u^2 ) \ ∀\ t∈[t_l,T]. (23) At γ=0γ=0 we assume the full Gaussian hypothesis, while γ=1γ=1 requires only the upper bound to hold. We substitute Uγ(t)U_γ(t) into (20), and refer to this guidance scheme as curvature-aware CFG (CACFG). 6 CACFG Experiments Diffusion models. We evaluate CACFG using two latent diffusion models of varying sizes: Stable Diffusion 1.5 (SD1.5) (Rombach et al., 2022) and Stable Diffusion XL (SDXL) (Podell et al., 2024). Both are text-conditioned latent diffusion models that run the diffusion of (1) on a VAE latent space trained using the same objective of (9). SD1.5 and SDXL have differing generative resolutions of 512×512 and 1024×1024, which have substantially different compute costs. Thus, for SD1.5 experiments we generate 10,000 samples for each guidance-dataset-strength setting, while for SDXL we generate 2,000. We run both models on a NVIDIA RTX4090, and the curvature-aware projection does not incur substantive compute overhead–all models run at their originally reported speeds. Datasets. We generate images conditioned on two datasets: ImageNet (Russakovsky et al., 2015), which provides class-conditional generation across 1000 object categories, and COCO (Lin et al., 2014), which provides caption-conditioned generation–a more sophisticated generative task. Guidance schedules. We compare three guidance-weight schedules ω(t)ω(t): the constant-weight CFG of (8) (Ho & Salimans, 2022), and the two scheduled alternatives CFG++ (Chung et al., 2025) and IntCFG (Kynkänniemi et al., 2024), whose exact forms are given in Appendix B. Each schedule is evaluated both on its own and combined with the curvature-aware control set of (23), giving the CACFG, CACFG++, and IntCACFG guidance schemes respectively. Across all curvature-aware variants we fix the confidence level of (21) at p=0.95p=0.95, which corresponds to ru=129.16r_u=129.16 and ru=257.16r_u=257.16 for SD1.5 and SDXL, respectively. Based on initial ablations (Appendix C.3), we use the blending parameter γ=0.5γ=0.5 and γ=1.0γ=1.0 for SD1.5 and SDXL, respectively. Additionally, we use the DDIM ODE solver (Song et al., 2021a) for SD1.5 and SDXL, as it is the most common deterministic solver. Guidance weights. We report the guidance weight of CFG and compute an approximate equivalent weight under each other schedule. That is, we find schedule parameters, θ, such that ∫0TωCFGt=∫0Tω(t,θ)t _0^T _CFGdt= _0^Tω(t;θ)dt. This compares schedules with equal approximate total path perturbations. For SD1.5 we use CFG weights ωCFG=5,7.5,10,15 _CFG=5,7.5,10,15, and for SDXL we use ωCFG=10,15,20,25 _CFG=10,15,20,25. This discrepancy arises because SDXL is significantly more resistant to excessive CFG guidance, making comparisons at lower guidance strengths less meaningful. Metrics. We report nine metrics measuring image quality across varying axes. Fréchet Inception Distance (FID) (Heusel et al., 2018) measures the similarity of real and generated image distributions. Density and Coverage (Naeem et al., 2020) report the fidelity and diversity of the generated images by comparing manifolds fitted to real and generated images. NIQE (Mittal et al., 2013), BRISQUE (Mittal et al., 2012), and TReS (Golestaneh et al., 2022) are no-reference perceptual quality metrics, scoring an image’s naturalness based on its pixel statistics. CLIP score (Radford et al., 2021) measures prompt alignment via the cosine similarity between a generated image’s CLIP embedding and its conditioning. Human Preference Score v2 (HPSv2) (Wu et al., 2023) is a model trained to mimic human rankings of image quality. We note that HPSv2 and CLIP score are known to artificially improve at large CFG strengths despite poorer image quality and increasing saturation (Xie et al., 2026). We therefore additionally report Saturation (Sadat et al., 2025), computed as the mean of the saturation channel after converting each image from RGB to HSV, to measure this effect. 6.1 Results Distribution quality and diversity. When using SD1.5 we find FID, Density, and Coverage are improved or equivalent under the curvature-aware (CA) correction for all three guidance schedules and both datasets, with the gap widening substantially at higher guidance strengths (Figures 2 and 6). Since Density and Coverage improve alongside FID rather than trading off against it, the corrected samples are more accurately contained within the real-image manifold and also cover a wider region of it, indicating an improvement in both quality and diversity. Figure 2: Performance of CFG, CFG++, and IntCFG with (solid line) and without (dotted line) our curvature-aware correction using SD1.5 on COCO. Some metric axes have been flipped so that the improvement direction is vertically up the page. Zoom in for easier viewing. The same pattern holds for SDXL (Figure 7); however, Density and Coverage also depend on guidance strength in a way they do not for SD1.5. At the lowest guidance strength tested, we find both Density and Coverage are marginally degraded by the CA correction, before favouring the correction from moderate guidance strengths onward, alongside a FID advantage that similarly grows across the same range. We hypothesise two explanations for this phenomenon. First, SDXL is a higher-capacity model and is more robust to the manifold departures, thus, the CA control set has less to correct at low guidance, and its benefit only becomes apparent once uncorrected guidance has sufficiently corrupted the sampling trajectory. Second, at low guidance strengths the more restrictive control constraint, Uγ(t)U_γ(t), limits the sampler’s ability to search the latent space, a cost that is outweighed once the guidance strength (effective search budget) is high enough. Thus, across both SD1.5 and SDXL, the CA correction provides superior conditional generation at moderate-to-high guidance strengths, with a less severe quality-diversity tradeoff than that exhibited by unconstrained guidance methods. These findings are supported qualitatively by the samples in Figure 3 and Appendix D.2. CFG CACFG Figure 3: Comparison of CFG (Ho & Salimans, 2022) and CACFG (ours) at guidance strength ω=15ω=15 on the COCO (Lin et al., 2014) dataset. CACFG better preserves fine detail: the middle image has a correctly numbered clock face, while the rightmost image reconstructs Van Gogh’s The Starry Night. Perceptual quality. NIQE, BRISQUE, and TReS all favour the curvature-aware variants at every guidance strength for both SD1.5 and SDXL, with the largest gains at high guidance. As these are no-reference measures of image pixel statistics, this indicates that curvature-aware guidance produces images with more natural low-level statistics, independently of any comparison to the real data distribution, and that this benefit is consistent across model scale, guidance schedule, and diffusion model. Prompt alignment. CLIP score improves only marginally under ImageNet but more substantially under COCO, for both SD1.5 and SDXL. We hypothesise that ImageNet’s single-object class prompts are simple enough that standard guidance can satisfy them at these guidance strengths, leaving no room for the CA correction to help, whereas COCO’s complex caption prompts are harder to satisfy: by keeping the sampling trajectory closer to the latent image manifold, curvature-aware guidance allows higher guidance strengths to be spent productively toward matching the full caption, rather than being wasted on manifold-departing artefacts. Human-preference metrics and saturation. HPSv2 is the one metric where the curvature-aware variants are outperformed by their uncorrected counterparts, an effect that is mild for SD1.5 but more pronounced for SDXL. However, the Saturation values of both Figures 6 and 7 show that this coincides with increasing saturation levels, while curvature-aware guidance keeps saturation roughly constant. Given that Xie et al. (2026) have shown HPSv2 and CLIP scores artificially increase alongside saturation, and that every other image-quality metric favours the curvature-aware correction for both models, we interpret the higher HPSv2 of uncorrected guidance as an instance of this failure mode rather than a quality advantage. 7 Conclusion We show via the HJB equation that CFG and other guidance schedules can be derived as the optimal control for a continuous-time optimisation problem. Existing CFG corrections assume the underlying image manifold has some known geometry, but this is not guaranteed for latent diffusion models, whose latent image manifold is governed by what the VAE has learned. We use the Gaussian regularisation term of the VAE loss to infer that most image encodings lie within a hypersphere of estimable radius. We then propose a curvature-aware CFG correction that constrains the control set of our optimisation problem to a time-varying hypersphere whose radius is informed by the estimated radius. We find that at high guidance scales this generates images with substantially better quality, as measured by FID, NIQE, BRISQUE, TReS, Density, and Coverage. Thus, our constrained guidance provides superior conditional generation with a less severe quality-diversity tradeoff than that exhibited by unconstrained guidance methods, and functionally no additional compute cost. Acknowledgments Max Collins is the recipient of the Research Training Program scholarship funded by the Australian Government. This research was partially supported by National Intelligence and Security Discovery Research Grants (project number NS220100007), funded by the Department of Defence, Australia. References Anderson (1982) Brian D. O. Anderson. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313–326, 1982. Bellman (1957) Richard Bellman. Dynamic programming. Princeton University Press, Princeton, NJ, 1957. Berkovitz & Medhin (2012) Leonard D. Berkovitz and Negash G. Medhin. Nonlinear Optimal Control Theory. Chapman and Hall/CRC, Boca Raton, FL, 2012. ISBN 978-1-4665-6026-0. Bertsekas (2009) Dimitri P. Bertsekas. Convex Optimization Theory. Athena Scientific, 2009. Bradley & Nakkiran (2025) Arwen Bradley and Preetum Nakkiran. Classifier-free guidance is a predictor-corrector. Trans. Mach. Learn. Res., 2025, 2025. Chung et al. (2022) Hyungjin Chung, Byeongsu Sim, Dohoon Ryu, and Jong Chul Ye. Improving diffusion models for inverse problems using manifold constraints. In Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems 35, NeurIPS, 2022. Chung et al. (2024) Hyungjin Chung, Suhyeon Lee, and Jong Chul Ye. Decomposed diffusion sampler for accelerating large-scale inverse problems. In 12th International Conference on Learning Representations, ICLR, 2024. Chung et al. (2025) Hyungjin Chung, Jeongsol Kim, Geon Yeong Park, Hyelin Nam, and Jong Chul Ye. CFG++: manifold-constrained classifier free guidance for diffusion models. In 13th International Conference on Learning Representations, ICLR, 2025. Collins et al. (2026) Max Collins, Jordan Vice, Tim French, and Ajmal Mian. NatADiff: adversarial boundary guidance for natural adversarial diffusion. In 14th International Conference on Learning Representations, ICLR, 2026. Cybenko (1989) G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, 1989. Dhariwal & Nichol (2021) Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat gans on image synthesis. In Advances in Neural Information Processing Systems 34, NeurIPS, 2021. Efron (2011) Bradley Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011. ISSN 01621459. Golestaneh et al. (2022) S. Alireza Golestaneh, Saba Dadsetan, and Kris M. Kitani. No-reference image quality assessment via transformers, relative ranking, and self-consistency. In IEEE/CVF Winter Conference on Applications of Computer Vision, WACV, p. 3989–3999. IEEE, 2022. Goodfellow et al. (2015) Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR, 2015. Heusel et al. (2018) Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local nash equilibrium, 2018. Ho & Salimans (2022) Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022. Ho et al. (2020) Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems 33, NeurIPS, 2020. Hornik (1991) Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural Netw., 4(2):251–257, 1991. Hyvärinen (2005) Aapo Hyvärinen. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6:695–709, 2005. Karras et al. (2022) Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. In Advances in Neural Information Processing Systems 35, NeurIPS, 2022. Karras et al. (2024) Tero Karras, Miika Aittala, Tuomas Kynkänniemi, Jaakko Lehtinen, Timo Aila, and Samuli Laine. Guiding a diffusion model with a bad version of itself. In Advances in Neural Information Processing Systems 37, NeurIPS, 2024. Kingma & Gao (2023) Diederik P. Kingma and Ruiqi Gao. Understanding diffusion objectives as the ELBO with simple data augmentation. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36, NeurIPS, 2023. Kingma & Welling (2014) Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR, 2014. Kynkänniemi et al. (2024) Tuomas Kynkänniemi, Miika Aittala, Tero Karras, Samuli Laine, Timo Aila, and Jaakko Lehtinen. Applying guidance in a limited interval improves sample and distribution quality in diffusion models. In Amir Globersons, Lester Mackey, Danielle Belgrave, Angela Fan, Ulrich Paquet, Jakub M. Tomczak, and Cheng Zhang (eds.), Advances in Neural Information Processing Systems 37, NeurIPS, 2024. Liberzon (2012) Daniel Liberzon. Calculus of Variations and Optimal Control Theory: A Concise Introduction. Princeton University Press, Princeton, NJ, 2012. ISBN 978-0-691-15187-8. Lin et al. (2014) Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. In David J. Fleet, Tomás Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), European Conference on Computer Vision, ECCV, volume 8693 of Lecture Notes in Computer Science, p. 740–755, 2014. Madry et al. (2018) Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In 6th International Conference on Learning Representations, ICLR, 2018. Mittal et al. (2012) Anish Mittal, Anush Krishna Moorthy, and Alan Conrad Bovik. No-reference image quality assessment in the spatial domain. IEEE Trans. Image Process., 21(12):4695–4708, 2012. Mittal et al. (2013) Anish Mittal, Rajiv Soundararajan, and Alan C. Bovik. Making a "completely blind" image quality analyzer. IEEE Signal Process. Lett., 20(3):209–212, 2013. Moufad et al. (2025) Badr Moufad, Yazid Janati, Alain Durmus, Ahmed Ghorbel, Eric Moulines, and Jimmy Olsson. Conditional diffusion models with classifier-free Gibbs-like guidance, 2025. Naeem et al. (2020) Muhammad Ferjad Naeem, Seong Joon Oh, Youngjung Uh, Yunjey Choi, and Jaejun Yoo. Reliable fidelity and diversity metrics for generative models. In Proceedings of the 37th International Conference on Machine Learning, ICML, Proceedings of Machine Learning Research. PMLR, 2020. Podell et al. (2024) Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, and Robin Rombach. SDXL: Improving latent diffusion models for high-resolution image synthesis. In 12th International Conference on Learning Representations, ICLR, 2024. Radford et al. (2021) Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML, volume 139 of Proceedings of Machine Learning Research, p. 8748–8763. PMLR, 2021. Rombach et al. (2022) Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR. IEEE/CVF, 2022. Russakovsky et al. (2015) Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet large scale visual recognition challenge. Int. J. Comput. Vis., 115(3):211–252, 2015. Sadat et al. (2025) Seyedmorteza Sadat, Otmar Hilliges, and Romann M. Weber. Eliminating oversaturation and artifacts of high guidance scales in diffusion models. In 13th International Conference on Learning Representations, ICLR, 2025. Song et al. (2021a) Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In 9th International Conference on Learning Representations, ICLR, 2021a. Song et al. (2021b) Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In 9th International Conference on Learning Representations, ICLR, 2021b. Szegedy et al. (2014) Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In 2nd International Conference on Learning Representations, ICLR, 2014. Vincent (2011) Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 23:1661–1674, 2011. Wu et al. (2023) Xiaoshi Wu, Yiming Hao, Keqiang Sun, Yixiong Chen, Feng Zhu, Rui Zhao, and Hongsheng Li. Human preference score v2: A solid benchmark for evaluating human preferences of text-to-image synthesis. arXiv preprint arXiv:2306.09341, 2023. Xie et al. (2026) Dian Xie, Shitong Shao, Lichen Bai, Zikai Zhou, Bojun Cheng, Shuo Yang, Jun Wu, and Zeke Xie. Guidance matters: Rethinking the evaluation pitfall for text-to-image generation. In 14th International Conference on Learning Representations, ICLR, 2026. Appendix Appendix A Statements A.1 Limitations We note three limitations of our work, each of which we view as a promising direction for future work rather than a fundamental shortcoming of the proposed optimal control framework. First, the control set Uγ(t)U_γ(t) we optimise over is time-varying but not state-varying; extending it to depend jointly on sampling time and the current state t x_t would more directly incentivise training a model to perform the image-manifold projection. Second, our optimal control perspective does not currently explain guidance techniques such as APG (Sadat et al., 2025), which act by manipulating the guidance gradient itself, rather than by reweighting it through the guidance schedule. Finally, our formulation is posed for deterministic sampling processes, and does not immediately extend to stochastic samplers. However, these extensions are unnecessary for understanding and improving traditional classifier-free guidance on deterministic samplers, which was the primary objective of this work. A.2 Reproducibility We ensure reproducibility by providing a detailed description of our algorithm in the main text (Algorithm 1). Additionally, our code and the configuration files necessary to replicate our experiments are made publicly available. Comparison methods are implemented using default parameters or with parameters selected based on the respective authors’ tuning algorithms. A.3 AI use We used large language models as a writing and verification aid during the preparation of this paper. Specifically, AI assistance was used to check and typeset proofs that we had already derived by hand, to edit and improve the clarity of rough prose drafts, and to assist with LaTeX formatting of figures. AI assistance was not used to write experiment code, nor to generate the ideas, methods, or theoretical contributions presented in this work; all such content originates from the authors. Appendix B Comparison Methods CFG Form Both CFG++ (Chung et al., 2025) and Interval-CFG (IntCFG) (Kynkänniemi et al., 2024) propose guidance scheduling schemes to modulate the strength of CFG-like guidance across diffusion sampling paths. Similarly to Section 4, we let the guidance scale of (8) vary with time, ω(t)ω(t). We consider a discretisation 0=t0<t1<⋯<tk=T0=t_0<t_1<…<t_k=T of the canonical image diffusion of Definition E.1, with sampling proceeding from tkt_k down to t0t_0, i.e. each step moves ti x_t_i to the less-noisy ti−1 x_t_i-1. The guidance schedules of CFG++ and IntCFG are as follows. CFG++. Chung et al. (2025) use a manifold-constrained gradient to force the diffusion sampling trajectory to remain on the theorised linear image manifold (Chung et al., 2022; Chung et al., 2024). Under common diffusion scheduling schemes this culminates in a time-varying CFG guidance strength, ω(t)ω(t). Given the discretisation above and using a DDIM diffusion schedule, Chung et al.’s CFG++ guidance scale is given by ω(ti)=w⋅αti−1βtiαti−1βti−αtiβti−1,ω(t_i)=w· _t_i-1 _t_i _t_i-1 _t_i- _t_i _t_i-1, (24) where w>0w>0 is a hyperparameter that governs the strength of the CFG++ guidance. Using Euler derivative approximations: α˙ti≈αti−αti−1Δt⟹αti−1≈αti−Δt⋅α˙ti α_t_i≈ _t_i- _t_i-1 t _t_i-1≈ _t_i- t· α_t_i and β˙ti≈βti−βti−1Δt⟹βti−1≈βti−Δt⋅β˙ti β_t_i≈ _t_i- _t_i-1 t _t_i-1≈ _t_i- t· β_t_i, then (24) can be written as ω(t)≈w⋅[1Δt⋅αtβtαtβ˙t−α˙tβt−α˙tβtαtβ˙t−α˙tβt],ω(t)≈ w· [ 1 t· _t _t _t β_t- α_t _t- α_t _t _t β_t- α_t _t ], (25) where Δt t functions as a parameter describing how coarse the diffusion discretisation is. Notably, from (25), it is clear that ω(t)ω(t) diverges as Δt→0 t→ 0. This suggests that CFG++ is sensitive to the number of sampling steps, with an exploding guidance scale as the granularity of the ODE solver increases. Interval CFG (IntCFG). Kynkänniemi et al. (2024) hypothesise that guidance at high noise levels reduces sample diversity, and is redundant at low noise levels, where the trajectory has already converged onto the correct mode. Thus, IntCFG confines guidance to an interval of intermediate noise levels. In our notation this is the piecewise-constant schedule ω(t)=w,βtαt∈(σlo,σhi],1,otherwise,ω(t)= casesw,& _t _t∈( _lo, _hi],\\ 1,&otherwise, cases (26) for hyperparameters 0<σlo<σhi0< _lo< _hi and guidance weight w>1w>1, selected by grid search against a downstream metric (e.g. FID) rather than derived. Note that technically IntCFG results in a discontinuous ω(t)ω(t) scale, which conflicts with HJB assumptions made in Section 4. To circumvent this, a smooth sigmoid transition could be used at each cutoff point σlo _lo and σhi _hi to ensure continuity. However, in this paper we use the standard IntCFG proposed by Kynkänniemi et al. (2024) and specified in (26). Appendix C Ablations C.1 SD1.5 theoretical Tweedie upper bound Figure 4 extends Figure 1 to the full range of guidance strengths tested in the main paper, showing Tweedie’s magnitude (∥^0(t,t,ξ)∥2 x_0(t, x_t,ξ) _2) of SD1.5 CFG and CACFG sampling trajectories across ω∈5,7.5,10,15ω∈\5,7.5,10,15\ on (a) ImageNet (Russakovsky et al., 2015) and (b) COCO (Lin et al., 2014). Notably, it highlights that increasing guidance strength dramatically increases the number of paths that violate the theoretical 95%95\% upper limit, ru=129.16r_u=129.16. ω=5ω=5 ω=7.5ω=7.5 ω=10ω=10 ω=15ω=15 CFG CACFG (a) ImageNet ω=5ω=5 ω=7.5ω=7.5 ω=10ω=10 ω=15ω=15 CFG CACFG (b) COCO Figure 4: Tweedie’s magnitude (∥^0(t,t,ξ)∥2 x_0(t, x_t,ξ) _2) of SD1.5 CFG and CACFG (ours) sampling trajectories at guidance strengths ω∈5,7.5,10,15ω∈\5,7.5,10,15\ on (a) ImageNet (Russakovsky et al., 2015) and (b) COCO (Lin et al., 2014). Red paths violate the theoretical 95%95\% upper magnitude bound ru=129.16r_u=129.16 (black dashed line); the violating fraction is annotated in each panel. The proportion of violating paths grows sharply with guidance strength for CFG, and this growth is suppressed by our curvature-aware correction, with its time-varying upper bound (red dashed line). We recommend zooming in for easier viewing. C.2 True VAE latent distribution Figure 5 shows the empirical distribution of SD1.5 VAE encodings (∥0∥2 x_0 _2) of the ImageNet validation set, alongside the theoretical chi density implied by the isotropic Gaussian hypothesis proposed in Section 5. The two do not agree because the VAE is trained with a regularisation term that encourages encodings towards the theoretical density, but does not enforce their adherence. In practice we find that the high-dimensional theoretical density appears as a narrow spike, whereas the true distribution of encodings is visibly broader and right-skewed, with a tail extending up to an empirical maximum of 211.19211.19. Despite this, ru=129.16r_u=129.16 falls just past the mode of the empirical distribution, where the bulk of the density has already accumulated, so the bound continues to capture a large proportion of real encodings even though the theoretical density does not capture the distribution’s true shape. Figure 5: Empirical distribution of SD1.5 VAE encodings (∥0∥2 x_0 _2) of the ImageNet validation set, i.e. the distribution of ∥0∥2 x_0 _2. Red line denotes the theoretical chi density implied by the Gaussian hypothesis in Section 5. To test whether this mismatch matters in practice, we compare CACFG against CACFG*, an otherwise identical scheme that instead sets ru=211.19r_u=211.19, i.e. the maximum SD1.5 VAE encoding magnitude observed on the ImageNet validation set. From Table 1 we see that CACFG* is worse than CACFG on BRISQUE, TReS, and Saturation at every guidance strength tested. FID, NIQE, Density, and Coverage follow the same pattern from strength 7.57.5 onward. CLIP favours CACFG* at strengths 5 and 7.5, ties at strength 10, and favours CACFG at 15. HPSv2 favours CACFG* across all guidance strengths. However, as we discuss in the main paper, Xie et al. (2026) tie HPSv2 to oversaturation, and CACFG*’s saturation exceeds CACFG’s throughout, and all other metrics favour CACFG at high guidance strengths. Thus, we interpret the higher HPSv2 of CACFG* as an instance of the saturation-induced failure mode rather than a quality advantage. We hypothesise that CACFG outperforms CACFG* because the tighter, theoretically-derived radius encloses a denser region of the encoding manifold: Figure 5 shows valid encodings are more sparse with distance from the origin, so the smaller radius keeps sampling trajectories within the well-populated region the denoiser was trained on, rather than permitting convergence to low-confidence regions (Szegedy et al., 2014; Goodfellow et al., 2015; Madry et al., 2018). Table 1: Image quality for SD1.5 samples generated for ImageNet using CFG (Ho & Salimans, 2022) and CACFG with varying upper bound limits, rur_u. CACFG denotes the ru=129.16r_u=129.16 bound used in the main paper, while CACFG* is the ru=211.19r_u=211.19 bound derived from the maximum SD1.5 VAE encoding of the ImageNet validation dataset. The best result for each dataset and guidance strength is bold. Strength Guidance FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ 5 CFG 13.67 [rgb]0,0.88,013.67 4.064.06 14.9814.98 83.2483.24 24.85124.851 25.07625.076 1.128 [rgb]0,0.88,01.128 0.4530.453 0.2990.299 CACFG 13.7013.70 4.05 [rgb]0,0.88,04.05 14.83 [rgb]0,0.88,014.83 83.47 [rgb]0,0.88,083.47 24.84924.849 25.07025.070 1.1241.124 0.454 [rgb]0,0.88,00.454 0.295 [rgb]0,0.88,00.295 CACFG* 13.67 [rgb]0,0.88,013.67 4.05 [rgb]0,0.88,04.05 14.9814.98 83.2783.27 24.856 [rgb]0,0.88,024.856 25.081 [rgb]0,0.88,025.081 1.1231.123 0.454 [rgb]0,0.88,00.454 0.2990.299 7.5 CFG 15.1215.12 4.274.27 15.4715.47 82.8082.80 25.251 [rgb]0,0.88,025.251 25.68025.680 1.1391.139 0.4430.443 0.3380.338 CACFG 14.97 [rgb]0,0.88,014.97 4.22 [rgb]0,0.88,04.22 14.59 [rgb]0,0.88,014.59 83.80 [rgb]0,0.88,083.80 25.24325.243 25.65325.653 1.140 [rgb]0,0.88,01.140 0.445 [rgb]0,0.88,00.445 0.316 [rgb]0,0.88,00.316 CACFG* 15.1115.11 4.274.27 15.3315.33 82.8582.85 25.24925.249 25.687 [rgb]0,0.88,025.687 1.1321.132 0.4440.444 0.3370.337 10 CFG 16.2216.22 4.444.44 17.1317.13 81.4181.41 25.39125.391 25.96725.967 1.0841.084 0.4240.424 0.3710.371 CACFG 15.73 [rgb]0,0.88,015.73 4.32 [rgb]0,0.88,04.32 14.66 [rgb]0,0.88,014.66 84.10 [rgb]0,0.88,084.10 25.395 [rgb]0,0.88,025.395 25.93325.933 1.119 [rgb]0,0.88,01.119 0.433 [rgb]0,0.88,00.433 0.321 [rgb]0,0.88,00.321 CACFG* 16.1616.16 4.404.40 16.5716.57 81.7981.79 25.395 [rgb]0,0.88,025.395 25.979 [rgb]0,0.88,025.979 1.0941.094 0.4260.426 0.3650.365 15 CFG 17.7817.78 4.754.75 21.9521.95 78.1478.14 25.49125.491 26.21426.214 0.9940.994 0.3910.391 0.4240.424 CACFG 16.52 [rgb]0,0.88,016.52 4.42 [rgb]0,0.88,04.42 14.80 [rgb]0,0.88,014.80 84.60 [rgb]0,0.88,084.60 25.540 [rgb]0,0.88,025.540 26.17526.175 1.063 [rgb]0,0.88,01.063 0.413 [rgb]0,0.88,00.413 0.317 [rgb]0,0.88,00.317 CACFG* 17.5517.55 4.574.57 19.0619.06 80.0280.02 25.50525.505 26.264 [rgb]0,0.88,026.264 1.0231.023 0.4000.400 0.3970.397 C.3 Curvature-aware upper bound blending parameter The blending parameter γ interpolates between the two extremes of the Gaussian hypothesis underlying Uγ(t)U_γ(t): at γ=0γ=0 the control set assumes the hypothesis holds exactly, while at γ=1γ=1 it retains only the raw upper bound rur_u (23). We sweep γ∈0.0,0.1,…,1.0γ∈\0.0,0.1,…,1.0\ for CACFG on ImageNet, for both SD1.5 (Table 2) and SDXL (Table 3). A consistent pattern emerges across both models: loosening the control set steadily improves prompt alignment and human-preference scores (CLIP, HPSv2) and steadily increases saturation, while the remaining fidelity metrics (FID, NIQE, BRISQUE, Density, Coverage) improve sharply over the first few steps of the sweep and then plateau. No single value of γ is simultaneously optimal across every metric, so selecting γ requires an explicit choice about how to balance prompt alignment against the residual fidelity cost of moving away from γ=0.0γ=0.0; we describe that choice, and its cost, for each model below. For SD1.5, we select γ=0.5γ=0.5. At this value, six of the nine metrics (NIQE, BRISQUE, Density, Coverage, CLIP, and HPSv2) sit within 1%1\% of the best value achieved anywhere in the sweep, and FID (14.9714.97) is close to its sweep-best (14.5314.53) and far below the γ=0.0γ=0.0 value (16.9516.95). Beyond γ=0.5γ=0.5, prompt-alignment and preference gains diminish sharply: CLIP and HPSv2 each move by less than 0.15%0.15\% between γ=0.5γ=0.5 and γ=1.0γ=1.0. Over the same range, the two metrics that continue to degrade past γ=0.5γ=0.5 worsen further: TReS, which peaks early at γ=0.1γ=0.1 and declines steadily thereafter, falling below even its γ=0.0γ=0.0 value; and saturation, which increases monotonically with γ throughout the sweep. We therefore treat γ=0.5γ=0.5 as close to the point of diminishing returns for SD1.5: it captures nearly all of the available prompt-alignment gain without paying the additional TReS and saturation cost of continuing to γ=1.0γ=1.0. For SDXL, we instead select γ=1.0γ=1.0. Unlike SD1.5, fidelity metrics for SDXL plateau from roughly γ=0.3γ=0.3–0.40.4 onward and remain within a small margin of their sweep-best all the way to γ=1.0γ=1.0. FID, TReS, Density, and Coverage are each within 2%2\% of their respective optima at γ=1.0γ=1.0, while CLIP and HPSv2 are both maximised at γ=1.0γ=1.0. This is consistent with our hypothesis that SDXL, as a higher-capacity model, is more robust to the manifold departure the curvature-aware correction addresses, and so tolerates a looser control set with comparatively little fidelity cost. The corresponding cost is a mild increase in BRISQUE (2.7%2.7\% above its sweep-best) and saturation, which reaches its highest value in the sweep at γ=1.0γ=1.0; we accept this cost given the consistent, and in several cases maximal, gains elsewhere. Table 2: Image quality for SD1.5 (Rombach et al., 2022) samples generated for ImageNet (Russakovsky et al., 2015) dataset using CACFG across varying curvature-aware blending parameter values. γ FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ 0.00.0 16.9516.95 5.445.44 23.5923.59 85.1585.15 24.83524.835 23.84423.844 0.9380.938 0.3950.395 0.1940.194 0.10.1 14.5314.53 4.564.56 17.3617.36 86.2886.28 25.15925.159 25.06925.069 1.1111.111 0.4440.444 0.2360.236 0.20.2 14.5414.54 4.324.32 15.2815.28 85.6585.65 25.19925.199 25.40325.403 1.1421.142 0.4460.446 0.2660.266 0.30.3 14.7214.72 4.244.24 14.6414.64 84.9684.96 25.23325.233 25.55025.550 1.1401.140 0.4480.448 0.2890.289 0.40.4 14.8914.89 4.224.22 14.5014.50 84.2984.29 25.24225.242 25.62125.621 1.1401.140 0.4470.447 0.3050.305 0.50.5 14.9714.97 4.224.22 14.5914.59 83.8083.80 25.24325.243 25.65325.653 1.1401.140 0.4450.445 0.3160.316 0.60.6 15.0315.03 4.234.23 14.7514.75 83.4883.48 25.24425.244 25.66925.669 1.1451.145 0.4470.447 0.3230.323 0.70.7 15.1115.11 4.244.24 14.9314.93 83.2883.28 25.24425.244 25.67225.672 1.1381.138 0.4450.445 0.3280.328 0.80.8 15.1015.10 4.254.25 15.0415.04 83.1283.12 25.24725.247 25.67325.673 1.1371.137 0.4440.444 0.3310.331 0.90.9 15.1415.14 4.264.26 15.1415.14 83.0483.04 25.25525.255 25.68125.681 1.1371.137 0.4450.445 0.3330.333 1.01.0 15.0915.09 4.264.26 15.2015.20 82.9782.97 25.25525.255 25.69025.690 1.1331.133 0.4450.445 0.3350.335 Table 3: Image quality for SDXL (Podell et al., 2024) samples generated for ImageNet (Russakovsky et al., 2015) dataset using CACFG across varying curvature-aware blending parameter values. γ FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ 0.00.0 35.8435.84 4.964.96 26.9326.93 78.0678.06 24.75124.751 23.53123.531 0.8630.863 0.1430.143 0.1390.139 0.10.1 29.8529.85 4.484.48 26.0426.04 81.8281.82 25.21325.213 25.40925.409 1.0731.073 0.1740.174 0.1650.165 0.20.2 29.2229.22 4.424.42 26.0526.05 83.3783.37 25.27425.274 25.92425.924 1.1331.133 0.1830.183 0.1820.182 0.30.3 29.0929.09 4.434.43 26.2126.21 83.9683.96 25.29125.291 26.11426.114 1.1471.147 0.1840.184 0.1930.193 0.40.4 29.0229.02 4.444.44 26.4526.45 84.2284.22 25.32225.322 26.23426.234 1.1171.117 0.1810.181 0.2010.201 0.50.5 29.0229.02 4.474.47 26.5326.53 84.3184.31 25.36125.361 26.29426.294 1.1401.140 0.1840.184 0.2060.206 0.60.6 29.0629.06 4.484.48 26.5926.59 84.3884.38 25.34225.342 26.31926.319 1.1571.157 0.1870.187 0.2090.209 0.70.7 29.0929.09 4.484.48 26.7026.70 84.4184.41 25.35025.350 26.33926.339 1.1591.159 0.1860.186 0.2110.211 0.80.8 29.1029.10 4.494.49 26.6626.66 84.4384.43 25.35625.356 26.35326.353 1.1591.159 0.1850.185 0.2130.213 0.90.9 29.1029.10 4.504.50 26.7626.76 84.4084.40 25.35825.358 26.37026.370 1.1591.159 0.1870.187 0.2140.214 1.01.0 29.1229.12 4.494.49 26.7526.75 84.3984.39 25.36925.369 26.38026.380 1.1581.158 0.1860.186 0.2150.215 Appendix D Curvature-Aware Experiments D.1 Metric plots Here we provide the metric plots of SD1.5 (Rombach et al., 2022) and SDXL (Podell et al., 2024) diffusion models on the ImageNet (Russakovsky et al., 2015) and COCO (Lin et al., 2014) generation tasks. We discuss these results in Section 6.1. (a) ImageNet (b) COCO Figure 6: Performance of CFG, CFG++, and IntCFG with (solid line) and without (dotted line) our curvature-aware correction using SD1.5 on (a) ImageNet and (b) COCO. Some metric axes have been flipped so that the improvement direction is vertically up the page. Note at larger guidance strengths FID, NIQE, BRISQUE, TReS, Density, Coverage, and CLIP are all improved by our curvature-aware correction. We recommend zooming in for easier viewing. (a) ImageNet (b) COCO Figure 7: Performance of CFG, CFG++, and IntCFG with (solid line) and without (dotted line) our curvature-aware correction using SDXL on (a) ImageNet and (b) COCO. Some metric axes have been flipped so that the improvement direction is vertically up the page. Note at larger guidance strengths FID, NIQE, BRISQUE, TReS, Density, and Coverage are all improved by our curvature-aware correction. We recommend zooming in for easier viewing. D.2 Additional samples Here we present additional curvature-aware diffusion samples across varying guidance methods, guidance strengths, and models. D.2.1 SD1.5 CFG CACFG (a) CFG vs CACFG (ours) CFG++ CACFG++ (b) CFG++ vs CACFG++ (ours) IntCFG IntCACFG (c) IntCFG vs IntCACFG (ours) Figure 8: CFG (Ho & Salimans, 2022), CFG++ (Chung et al., 2025), and IntCFG (Kynkänniemi et al., 2024) visualised against their curvature-aware variants (ours): CACFG, CACFG++, IntCACFG. Samples are generated using SD1.5 (Rombach et al., 2022) targeting the ImageNet (Russakovsky et al., 2015) dataset with a guidance strength of ω=15ω=15. ω=5ω=5 ω=7.5ω=7.5 ω=10ω=10 ω=15ω=15 CFG CACFG CFG CACFG CFG CACFG CFG CACFG Figure 9: CFG (Ho & Salimans, 2022) and CACFG (ours) samples generated using SD1.5 (Rombach et al., 2022) targeting the ImageNet (Russakovsky et al., 2015) dataset. Guidance scale varies across ω=5,7.5,10,15ω=5,7.5,10,15. CFG CACFG (a) CFG vs CACFG (ours) CFG++ CACFG++ (b) CFG++ vs CACFG++ (ours) IntCFG IntCACFG (c) IntCFG vs IntCACFG (ours) Figure 10: CFG (Ho & Salimans, 2022), CFG++ (Chung et al., 2025), and IntCFG (Kynkänniemi et al., 2024) visualised against their curvature-aware variants (ours): CACFG, CACFG++, IntCACFG. Samples are generated using SD1.5 (Rombach et al., 2022) targeting the COCO (Lin et al., 2014) dataset with a guidance strength of ω=15ω=15. ω=5ω=5 ω=7.5ω=7.5 ω=10ω=10 ω=15ω=15 CFG CACFG CFG CACFG CFG CACFG CFG CACFG Figure 11: CFG (Ho & Salimans, 2022) and CACFG (ours) samples generated using SD1.5 (Rombach et al., 2022) targeting the COCO (Lin et al., 2014) dataset. Guidance scale varies across ω=5,7.5,10,15ω=5,7.5,10,15. D.2.2 SDXL CFG CACFG (a) CFG vs CACFG (ours) CFG++ CACFG++ (b) CFG++ vs CACFG++ (ours) IntCFG IntCACFG (c) IntCFG vs IntCACFG (ours) Figure 12: CFG (Ho & Salimans, 2022), CFG++ (Chung et al., 2025), and IntCFG (Kynkänniemi et al., 2024) visualised against their curvature-aware variants (ours): CACFG, CACFG++, IntCACFG. Samples are generated using SDXL (Podell et al., 2024) targeting the ImageNet (Russakovsky et al., 2015) dataset with a guidance strength of ω=25ω=25. ω=10ω=10 ω=15ω=15 ω=20ω=20 ω=25ω=25 CFG CACFG CFG CACFG CFG CACFG CFG CACFG Figure 13: CFG (Ho & Salimans, 2022) and CACFG (ours) samples generated using SDXL (Podell et al., 2024) targeting the ImageNet (Russakovsky et al., 2015) dataset. Guidance scale varies across ω=10,15,20,25ω=10,15,20,25. CFG CACFG (a) CFG vs CACFG (ours) CFG++ CACFG++ (b) CFG++ vs CACFG++ (ours) IntCFG IntCACFG (c) IntCFG vs IntCACFG (ours) Figure 14: CFG (Ho & Salimans, 2022), CFG++ (Chung et al., 2025), and IntCFG (Kynkänniemi et al., 2024) visualised against their curvature-aware variants (ours): CACFG, CACFG++, IntCACFG. Samples are generated using SDXL (Podell et al., 2024) targeting the COCO (Lin et al., 2014) dataset with a guidance strength of ω=25ω=25. ω=10ω=10 ω=15ω=15 ω=20ω=20 ω=25ω=25 CFG CACFG CFG CACFG CFG CACFG CFG CACFG Figure 15: CFG (Ho & Salimans, 2022) and CACFG (ours) samples generated using SDXL (Podell et al., 2024) targeting the COCO (Lin et al., 2014) dataset. Guidance scale varies across ω=10,15,20,25ω=10,15,20,25. D.3 Quantitative results Here we provide the numeric values that the Figures 6 and 7 were created from. Table 4: Image quality for SD1.5 samples generated for ImageNet and COCO datasets across a range of guidance strengths and schedules. Best result for each dataset and guidance strength is bold, and the best value between curvature-aware and non-curvature-aware guidance is given in light green, i.e., colour denotes whether CA or non-CA methods were favoured. Dataset Strength Guidance FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ ImageNet 5 CFG 13.67 [rgb]0,0.88,013.67 4.064.06 14.9814.98 83.2483.24 24.851 [rgb]0,1,024.851 25.076 [rgb]0,1,025.076 1.128 [rgb]0,0.88,01.128 0.4530.453 0.2990.299 CFG++ 13.88 [rgb]0,1,013.88 4.054.05 15.2715.27 83.3183.31 24.84224.842 25.096 [rgb]0,0.88,025.096 1.093 [rgb]0,1,01.093 0.4470.447 0.2910.291 IntCFG 13.86 [rgb]0,1,013.86 4.074.07 15.0015.00 83.0483.04 24.85924.859 25.079 [rgb]0,1,025.079 1.1121.112 0.449 [rgb]0,1,00.449 0.2950.295 CACFG 13.7013.70 4.05 [rgb]0,1,04.05 14.83 [rgb]0,0.88,014.83 83.47 [rgb]0,0.88,083.47 24.84924.849 25.07025.070 1.1241.124 0.454 [rgb]0,0.88,00.454 0.295 [rgb]0,1,00.295 CACFG++ 13.9013.90 4.04 [rgb]0,0.88,04.04 15.19 [rgb]0,1,015.19 83.44 [rgb]0,1,083.44 24.843 [rgb]0,1,024.843 25.09025.090 1.0901.090 0.449 [rgb]0,1,00.449 0.289 [rgb]0,0.88,00.289 IntCACFG 13.86 [rgb]0,1,013.86 4.06 [rgb]0,1,04.06 14.87 [rgb]0,1,014.87 83.29 [rgb]0,1,083.29 24.862 [rgb]0,0.88,024.862 25.07225.072 1.113 [rgb]0,1,01.113 0.449 [rgb]0,1,00.449 0.290 [rgb]0,1,00.290 7.5 CFG 15.1215.12 4.274.27 15.4715.47 82.8082.80 25.251 [rgb]0,0.88,025.251 25.680 [rgb]0,1,025.680 1.1391.139 0.4430.443 0.3380.338 CFG++ 14.9914.99 4.254.25 15.7615.76 82.7182.71 25.21825.218 25.709 [rgb]0,0.88,025.709 1.103 [rgb]0,1,01.103 0.440 [rgb]0,1,00.440 0.3300.330 IntCFG 15.2515.25 4.314.31 15.5715.57 82.4482.44 25.23125.231 25.658 [rgb]0,1,025.658 1.1131.113 0.4390.439 0.3330.333 CACFG 14.97 [rgb]0,1,014.97 4.22 [rgb]0,1,04.22 14.59 [rgb]0,0.88,014.59 83.80 [rgb]0,0.88,083.80 25.24325.243 25.65325.653 1.140 [rgb]0,0.88,01.140 0.445 [rgb]0,0.88,00.445 0.316 [rgb]0,1,00.316 CACFG++ 14.94 [rgb]0,0.88,014.94 4.21 [rgb]0,0.88,04.21 14.93 [rgb]0,1,014.93 83.72 [rgb]0,1,083.72 25.223 [rgb]0,1,025.223 25.69625.696 1.1021.102 0.440 [rgb]0,1,00.440 0.314 [rgb]0,1,00.314 IntCACFG 15.07 [rgb]0,1,015.07 4.25 [rgb]0,1,04.25 14.64 [rgb]0,1,014.64 83.69 [rgb]0,1,083.69 25.235 [rgb]0,1,025.235 25.63525.635 1.123 [rgb]0,1,01.123 0.441 [rgb]0,1,00.441 0.309 [rgb]0,0.88,00.309 10 CFG 16.2216.22 4.444.44 17.1317.13 81.4181.41 25.39125.391 25.967 [rgb]0,1,025.967 1.0841.084 0.4240.424 0.3710.371 CFG++ 16.3516.35 4.424.42 17.2117.21 81.6381.63 25.37225.372 25.993 [rgb]0,0.88,025.993 1.0681.068 0.4210.421 0.3600.360 IntCFG 16.3816.38 4.474.47 17.4617.46 80.9880.98 25.376 [rgb]0,1,025.376 25.954 [rgb]0,1,025.954 1.0691.069 0.4210.421 0.3670.367 CACFG 15.73 [rgb]0,0.88,015.73 4.32 [rgb]0,0.88,04.32 14.66 [rgb]0,0.88,014.66 84.10 [rgb]0,1,084.10 25.395 [rgb]0,0.88,025.395 25.93325.933 1.119 [rgb]0,0.88,01.119 0.433 [rgb]0,0.88,00.433 0.321 [rgb]0,1,00.321 CACFG++ 15.94 [rgb]0,1,015.94 4.32 [rgb]0,0.88,04.32 14.88 [rgb]0,1,014.88 84.14 [rgb]0,0.88,084.14 25.381 [rgb]0,1,025.381 25.97025.970 1.097 [rgb]0,1,01.097 0.427 [rgb]0,1,00.427 0.321 [rgb]0,1,00.321 IntCACFG 15.96 [rgb]0,1,015.96 4.34 [rgb]0,1,04.34 14.75 [rgb]0,1,014.75 84.02 [rgb]0,1,084.02 25.35925.359 25.90025.900 1.109 [rgb]0,1,01.109 0.427 [rgb]0,1,00.427 0.313 [rgb]0,0.88,00.313 15 CFG 17.7817.78 4.754.75 21.9521.95 78.1478.14 25.49125.491 26.214 [rgb]0,1,026.214 0.9940.994 0.3910.391 0.4240.424 CFG++ 18.0118.01 4.714.71 22.1222.12 78.1778.17 25.48325.483 26.221 [rgb]0,0.88,026.221 0.9610.961 0.3880.388 0.4100.410 IntCFG 18.2118.21 4.784.78 22.3922.39 77.8177.81 25.47825.478 26.175 [rgb]0,1,026.175 0.9690.969 0.3890.389 0.4160.416 CACFG 16.52 [rgb]0,0.88,016.52 4.42 [rgb]0,0.88,04.42 14.80 [rgb]0,0.88,014.80 84.60 [rgb]0,1,084.60 25.540 [rgb]0,1,025.540 26.17526.175 1.063 [rgb]0,0.88,01.063 0.413 [rgb]0,0.88,00.413 0.317 [rgb]0,1,00.317 CACFG++ 16.97 [rgb]0,1,016.97 4.45 [rgb]0,1,04.45 15.01 [rgb]0,1,015.01 84.93 [rgb]0,0.88,084.93 25.549 [rgb]0,0.88,025.549 26.19226.192 1.043 [rgb]0,1,01.043 0.404 [rgb]0,1,00.404 0.315 [rgb]0,1,00.315 IntCACFG 16.71 [rgb]0,1,016.71 4.48 [rgb]0,1,04.48 15.09 [rgb]0,1,015.09 84.76 [rgb]0,1,084.76 25.526 [rgb]0,1,025.526 26.12226.122 1.047 [rgb]0,1,01.047 0.408 [rgb]0,1,00.408 0.307 [rgb]0,0.88,00.307 COCO 5 CFG 12.6912.69 3.623.62 14.8214.82 83.8483.84 26.24526.245 25.310 [rgb]0,1,025.310 0.8930.893 0.5200.520 0.2960.296 CFG++ 12.6812.68 3.61 [rgb]0,0.88,03.61 14.8314.83 83.9383.93 26.264 [rgb]0,0.88,026.264 25.38625.386 0.8830.883 0.511 [rgb]0,1,00.511 0.2890.289 IntCFG 12.9612.96 3.633.63 14.8114.81 83.5683.56 26.243 [rgb]0,1,026.243 25.312 [rgb]0,1,025.312 0.890 [rgb]0,1,00.890 0.514 [rgb]0,1,00.514 0.2940.294 CACFG 12.67 [rgb]0,1,012.67 3.61 [rgb]0,0.88,03.61 14.57 [rgb]0,1,014.57 84.11 [rgb]0,1,084.11 26.247 [rgb]0,1,026.247 25.30325.303 0.904 [rgb]0,0.88,00.904 0.523 [rgb]0,0.88,00.523 0.292 [rgb]0,1,00.292 CACFG++ 12.65 [rgb]0,0.88,012.65 3.61 [rgb]0,0.88,03.61 14.71 [rgb]0,1,014.71 84.12 [rgb]0,0.88,084.12 26.25826.258 25.389 [rgb]0,0.88,025.389 0.886 [rgb]0,1,00.886 0.5090.509 0.287 [rgb]0,0.88,00.287 IntCACFG 12.84 [rgb]0,1,012.84 3.62 [rgb]0,1,03.62 14.56 [rgb]0,0.88,014.56 83.91 [rgb]0,1,083.91 26.23726.237 25.31025.310 0.890 [rgb]0,1,00.890 0.514 [rgb]0,1,00.514 0.288 [rgb]0,1,00.288 7.5 CFG 15.4415.44 3.803.80 16.0016.00 82.9682.96 26.495 [rgb]0,1,026.495 26.011 [rgb]0,1,026.011 0.8850.885 0.4960.496 0.3350.335 CFG++ 15.1915.19 3.763.76 16.0216.02 82.9082.90 26.49826.498 26.109 [rgb]0,0.88,026.109 0.8640.864 0.4820.482 0.3270.327 IntCFG 15.5115.51 3.813.81 16.0116.01 82.5682.56 26.48826.488 26.009 [rgb]0,1,026.009 0.8720.872 0.4820.482 0.3310.331 CACFG 14.73 [rgb]0,0.88,014.73 3.73 [rgb]0,1,03.73 14.63 [rgb]0,1,014.63 84.50 [rgb]0,0.88,084.50 26.495 [rgb]0,1,026.495 26.01026.010 0.902 [rgb]0,0.88,00.902 0.497 [rgb]0,0.88,00.497 0.310 [rgb]0,1,00.310 CACFG++ 14.82 [rgb]0,1,014.82 3.72 [rgb]0,0.88,03.72 14.92 [rgb]0,1,014.92 84.24 [rgb]0,1,084.24 26.517 [rgb]0,0.88,026.517 26.10726.107 0.880 [rgb]0,1,00.880 0.492 [rgb]0,1,00.492 0.309 [rgb]0,1,00.309 IntCACFG 14.89 [rgb]0,1,014.89 3.75 [rgb]0,1,03.75 14.60 [rgb]0,0.88,014.60 84.32 [rgb]0,1,084.32 26.499 [rgb]0,1,026.499 25.99325.993 0.882 [rgb]0,1,00.882 0.490 [rgb]0,1,00.490 0.304 [rgb]0,0.88,00.304 10 CFG 17.0917.09 3.933.93 17.8817.88 81.1781.17 26.56726.567 26.33526.335 0.8500.850 0.4650.465 0.3680.368 CFG++ 16.9816.98 3.903.90 17.7017.70 81.4881.48 26.57426.574 26.43226.432 0.8340.834 0.4630.463 0.3580.358 IntCFG 17.2817.28 3.943.94 17.9817.98 80.7080.70 26.55826.558 26.338 [rgb]0,1,026.338 0.8200.820 0.4520.452 0.3660.366 CACFG 15.74 [rgb]0,0.88,015.74 3.78 [rgb]0,0.88,03.78 14.61 [rgb]0,1,014.61 84.90 [rgb]0,1,084.90 26.614 [rgb]0,1,026.614 26.349 [rgb]0,1,026.349 0.872 [rgb]0,0.88,00.872 0.480 [rgb]0,0.88,00.480 0.313 [rgb]0,1,00.313 CACFG++ 16.03 [rgb]0,1,016.03 3.78 [rgb]0,0.88,03.78 14.81 [rgb]0,1,014.81 84.93 [rgb]0,0.88,084.93 26.612 [rgb]0,1,026.612 26.466 [rgb]0,0.88,026.466 0.842 [rgb]0,1,00.842 0.471 [rgb]0,1,00.471 0.314 [rgb]0,1,00.314 IntCACFG 15.94 [rgb]0,1,015.94 3.81 [rgb]0,1,03.81 14.58 [rgb]0,0.88,014.58 84.92 [rgb]0,1,084.92 26.621 [rgb]0,0.88,026.621 26.32826.328 0.847 [rgb]0,1,00.847 0.476 [rgb]0,1,00.476 0.306 [rgb]0,0.88,00.306 15 CFG 19.3619.36 4.204.20 22.0122.01 77.0577.05 26.61026.610 26.59726.597 0.8090.809 0.4330.433 0.4190.419 CFG++ 19.4419.44 4.174.17 22.0522.05 77.3377.33 26.63426.634 26.71726.717 0.7860.786 0.4320.432 0.4070.407 IntCFG 19.7019.70 4.244.24 22.2722.27 76.6476.64 26.61426.614 26.58026.580 0.7790.779 0.4230.423 0.4150.415 CACFG 16.78 [rgb]0,0.88,016.78 3.83 [rgb]0,0.88,03.83 14.51 [rgb]0,0.88,014.51 85.81 [rgb]0,1,085.81 26.744 [rgb]0,1,026.744 26.683 [rgb]0,1,026.683 0.820 [rgb]0,0.88,00.820 0.451 [rgb]0,0.88,00.451 0.305 [rgb]0,1,00.305 CACFG++ 17.11 [rgb]0,1,017.11 3.87 [rgb]0,1,03.87 14.59 [rgb]0,1,014.59 86.34 [rgb]0,0.88,086.34 26.754 [rgb]0,1,026.754 26.766 [rgb]0,0.88,026.766 0.814 [rgb]0,1,00.814 0.448 [rgb]0,1,00.448 0.304 [rgb]0,1,00.304 IntCACFG 16.87 [rgb]0,1,016.87 3.88 [rgb]0,1,03.88 14.52 [rgb]0,1,014.52 86.00 [rgb]0,1,086.00 26.763 [rgb]0,0.88,026.763 26.639 [rgb]0,1,026.639 0.814 [rgb]0,1,00.814 0.451 [rgb]0,0.88,00.451 0.297 [rgb]0,0.88,00.297 Table 5: Image quality for SDXL samples generated for ImageNet and COCO datasets across a range of guidance strengths and schedules. Best result for each dataset and guidance strength is bold, and the best value between curvature-aware and non-curvature-aware guidance is given in light green, i.e., colour denotes whether CA or non-CA methods were favoured. Dataset Strength Guidance FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ ImageNet 10 CFG 29.6029.60 4.664.66 27.4227.42 85.59 [rgb]0,1,085.59 25.54825.548 26.815 [rgb]0,0.88,026.815 1.137 [rgb]0,0.88,01.137 0.182 [rgb]0,0.88,00.182 0.2400.240 CFG++ 29.7429.74 4.634.63 27.2127.21 86.03 [rgb]0,0.88,086.03 25.508 [rgb]0,1,025.508 26.762 [rgb]0,1,026.762 1.0711.071 0.174 [rgb]0,1,00.174 0.2310.231 IntCFG 30.1230.12 4.674.67 27.5527.55 85.9185.91 25.508 [rgb]0,1,025.508 26.722 [rgb]0,1,026.722 1.0741.074 0.1720.172 0.2340.234 CACFG 29.47 [rgb]0,0.88,029.47 4.64 [rgb]0,1,04.64 27.35 [rgb]0,1,027.35 85.5785.57 25.563 [rgb]0,0.88,025.563 26.78926.789 1.1021.102 0.1770.177 0.229 [rgb]0,1,00.229 CACFG++ 29.55 [rgb]0,1,029.55 4.59 [rgb]0,0.88,04.59 27.04 [rgb]0,0.88,027.04 86.0186.01 25.49125.491 26.75426.754 1.074 [rgb]0,1,01.074 0.174 [rgb]0,1,00.174 0.227 [rgb]0,1,00.227 IntCACFG 29.91 [rgb]0,1,029.91 4.64 [rgb]0,1,04.64 27.33 [rgb]0,1,027.33 86.01 [rgb]0,1,086.01 25.48825.488 26.67526.675 1.078 [rgb]0,1,01.078 0.174 [rgb]0,1,00.174 0.223 [rgb]0,0.88,00.223 15 CFG 30.9530.95 4.904.90 28.7128.71 86.4886.48 25.735 [rgb]0,0.88,025.735 27.173 [rgb]0,1,027.173 1.0001.000 0.1620.162 0.2800.280 CFG++ 31.3031.30 4.824.82 28.3228.32 86.9586.95 25.710 [rgb]0,1,025.710 27.184 [rgb]0,0.88,027.184 0.990 [rgb]0,1,00.990 0.160 [rgb]0,1,00.160 0.2690.269 IntCFG 31.7631.76 4.924.92 28.7328.73 86.7586.75 25.63325.633 27.079 [rgb]0,1,027.079 1.001 [rgb]0,1,01.001 0.161 [rgb]0,1,00.161 0.2710.271 CACFG 30.34 [rgb]0,0.88,030.34 4.75 [rgb]0,0.88,04.75 27.97 [rgb]0,1,027.97 86.85 [rgb]0,1,086.85 25.71925.719 27.11627.116 1.016 [rgb]0,0.88,01.016 0.164 [rgb]0,0.88,00.164 0.247 [rgb]0,1,00.247 CACFG++ 30.98 [rgb]0,1,030.98 4.75 [rgb]0,0.88,04.75 27.82 [rgb]0,1,027.82 87.14 [rgb]0,1,087.14 25.70725.707 27.13327.133 0.9690.969 0.1580.158 0.248 [rgb]0,1,00.248 IntCACFG 31.43 [rgb]0,1,031.43 4.77 [rgb]0,1,04.77 27.68 [rgb]0,0.88,027.68 87.25 [rgb]0,0.88,087.25 25.689 [rgb]0,1,025.689 27.02127.021 0.9770.977 0.1600.160 0.238 [rgb]0,0.88,00.238 20 CFG 32.8132.81 5.075.07 29.4029.40 86.3486.34 25.80725.807 27.249 [rgb]0,1,027.249 0.9470.947 0.1540.154 0.3090.309 CFG++ 33.1633.16 5.045.04 29.0129.01 86.8686.86 25.850 [rgb]0,0.88,025.850 27.291 [rgb]0,0.88,027.291 0.9080.908 0.1470.147 0.2980.298 IntCFG 33.9833.98 5.165.16 29.6429.64 86.6586.65 25.773 [rgb]0,1,025.773 27.186 [rgb]0,1,027.186 0.9040.904 0.1460.146 0.2990.299 CACFG 31.39 [rgb]0,0.88,031.39 4.82 [rgb]0,1,04.82 28.10 [rgb]0,1,028.10 87.37 [rgb]0,1,087.37 25.828 [rgb]0,1,025.828 27.22327.223 0.972 [rgb]0,0.88,00.972 0.156 [rgb]0,0.88,00.156 0.253 [rgb]0,1,00.253 CACFG++ 32.58 [rgb]0,1,032.58 4.81 [rgb]0,0.88,04.81 27.97 [rgb]0,1,027.97 87.69 [rgb]0,1,087.69 25.81725.817 27.24527.245 0.911 [rgb]0,1,00.911 0.148 [rgb]0,1,00.148 0.255 [rgb]0,1,00.255 IntCACFG 32.36 [rgb]0,1,032.36 4.82 [rgb]0,1,04.82 27.67 [rgb]0,0.88,027.67 87.83 [rgb]0,0.88,087.83 25.75025.750 27.09827.098 0.941 [rgb]0,1,00.941 0.153 [rgb]0,1,00.153 0.244 [rgb]0,0.88,00.244 25 CFG 34.7834.78 5.225.22 30.3130.31 85.5285.52 25.910 [rgb]0,0.88,025.910 27.20927.209 0.8350.835 0.1360.136 0.3320.332 CFG++ 35.9035.90 5.175.17 29.7729.77 86.3986.39 25.877 [rgb]0,1,025.877 27.24627.246 0.8430.843 0.1370.137 0.3210.321 IntCFG 36.9836.98 5.325.32 30.4330.43 86.0886.08 25.79925.799 27.08627.086 0.7800.780 0.1280.128 0.3210.321 CACFG 32.40 [rgb]0,0.88,032.40 4.80 [rgb]0,0.88,04.80 27.91 [rgb]0,1,027.91 87.51 [rgb]0,1,087.51 25.89425.894 27.230 [rgb]0,1,027.230 0.916 [rgb]0,0.88,00.916 0.147 [rgb]0,0.88,00.147 0.255 [rgb]0,1,00.255 CACFG++ 33.86 [rgb]0,1,033.86 4.83 [rgb]0,1,04.83 27.75 [rgb]0,1,027.75 87.97 [rgb]0,1,087.97 25.85425.854 27.276 [rgb]0,0.88,027.276 0.882 [rgb]0,1,00.882 0.144 [rgb]0,1,00.144 0.256 [rgb]0,1,00.256 IntCACFG 33.42 [rgb]0,1,033.42 4.81 [rgb]0,1,04.81 27.58 [rgb]0,0.88,027.58 88.25 [rgb]0,0.88,088.25 25.805 [rgb]0,1,025.805 27.115 [rgb]0,1,027.115 0.889 [rgb]0,1,00.889 0.143 [rgb]0,1,00.143 0.245 [rgb]0,0.88,00.245 COCO 10 CFG 30.4030.40 4.034.03 27.6027.60 83.0283.02 26.77426.774 28.688 [rgb]0,1,028.688 0.968 [rgb]0,0.88,00.968 0.181 [rgb]0,0.88,00.181 0.2500.250 CFG++ 30.37 [rgb]0,0.88,030.37 4.014.01 27.5427.54 83.4983.49 26.77126.771 28.722 [rgb]0,0.88,028.722 0.9460.946 0.180 [rgb]0,1,00.180 0.2430.243 IntCFG 30.7030.70 4.044.04 27.7027.70 83.3083.30 26.803 [rgb]0,1,026.803 28.675 [rgb]0,1,028.675 0.923 [rgb]0,1,00.923 0.172 [rgb]0,1,00.172 0.2480.248 CACFG 30.38 [rgb]0,1,030.38 4.00 [rgb]0,1,04.00 27.41 [rgb]0,0.88,027.41 83.09 [rgb]0,1,083.09 26.816 [rgb]0,0.88,026.816 28.57328.573 0.8940.894 0.1700.170 0.237 [rgb]0,1,00.237 CACFG++ 30.4730.47 3.99 [rgb]0,0.88,03.99 27.41 [rgb]0,0.88,027.41 83.50 [rgb]0,0.88,083.50 26.786 [rgb]0,1,026.786 28.65828.658 0.950 [rgb]0,1,00.950 0.1790.179 0.238 [rgb]0,1,00.238 IntCACFG 30.39 [rgb]0,1,030.39 4.02 [rgb]0,1,04.02 27.48 [rgb]0,1,027.48 83.31 [rgb]0,1,083.31 26.73726.737 28.53328.533 0.9030.903 0.1690.169 0.234 [rgb]0,0.88,00.234 15 CFG 31.3031.30 4.144.14 27.8927.89 84.0184.01 26.92626.926 29.175 [rgb]0,1,029.175 0.8870.887 0.168 [rgb]0,1,00.168 0.2890.289 CFG++ 31.4831.48 4.114.11 27.6227.62 84.5084.50 26.88926.889 29.225 [rgb]0,0.88,029.225 0.8690.869 0.1660.166 0.2810.281 IntCFG 31.7631.76 4.174.17 27.9427.94 84.2184.21 26.86626.866 29.158 [rgb]0,1,029.158 0.886 [rgb]0,1,00.886 0.168 [rgb]0,1,00.168 0.2860.286 CACFG 31.05 [rgb]0,0.88,031.05 4.07 [rgb]0,1,04.07 27.33 [rgb]0,1,027.33 84.54 [rgb]0,1,084.54 26.936 [rgb]0,0.88,026.936 28.92928.929 0.896 [rgb]0,0.88,00.896 0.1660.166 0.252 [rgb]0,1,00.252 CACFG++ 31.36 [rgb]0,1,031.36 4.05 [rgb]0,0.88,04.05 27.31 [rgb]0,0.88,027.31 84.77 [rgb]0,0.88,084.77 26.925 [rgb]0,1,026.925 29.06929.069 0.883 [rgb]0,1,00.883 0.170 [rgb]0,0.88,00.170 0.257 [rgb]0,1,00.257 IntCACFG 31.33 [rgb]0,1,031.33 4.06 [rgb]0,1,04.06 27.48 [rgb]0,1,027.48 84.71 [rgb]0,1,084.71 26.885 [rgb]0,1,026.885 28.93328.933 0.8410.841 0.1610.161 0.248 [rgb]0,0.88,00.248 20 CFG 32.2732.27 4.234.23 28.2428.24 83.9483.94 26.91126.911 29.284 [rgb]0,1,029.284 0.8010.801 0.1550.155 0.3230.323 CFG++ 32.37 [rgb]0,1,032.37 4.214.21 27.8427.84 84.5884.58 26.92826.928 29.393 [rgb]0,0.88,029.393 0.8140.814 0.1560.156 0.3120.312 IntCFG 32.7032.70 4.254.25 28.4328.43 84.0484.04 26.93526.935 29.280 [rgb]0,1,029.280 0.7670.767 0.1480.148 0.3190.319 CACFG 32.00 [rgb]0,0.88,032.00 4.08 [rgb]0,0.88,04.08 27.36 [rgb]0,1,027.36 85.32 [rgb]0,1,085.32 26.941 [rgb]0,1,026.941 29.04729.047 0.836 [rgb]0,0.88,00.836 0.159 [rgb]0,0.88,00.159 0.260 [rgb]0,1,00.260 CACFG++ 32.4032.40 4.08 [rgb]0,0.88,04.08 27.25 [rgb]0,0.88,027.25 85.55 [rgb]0,0.88,085.55 26.955 [rgb]0,1,026.955 29.21929.219 0.831 [rgb]0,1,00.831 0.158 [rgb]0,1,00.158 0.265 [rgb]0,1,00.265 IntCACFG 32.19 [rgb]0,1,032.19 4.09 [rgb]0,1,04.09 27.28 [rgb]0,1,027.28 85.42 [rgb]0,1,085.42 26.959 [rgb]0,0.88,026.959 29.06329.063 0.799 [rgb]0,1,00.799 0.153 [rgb]0,1,00.153 0.254 [rgb]0,0.88,00.254 25 CFG 33.3533.35 4.334.33 28.6228.62 83.1383.13 26.89726.897 29.313 [rgb]0,1,029.313 0.7360.736 0.1400.140 0.3530.353 CFG++ 33.9333.93 4.294.29 28.2028.20 84.1284.12 26.94126.941 29.429 [rgb]0,0.88,029.429 0.7830.783 0.1500.150 0.3410.341 IntCFG 34.2234.22 4.364.36 29.0229.02 83.6083.60 26.95726.957 29.269 [rgb]0,1,029.269 0.7380.738 0.1400.140 0.3500.350 CACFG 32.13 [rgb]0,0.88,032.13 4.09 [rgb]0,0.88,04.09 27.40 [rgb]0,1,027.40 85.64 [rgb]0,1,085.64 26.989 [rgb]0,0.88,026.989 29.09929.099 0.788 [rgb]0,1,00.788 0.151 [rgb]0,1,00.151 0.262 [rgb]0,1,00.262 CACFG++ 33.23 [rgb]0,1,033.23 4.10 [rgb]0,1,04.10 27.27 [rgb]0,1,027.27 86.00 [rgb]0,0.88,086.00 26.985 [rgb]0,1,026.985 29.25129.251 0.813 [rgb]0,0.88,00.813 0.152 [rgb]0,0.88,00.152 0.266 [rgb]0,1,00.266 IntCACFG 33.13 [rgb]0,1,033.13 4.10 [rgb]0,1,04.10 27.21 [rgb]0,0.88,027.21 85.87 [rgb]0,1,085.87 26.975 [rgb]0,1,026.975 29.10229.102 0.767 [rgb]0,1,00.767 0.147 [rgb]0,1,00.147 0.256 [rgb]0,0.88,00.256 D.4 Comparison with adaptive projected guidance (APG) Adaptive Projected Guidance (APG) (Sadat et al., 2025) decomposes the CFG update direction, ^0(t,t,ξ)−^0(t,t,ΩY) x_0(t, x_t,ξ)- x_0(t, x_t, _Y), into components parallel and orthogonal to the conditional prediction. They show that manipulating the parallel and orthogonal gradient components allows the saturation and image quality to be controlled more effectively. In this section we compare APG against CFG and CACFG; however, unlike CFG++ (Chung et al., 2025) and IntCFG (Kynkänniemi et al., 2024), there is no form of ω(t)ω(t) that converts the CFG-like guidance in Section 4 to APG. This prevents us from comparing methods at equivalent path costs as we do in the main paper. To address this, we instead compare methods across a range of strengths. We report image quality of samples generated using CFG (Ho & Salimans, 2022), CACFG, and APG (Sadat et al., 2025) across a range of guidance strengths for the ImageNet (Russakovsky et al., 2015) and COCO (Lin et al., 2014) datasets, and SD1.5 (Rombach et al., 2022) and SDXL (Podell et al., 2024) diffusion models. Counting only best-in-category and second-best-in-category results, we find CACFG is equal to or better than all other guidance methods; however, this overlooks certain patterns of performance (see Tables 6 and 7). We find APG has lower saturation across all regimes, which is reasonable given that it was designed specifically to address oversaturation. By comparison, CACFG’s strengths are more nuanced: it achieves superior no-reference quality (NIQE, BRISQUE) across models and datasets. However, on SD1.5 it most consistently attains the best or second-best Density/Coverage scores, whereas on SDXL, CACFG’s advantage shifts to TReS, with FID differences between all three methods narrowing to within hundredths. This suggests CACFG’s benefit is not tied to a fixed metric, but rather it maintains a strong performance across metrics as model scale changes. Taken together, no method is necessarily favoured, but CACFG is more theoretically grounded due to its optimal control formulation, and can be applied across guidance schedules, while APG requires tuning to a specific diffusion model. Table 6: Image quality for SD1.5 (Rombach et al., 2022) samples generated for ImageNet (Russakovsky et al., 2015) and COCO (Lin et al., 2014) datasets using CFG (Ho & Salimans, 2022), CACFG, and APG (Sadat et al., 2025). Best result for each dataset are given in bold green and second best in light green. Dataset Guidance Strength FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ ImageNet CFG 5 13.67 [rgb]0,0.88,013.67 4.06 [rgb]0,1,04.06 14.9814.98 83.2483.24 24.85124.851 25.07625.076 1.1281.128 0.453 [rgb]0,1,00.453 0.2990.299 7.5 15.1215.12 4.274.27 15.4715.47 82.8082.80 25.25125.251 25.68025.680 1.139 [rgb]0,1,01.139 0.4430.443 0.3380.338 10 16.2216.22 4.444.44 17.1317.13 81.4181.41 25.39125.391 25.96725.967 1.0841.084 0.4240.424 0.3710.371 15 17.7817.78 4.754.75 21.9521.95 78.1478.14 25.491 [rgb]0,1,025.491 26.214 [rgb]0,0.88,026.214 0.9940.994 0.3910.391 0.4240.424 APG 5 14.0714.07 4.194.19 17.0717.07 84.8584.85 24.24024.240 23.82623.826 1.0091.009 0.4270.427 0.230 [rgb]0,0.88,00.230 7.5 14.0614.06 4.514.51 17.0417.04 85.5585.55 24.80624.806 24.56724.567 1.0911.091 0.4430.443 0.233 [rgb]0,1,00.233 10 14.7714.77 4.724.72 16.9416.94 86.05 [rgb]0,1,086.05 25.10525.105 24.96524.965 1.1231.123 0.4430.443 0.2370.237 15 16.1216.12 4.824.82 15.8715.87 86.17 [rgb]0,0.88,086.17 25.39625.396 25.48125.481 1.1321.132 0.4360.436 0.2520.252 CACFG 5 13.70 [rgb]0,1,013.70 4.05 [rgb]0,0.88,04.05 14.8314.83 83.4783.47 24.84924.849 25.07025.070 1.1241.124 0.454 [rgb]0,0.88,00.454 0.2950.295 7.5 14.9714.97 4.224.22 14.59 [rgb]0,0.88,014.59 83.8083.80 25.24325.243 25.65325.653 1.140 [rgb]0,0.88,01.140 0.4450.445 0.3160.316 10 15.7315.73 4.324.32 14.66 [rgb]0,1,014.66 84.1084.10 25.39525.395 25.93325.933 1.1191.119 0.4330.433 0.3210.321 15 16.5216.52 4.424.42 14.8014.80 84.6084.60 25.540 [rgb]0,0.88,025.540 26.175 [rgb]0,1,026.175 1.0631.063 0.4130.413 0.3170.317 COCO CFG 5 12.6912.69 3.62 [rgb]0,1,03.62 14.8214.82 83.8483.84 26.24526.245 25.31025.310 0.8930.893 0.520 [rgb]0,1,00.520 0.2960.296 7.5 15.4415.44 3.803.80 16.0016.00 82.9682.96 26.49526.495 26.01126.011 0.8850.885 0.4960.496 0.3350.335 10 17.0917.09 3.933.93 17.8817.88 81.1781.17 26.56726.567 26.33526.335 0.8500.850 0.4650.465 0.3680.368 15 19.3619.36 4.204.20 22.0122.01 77.0577.05 26.61026.610 26.597 [rgb]0,1,026.597 0.8090.809 0.4330.433 0.4190.419 APG 5 11.56 [rgb]0,0.88,011.56 3.883.88 16.0216.02 85.8885.88 25.75525.755 23.65323.653 0.8200.820 0.5040.504 0.222 [rgb]0,0.88,00.222 7.5 12.43 [rgb]0,1,012.43 4.124.12 15.9815.98 86.6386.63 26.21026.210 24.52824.528 0.8590.859 0.5030.503 0.224 [rgb]0,1,00.224 10 13.6813.68 4.294.29 15.9515.95 87.01 [rgb]0,1,087.01 26.45126.451 25.03025.030 0.8700.870 0.4950.495 0.2260.226 15 15.4715.47 4.324.32 15.1315.13 87.35 [rgb]0,0.88,087.35 26.648 [rgb]0,1,026.648 25.64925.649 0.8380.838 0.4670.467 0.2410.241 CACFG 5 12.6712.67 3.61 [rgb]0,0.88,03.61 14.57 [rgb]0,1,014.57 84.1184.11 26.24726.247 25.30325.303 0.904 [rgb]0,0.88,00.904 0.523 [rgb]0,0.88,00.523 0.2920.292 7.5 14.7314.73 3.733.73 14.6314.63 84.5084.50 26.49526.495 26.01026.010 0.902 [rgb]0,1,00.902 0.4970.497 0.3100.310 10 15.7415.74 3.783.78 14.6114.61 84.9084.90 26.61426.614 26.34926.349 0.8720.872 0.4800.480 0.3130.313 15 16.7816.78 3.833.83 14.51 [rgb]0,0.88,014.51 85.8185.81 26.744 [rgb]0,0.88,026.744 26.683 [rgb]0,0.88,026.683 0.8200.820 0.4510.451 0.3050.305 Table 7: Image quality for SDXL (Podell et al., 2024) samples generated for ImageNet (Russakovsky et al., 2015) and COCO (Lin et al., 2014) datasets using CFG (Ho & Salimans, 2022), CACFG, and APG (Sadat et al., 2025). Best result for each dataset are given in bold green and second best in light green. Dataset Guidance Strength FID ↓ NIQE ↓ BRISQUE ↓ TReS ↑ CLIP ↑ HPSv2 ↑ Density ↑ Coverage ↑ Saturation ↓ ImageNet CFG 10 29.6029.60 4.664.66 27.4227.42 85.5985.59 25.54825.548 26.81526.815 1.137 [rgb]0,0.88,01.137 0.182 [rgb]0,0.88,00.182 0.2400.240 15 30.9530.95 4.904.90 28.7128.71 86.4886.48 25.73525.735 27.17327.173 1.0001.000 0.1620.162 0.2800.280 20 32.8132.81 5.075.07 29.4029.40 86.3486.34 25.80725.807 27.249 [rgb]0,0.88,027.249 0.9470.947 0.1540.154 0.3090.309 25 34.7834.78 5.225.22 30.3130.31 85.5285.52 25.910 [rgb]0,0.88,025.910 27.20927.209 0.8350.835 0.1360.136 0.3320.332 APG 10 29.7029.70 4.57 [rgb]0,0.88,04.57 26.92 [rgb]0,0.88,026.92 81.7681.76 25.25625.256 25.52825.528 1.107 [rgb]0,1,01.107 0.178 [rgb]0,1,00.178 0.160 [rgb]0,0.88,00.160 15 29.46 [rgb]0,0.88,029.46 4.704.70 27.3627.36 83.7883.78 25.61225.612 26.13626.136 1.0581.058 0.1720.172 0.168 [rgb]0,1,00.168 20 30.5130.51 4.764.76 27.6827.68 85.4185.41 25.70625.706 26.52126.521 1.0171.017 0.1650.165 0.1790.179 25 31.1931.19 4.804.80 27.8627.86 86.3786.37 25.81825.818 26.75626.756 1.0091.009 0.1650.165 0.1930.193 CACFG 10 29.47 [rgb]0,1,029.47 4.64 [rgb]0,1,04.64 27.35 [rgb]0,1,027.35 85.5785.57 25.56325.563 26.78926.789 1.1021.102 0.1770.177 0.2290.229 15 30.3430.34 4.754.75 27.9727.97 86.8586.85 25.71925.719 27.11627.116 1.0161.016 0.1640.164 0.2470.247 20 31.3931.39 4.824.82 28.1028.10 87.37 [rgb]0,1,087.37 25.82825.828 27.22327.223 0.9720.972 0.1560.156 0.2530.253 25 32.4032.40 4.804.80 27.9127.91 87.51 [rgb]0,0.88,087.51 25.894 [rgb]0,1,025.894 27.230 [rgb]0,1,027.230 0.9160.916 0.1470.147 0.2550.255 COCO CFG 10 30.40 [rgb]0,1,030.40 4.03 [rgb]0,1,04.03 27.6027.60 83.0283.02 26.77426.774 28.68828.688 0.968 [rgb]0,0.88,00.968 0.181 [rgb]0,0.88,00.181 0.2500.250 15 31.3031.30 4.144.14 27.8927.89 84.0184.01 26.92626.926 29.17529.175 0.8870.887 0.1680.168 0.2890.289 20 32.2732.27 4.234.23 28.2428.24 83.9483.94 26.91126.911 29.284 [rgb]0,1,029.284 0.8010.801 0.1550.155 0.3230.323 25 33.3533.35 4.334.33 28.6228.62 83.1383.13 26.89726.897 29.313 [rgb]0,0.88,029.313 0.7360.736 0.1400.140 0.3530.353 APG 10 30.40 [rgb]0,1,030.40 4.154.15 28.6328.63 78.5178.51 26.65926.659 26.58026.580 0.8920.892 0.1700.170 0.166 [rgb]0,0.88,00.166 15 31.0831.08 4.194.19 28.4328.43 80.8480.84 26.88026.880 27.39127.391 0.8700.870 0.1630.163 0.175 [rgb]0,1,00.175 20 31.0131.01 4.154.15 27.9427.94 82.6282.62 26.98426.984 27.95027.950 0.933 [rgb]0,1,00.933 0.172 [rgb]0,1,00.172 0.1870.187 25 31.3931.39 4.134.13 27.6327.63 83.9483.94 26.990 [rgb]0,0.88,026.990 28.36228.362 0.8550.855 0.1610.161 0.2020.202 CACFG 10 30.38 [rgb]0,0.88,030.38 4.00 [rgb]0,0.88,04.00 27.4127.41 83.0983.09 26.81626.816 28.57328.573 0.8940.894 0.1700.170 0.2370.237 15 31.0531.05 4.074.07 27.33 [rgb]0,0.88,027.33 84.5484.54 26.93626.936 28.92928.929 0.8960.896 0.1660.166 0.2520.252 20 32.0032.00 4.084.08 27.36 [rgb]0,1,027.36 85.32 [rgb]0,1,085.32 26.94126.941 29.04729.047 0.8360.836 0.1590.159 0.2600.260 25 32.1332.13 4.094.09 27.4027.40 85.64 [rgb]0,0.88,085.64 26.989 [rgb]0,1,026.989 29.09929.099 0.7880.788 0.1510.151 0.2620.262 Appendix E HJB Derivation In this section we present the derivation of the HJB formulation of CFG-like diffusion guidance, and the modifications necessary to re-derive classic CFG. E.1 Necessary background results Canonical image diffusion: We first fix the notation for the forward diffusion process used throughout the remainder of this appendix, following Collins et al. (2026). Definition E.1 (Canonical Image Diffusion). Let t∈ℝm x_t ^m for t∈[0,T]t∈[0,T], let f:ℝ→ℝf:R and g:ℝ→ℝg:R be continuous functions of t, and let ⋅dt ·d B_t denote an Itô integral with respect to the standard m-dimensional Brownian motion process t B_t. We define the canonical image diffusion to be the forward process dt=f(t)tdt+g(t)I(m×m)dt,∀t∈[0,T].d x_t=f(t) x_t\,dt+g(t)I^(m× m)d B_t, ∀\ t∈[0,T]. (27) Let 0 X_0 be an ℝmR^m-valued random variable representing the initial (image) state, and let Y denote auxiliary conditioning information available for 0 X_0 (e.g. a class label), taking values in a countable set ΩY _Y with associated sigma-algebra Y (we take Y to contain every singleton y∀y∈ΩY\y\\ ∀\ y∈ _Y). We take 0 X_0 and Y to be jointly distributed, with joint law P(0,Y)P( X_0,Y), a probability measure on (ℝm×ΩY,ℬ(ℝm)⊗) (R^m× _Y,\ B(R^m) ); the marginal laws P(0)P( X_0) and P(Y∈ξ)P(Y∈ξ) for ξ∈ξ , follow in the usual way. For ξ∈ξ with P(Y∈ξ)>0P(Y∈ξ)>0, we write P(0∣ξ)P( X_0 ξ) for the conditional law of 0 X_0 given the event Y∈ξ\Y∈ξ\, i.e. P(0|ξ)≜P(0,Y∈ξ)P(Y∈ξ),P ( X_0 |\ ξ ) P( X_0,\ Y∈ξ)P(Y∈ξ), (28) a probability measure on (ℝm,ℬ(ℝm)) (R^m,B(R^m) ). Two special cases of ξ recur throughout: taking ξ=ΩYξ= _Y recovers the unconditional case, P(0∣ΩY)=P(0)P( X_0 _Y)=P( X_0), since Y∈ΩY\Y∈ _Y\ is the sure event; and for a specific label y∈ΩYy∈ _Y with P(Y=y)>0P(Y=y)>0, taking ξ=yξ=\y\ gives the class-conditional law P(0∣y)P( X_0 \y\), which we abbreviate P(0∣y)P( X_0 y). For a measurable function h:ℝm×ℝm→ℝh:R^m×R^m and for ξ∈ξ with P(Y∈ξ)>0P(Y∈ξ)>0, we understand ∫h(t,0)P(0∣ξ) h( x_t, x_0)\,dP( x_0 ξ) to denote integration of h(t,⋅)h( x_t,·) against P(0∣ξ)P( X_0 ξ), without requiring this measure to admit a density (this accommodates empirical measures over a finite dataset). Conditional forward distribution: The following theorem describes the conditional forward distribution of the canonical image diffusion when conditioned on the state at an arbitrary time τ. This is a well-known result, and we restate the formulation by Collins et al. (2026); we omit the proof here and refer the reader there (the derivation solves (27) via its Stratonovich representation and converts back to the equivalent Itô form). Theorem E.1 (Conditional Forward Distribution for Denoising Diffusion, Collins et al., 2026). Under the canonical image diffusion of Definition E.1, define for 0≤τ≤t≤T0≤τ≤ t≤ T α(τ,t)≜exp(∫τtf(u)u),β(τ,t)2≜α(τ,t)2∫τtg(u)2α(τ,u)2u.α(τ,t) ( _τ^tf(u)\,du ), β(τ,t)^2 α(τ,t)^2 _τ^t g(u)^2α(τ,u)^2\,du. (29) Then the forward process in (27) admits the conditional forward distribution t|τ=τ∼(α(τ,t)τ,β(τ,t)2I(m×m))∀t>τ. X_t X_τ= x_τ (α(τ,t) x_τ,\ β(τ,t)^2I^(m× m) ) ∀\ t>τ. (30) With a slight abuse of notation we write αt≜α(0,t) _t α(0,t) and βt≜β(0,t) _t β(0,t), so that t|0=0∼(αt0,βt2I(m×m)). X_t X_0= x_0 ( _t x_0,\ _t^2I^(m× m) ). (31) Score-model link: The following Score-Model Link theorem is based on Karras et al.’s 2022 argument, extended by Collins et al. (2026) by conditioning on the auxiliary random variable Y of Definition E.1. For additional treatments see (Karras et al., 2022; Hyvärinen, 2005; Vincent, 2011). We restate it here under the canonical image diffusion of Definition E.1, replacing the empirical-density formulation of the original statement with integration against the measure P(0∣ξ)P( X_0 ξ) directly; this is equivalent to the version in (Collins et al., 2026), and we omit the proof, referring the reader there. Theorem E.2 (Score-Model Link, Collins et al., 2026; Karras et al., 2022). Let t x_t evolve according to the canonical image diffusion of Definition E.1, with initial law P(0∣ξ)P( X_0 ξ) for some ξ∈ξ . Define ^0(t,t,ξ,θ)=t−βtϵθ(t,t,ξ)αt, x_0(t, x_t,ξ;θ)= x_t- _t ε_θ(t, x_t,ξ) _t, (32) where αt _t and βt _t are as in Theorem E.1, and ϵθ:ℝm×ℝ×→ℝm ε_θ:R^m×R×Y ^m is a model parameterised by θ∈Θθ∈ with sufficient capacity such that the Universal Approximation Theorem (Cybenko, 1989; Hornik, 1991) holds for all ξ∈ξ . Then if βt2>0∀t∈(0,T] _t^2>0\ ∀\ t∈(0,T], the following statements are true: 1. ∇tlog(p(t∣ξ))=−1βtϵθ⋆(t,t,ξ)∀t∈(0,T],t∈ℝm,ξ∈; _ x_t (p( x_t ξ))=- 1 _t ε_θ (t, x_t,ξ) ∀\ t∈(0,T],\ x_t ^m,\ ξ ; (34) 2. ϵθ⋆(t,t,ξ)=∫ℝm1βt(t−αt0)p(t|0)P(0∣ξ)p(t∣ξ)∀t∈(0,T], ε_θ (t, x_t,ξ)= _R^m 1 _t ( x_t- _t x_0 )p( x_t| x_0)\,dP( x_0 ξ)p( x_t ξ) ∀\ t∈(0,T], (35) t∈ℝm,ξ∈ x_t ^m,\ ξ ; where θ⋆≜argmin0∼P(0∣ξ),t∼p(t∣0),t∼p(t)[‖0−^0‖22], θ θ arg \ E_ x_0 P( x_0 ξ),\ x_t p( x_t x_0),\ t p(t) [ x_0- x_0 _2^2 ], (36) and p(t)≜1Tp(t) 1T. By the shorthand of Definition E.1, taking ξ=yξ=\y\ for a specific label y∈ΩYy∈ _Y gives the class-conditional score-model ϵθ⋆(t,t,y) ε_θ (t, x_t,y), and taking ξ=ΩYξ= _Y gives the unconditional score-model ϵθ⋆(t,t,ΩY) ε_θ (t, x_t, _Y); both are the objects we later manipulate in the HJB derivation. Tweedie’s formula: Tweedie’s formula (Efron, 2011) relates the posterior mean of 0 X_0 given a noisy observation t x_t to the score of the marginal density of t X_t. We state and prove the specialisation of this result to the canonical image diffusion of Definition E.1, conditioned on the event ξ of Definition E.1, as we require both the conditioning and the proof mechanics directly in the upper-bounding lemma that follows. Given the initial law P(0∣ξ)P( X_0 ξ) of Definition E.1, which we do not assume admits a density, define the conditional marginal density of t x_t by p(t∣ξ)≜∫ℝmp(t∣0)P(0∣ξ),p( x_t ξ) _R^mp( x_t x_0)\,dP( x_0 ξ), (38) where p(t∣0)p( x_t x_0) is the Gaussian transition density of Theorem E.1. As this transition density is, for βt2>0 _t^2>0, positive-everywhere and integrates the mass of P(0∣ξ)P( X_0 ξ) against a bounded, smooth kernel, then (38) defines a genuine, positive-everywhere probability density on ℝmR^m, regardless of whether P(0∣ξ)P( X_0 ξ) itself admits one. Theorem E.3 (Tweedie’s Formula, adapted from Efron, 2011). Under the canonical image diffusion of Definition E.1, with βt2>0∀t∈(0,T] _t^2>0\ ∀\ t∈(0,T], and let p(t∣ξ)p( x_t ξ) be as in (38) for ξ∈ξ . Define ϵ(t,t,ξ)≜−βt∇tlog(p(t∣ξ)). ε(t, x_t,ξ) - _t _ x_t (p( x_t ξ)). (39) Then 0|t,ξ[0]=t−βtϵ(t,t,ξ)αt∀t∈ℝm,t∈(0,T],ξ∈,E_ X_0 x_t,\,ξ [ X_0 ]= x_t- _t ε(t, x_t,ξ) _t ∀\ x_t ^m,\ t∈(0,T],\ ξ , where 0|t,ξE_ X_0 x_t,\,ξ denotes expectation with respect to the posterior measure P(0∣t,ξ)P( X_0 x_t,\,ξ) constructed in the proof (writing t x_t for the conditioning event t=t\ X_t= x_t\, analogous to the ξ shorthand of Definition E.1). Proof. Differentiating (38) under the integral sign (justified since βt2>0 _t^2>0 implies p(t∣0)p( x_t x_0) and ∇tp(t∣0) _ x_tp( x_t x_0) are uniformly bounded in 0 x_0, so dominated convergence permits the interchange), ∇tlog(p(t∣ξ)) _ x_t (p( x_t ξ)) =∇tlog(∫ℝmp(t∣0)P(0∣ξ)) = _ x_t ( _R^mp( x_t x_0)\,dP( x_0 ξ) ) =1p(t∣ξ)∫ℝm∇tp(t∣0)P(0∣ξ). = 1p( x_t ξ) _R^m _ x_tp( x_t x_0)\,dP( x_0 ξ). By Theorem E.1, p(t∣0)=(αt0,βt2I(m×m))⟹∇tp(t∣0)=−1βt2(t−αt0)p(t∣0)p( x_t x_0)=N ( _t x_0,\ _t^2I^(m× m) ) _ x_tp( x_t x_0)=- 1 _t^2( x_t- _t x_0)p( x_t x_0), thus, ∇tlog(p(t∣ξ)) _ x_t (p( x_t ξ)) =1p(t∣ξ)∫ℝm[−1βt2(t−αt0)]p(t∣0)P(0∣ξ). = 1p( x_t ξ) _R^m [- 1 _t^2( x_t- _t x_0) ]p( x_t x_0)\,dP( x_0 ξ). (40) Define the posterior measure P(0∣t,ξ)P( X_0 x_t,\,ξ) on (ℝm,ℬ(ℝm)) (R^m,B(R^m) ) by dP(0∣t,ξ)≜p(t∣0)p(t∣ξ)dP(0∣ξ).dP( x_0 x_t,\,ξ) p( x_t x_0)p( x_t ξ)\,dP( x_0 ξ). (41) As p(t∣0)/p(t∣ξ)≥0p( x_t x_0)/p( x_t ξ)≥ 0 and ∫ℝmp(t∣0)/p(t∣ξ)P(0∣ξ)=p(t∣ξ)/p(t∣ξ)=1 _R^mp( x_t x_0)/p( x_t ξ)\,dP( x_0 ξ)=p( x_t ξ)/p( x_t ξ)=1 by (38), (41) is a valid Radon-Nikodym reweighting of P(0∣ξ)P( X_0 ξ) and hence defines a genuine probability measure; this is just Bayes’ theorem expressed without requiring P(0∣ξ)P( X_0 ξ) to admit a density. In particular, P(0∣t,ξ)≪P(0∣ξ)P( X_0 x_t,\,ξ) P( X_0 ξ): absolute continuity, i.e., any set assigned zero probability by P(0∣ξ)P( X_0 ξ) is also assigned zero probability by the posterior, since the posterior is obtained by integrating a finite, nonnegative Radon-Nikodym derivative against P(0∣ξ)P( X_0 ξ). Substituting (41) into (40), ∇tlog(p(t∣ξ)) _ x_t (p( x_t ξ)) =∫ℝm[−1βt2(t−αt0)]P(0∣t,ξ) = _R^m [- 1 _t^2( x_t- _t x_0) ]dP( x_0 x_t,\,ξ) =−1βt2t+αtβt2∫ℝm0P(0∣t,ξ) =- 1 _t^2 x_t+ _t _t^2 _R^m x_0\,dP( x_0 x_t,\,ξ) =−1βt2t+αtβt20|t,ξ[0]. =- 1 _t^2 x_t+ _t _t^2\,E_ X_0 x_t,\,ξ [ X_0 ]. (42) Multiplying (42) by −βt- _t and applying (39), ϵ(t,t,ξ)=t−αt0|t,ξ[0]βt⟹0|t,ξ[0]=t−βtϵ(t,t,ξ)αt, ε(t, x_t,ξ)= x_t- _t\,E_ X_0 x_t,\,ξ [ X_0 ] _t _ X_0 x_t,\,ξ [ X_0 ]= x_t- _t ε(t, x_t,ξ) _t, which proves the claim. ∎ Comparing (39) with Theorem E.2, we note that ϵ(t,t,ξ)=ϵθ⋆(t,t,ξ) ε(t, x_t,ξ)= ε_θ (t, x_t,ξ) for every ξ∈ξ ; that is, the population noise-prediction function of Tweedie’s formula is the optimal score-model of Theorem E.2, and by the shorthand of Definition E.1 this holds equally for the class-conditional case (ξ=yξ=\y\, written ϵ(t,t,y) ε(t, x_t,y)) and the unconditional case (ξ=ΩYξ= _Y, written ϵ(t,t,ΩY) ε(t, x_t, _Y)). Boundedness of the Tweedie estimate: An important property of Tweedie’s estimate is that it inherits some bounding properties of the underlying data distribution. The following lemma shows that if the data lies almost surely within a closed ball of radius r, then so does the Tweedie estimate, for every t x_t, t, and conditioning event ξ. Lemma E.4 (Boundedness of the Tweedie Estimate). Under the canonical image diffusion of Definition E.1, with βt2>0∀t∈(0,T] _t^2>0\ ∀\ t∈(0,T], and suppose there exists r>0r>0 and ξ∈ξ such that P(‖0‖22≤r2|ξ)=1.P ( X_0 _2^2≤ r^2\ |\ ξ )=1. Then the Tweedie estimator ^0(t,t,ξ)≜^0(t,t,ξ,θ⋆)=0|t,ξ[0] x_0(t, x_t,ξ) x_0(t, x_t,ξ;θ )=E_ X_0 x_t,\,ξ [ X_0 ] of Theorem E.3 satisfies ‖^0(t,t,ξ)‖22≤r2∀t∈ℝm,t∈(0,T]. x_0(t, x_t,ξ) _2^2≤ r^2 ∀\ x_t ^m,\ t∈(0,T]. Proof. Fix t∈ℝm x_t ^m and t∈(0,T]t∈(0,T], and let A≜0∈ℝm:‖0‖22>r2A \ x_0 ^m: x_0 _2^2>r^2 \. By hypothesis, P(0∈A∣ξ)=0P( X_0∈ A ξ)=0. By the absolute continuity P(0∣t,ξ)≪P(0∣ξ)P( X_0 x_t,\,ξ) P( X_0 ξ) established in the proof of Theorem E.3 (via (41)), it follows that P(0∈A|t,ξ)=∫Ap(t∣0)p(t∣ξ)dP(0∣ξ)=0,P ( X_0∈ A\ |\ x_t,\,ξ )= _A p( x_t x_0)p( x_t ξ)\,dP( x_0 ξ)=0, since the integrand is finite and nonnegative and is being integrated over the P(0∣ξ)P( X_0 ξ)-null set. Hence ‖0‖22≤r2 X_0 _2^2≤ r^2 almost surely under the posterior measure P(0∣t,ξ)P( X_0 x_t,\,ξ). Integrating this almost-sure bound against the probability measure P(0∣t,ξ)P( X_0 x_t,\,ξ) gives 0|t,ξ[‖0‖22]≤r2.E_ X_0 x_t,\,ξ [ X_0 _2^2 ]≤ r^2. (43) As ‖⋅‖22 · _2^2 is convex on ℝmR^m, Jensen’s inequality gives ‖^0(t,t,ξ)‖22=‖0|t,ξ[0]‖22≤0|t,ξ[‖0‖22]. x_0(t, x_t,ξ) _2^2= _ X_0 x_t,\,ξ [ X_0 ] _2^2 _ X_0 x_t,\,ξ [ X_0 _2^2 ]. (44) Combining (43) and (44), ‖^0(t,t,ξ)‖22≤r2. x_0(t, x_t,ξ) _2^2≤ r^2. As t∈ℝm x_t ^m and t∈(0,T]t∈(0,T] were arbitrary, the claim holds for all t x_t and t. ∎ Since conditioning cannot introduce probability mass on a set the unconditional law assigns zero mass to, taking ξ=ΩYξ= _Y in the hypothesis of Lemma E.4, i.e. an unconditional bound P(∥0∥22≤r2)=1P( X_0 _2^2≤ r^2)=1, then P(∥0∥22≤r2∣ξ)=1P( X_0 _2^2≤ r^2 ξ)=1, and hence ∥^0(t,t,ξ)∥22≤r2 x_0(t, x_t,ξ) _2^2≤ r^2, for every ξ∈ξ with P(Y∈ξ)>0P(Y∈ξ)>0–in particular, for every class-conditional label y∈ΩYy∈ _Y. Additionally, note that we are taking ^0(t,t,ξ) x_0(t, x_t,ξ) to refer to the optimal ^0(t,t,ξ,θ⋆) x_0(t, x_t,ξ;θ ) for brevity. E.2 HJB CFG formulation Optimal control problem and HJB equation: We first fix our notation for the optimal control problem underlying the HJB equation, following the general formulation of Berkovitz & Medhin (2012) (§2.3, p. 19–21) and Liberzon (2012) (§5.1.2, p. 158–159), generalising the control constraint set to vary with time as in Berkovitz & Medhin (2012) (§6.2, p. 150). Problem E.5 (Optimal Control Problem). Fix tl<Tt_l<T. Let t∈ℝm x_t ^m for t∈[tl,T]t∈[t_l,T], let t∈U(t)⊆ℝp u_t∈ U(t) ^p be a control taking values in a nonempty, time-varying control set U(t)U(t), and let :ℝ×ℝm×ℝp→ℝm b:R×R^m×R^p ^m. Let L:ℝ×ℝm×ℝp→ℝL:R×R^m×R^p be a running cost and K:ℝm→ℝK:R^m a terminal cost, and let both be sufficiently regular such that a unique trajectory exists for every admissible control.44 4 Specifically: joint continuity, locally Lipschitz in x with a t-dependent, square-integrable modulus, uniformly over t u_t, and of at most linear growth in ||| x| (Berkovitz & Medhin, 2012, Assumption 12.2.1(i)–(iv), p. 338–339). Parts (v)–(vi) of that assumption, concerning the terminal manifold and cost, are immediate from our choice of a fixed terminal time T; part (vii), concerning existence of an optimal control, is not required for the verification Lemma E.7 below. For (t,t)∈[tl,T]×ℝm(t, x_t)∈[t_l,T]×R^m, minimise the functional J(t,t,t)≜∫tTL(s,s,s)s+K(T)J(t, x_t, u_t) _t^TL(s, x_s, u_s)\,ds+K( x_T) (45) subject to the state equation ˙s=dsds=(s,s,s),t given, x_s= d x_sds= b(s, x_s, u_s), x_t given, (46) and control constraint s∈U(s) u_s∈ U(s), s∈[t,T]s∈[t,T]. Definition E.2 (Value Function). The value function of Problem E.5 is V(t,t)≜inf[t,T]J(t,t,t),V(t, x_t) _ u_[t,T]J(t, x_t, u_t), (47) where the infimum ranges over controls with s∈U(s) u_s∈ U(s), s∈[t,T]s∈[t,T], and s x_s solves (46). Hamilton–Jacobi–Bellman equation: The following theorem states that the value function of Definition E.2 satisfies the associated Hamilton–Jacobi–Bellman (HJB) equation. This is a well-known result, following from the dynamic programming principle; we omit the proof here and refer the reader to Bellman, 1957, Berkovitz & Medhin, 2012 (§6.2, p. 150–154), and Liberzon, 2012 (§5.1.3, p. 161–162). Theorem E.6 (HJB Equation, after Bellman, 1957; Berkovitz & Medhin, 2012; Liberzon, 2012). The value function V of Definition E.2 satisfies −Vt(t,t)=inft∈U(t)L(t,t,t)+⟨Vt(t,t),(t,t,t)⟩,∀(t,t)∈[tl,T)×ℝm,-V_t(t, x_t)= _ u_t∈ U(t) \L(t, x_t, u_t)+ V_ x_t(t, x_t),\, b(t, x_t, u_t) \, ∀\ (t, x_t)∈[t_l,T)×R^m, (48) with boundary condition V(T,T)=K(T)V(T, x_T)=K( x_T). Sufficient condition for optimality: The following verification lemma gives conditions under which a C1C^1 solution of the HJB equation coincides with the value function, and a control satisfying the associated stationarity condition is optimal. We state the classical smooth specialisation of the argument; see Bellman, 1957, Berkovitz & Medhin, 2012 (Thm. 12.7.1, p. 359–360, there stated more generally for Lipschitz continuous value functions via lower Dini derivatives), and Liberzon, 2012 (§5.1.4, p. 165–166, the classical C1C^1 statement we specialise to here) for the proof. Lemma E.7 (Sufficient Condition for Optimality, after Bellman, 1957; Berkovitz & Medhin, 2012; Liberzon, 2012). Suppose V^∈C1([tl,T]×ℝm) V∈ C^1([t_l,T]×R^m) satisfies the HJB equation (48) and boundary condition of Theorem E.6. Suppose there exists a control u with ^t∈U(t) u_t∈ U(t) and trajectory x, ^tl x_t_l given, such that L(t,^t,^t)+⟨V^t(t,^t),(t,^t,^t)⟩=mint∈U(t)L(t,^t,t)+⟨V^t(t,^t),(t,^t,t)⟩L(t, x_t, u_t)+ V_ x_t(t, x_t), b(t, x_t, u_t) = _ u_t∈ U(t) \L(t, x_t, u_t)+ V_ x_t(t, x_t), b(t, x_t, u_t) \ for every t∈[tl,T]t∈[t_l,T]. Then V^(tl,tl)=V(tl,tl) V(t_l, x_t_l)=V(t_l, x_t_l) and u is an optimal control. Reverse-time optimal control problem: We now consider the analogous problem in which the objective is maximised and running reward accumulated since a fixed reference time tlt_l, rather than cost-to-go accrued until a fixed terminal time. This is the formulation our subsequent CFG derivation is stated on directly. Problem E.8 (Reverse-Time Optimal Control Problem). Fix tl<Tt_l<T. Let t∈ℝm x_t ^m for t∈[tl,T]t∈[t_l,T], let t∈U(t)⊆ℝp u_t∈ U(t) ^p, b, L be as in Problem E.5 (with the same regularity), and let K:ℝ×ℝm→ℝK:R×R^m be an initial reward. For (t,t)∈[tl,T]×ℝm(t, x_t)∈[t_l,T]×R^m, maximise the functional J(t,t,t)≜∫tltL(s,s,s)s+K(tl,tl)J(t, x_t, u_t) _t_l^tL(s, x_s, u_s)\,ds+K(t_l, x_t_l) (49) subject to the state equation ˙s=dsds=(s,s,s),t given, x_s= d x_sds= b(s, x_s, u_s), x_t given, (50) and control constraint s∈U(s) u_s∈ U(s), s∈[tl,t]s∈[t_l,t]. Definition E.3 (Reverse-Time Value Function). The value function of Problem E.8 is V^(t,t)≜sup[tl,t]J(t,t,t), V(t, x_t) _ u_[t_l,t]J(t, x_t, u_t), (51) where the supremum ranges over controls with s∈U(s) u_s∈ U(s), s∈[tl,t]s∈[t_l,t], and s x_s solves (50). Lemma E.9 (Reverse-Time HJB Equation). The value function V V of Definition E.3 satisfies V^t(t,t)=supt∈U(t)L(t,t,t)−⟨V^t(t,t),(t,t,t)⟩,∀t∈(tl,T], V_t(t, x_t)= _ u_t∈ U(t) \L(t, x_t, u_t)- V_ x_t(t, x_t),\, b(t, x_t, u_t) \, ∀\ t∈(t_l,T], (52) with boundary condition V^(tl,tl)=K(tl,tl) V(t_l, x_t_l)=K(t_l, x_t_l). Proof. Define the change of variables at the level of the free (evaluation) variable, t≜T+tl−τ,~τ≜T+tl−τ,~τ≜T+tl−τ,t T+t_l-τ, x_τ x_T+t_l-τ, u_τ u_T+t_l-τ, and apply the same substitution to the dummy (integration) variable, writing ψ for its image: s≜T+tl−ψs T+t_l-ψ, so that ~ψ=s x_ψ= x_s and ~ψ=s u_ψ= u_s are the same trajectory and control functions evaluated at ψ rather than τ. This maps [tl,T][t_l,T] to itself, exchanging its endpoints: t=tl⇔τ=Tt=t_l τ=T, t=T⇔τ=tlt=T τ=t_l, and likewise s=tl⇔ψ=Ts=t_l ψ=T, s=T⇔ψ=tls=T ψ=t_l. State equation. Writing s=T+tl−ψs=T+t_l-ψ, the chain rule gives d~ψdψ=dsds⋅dsdψ=−(s,s,s)=−(T+tl−ψ,~ψ,~ψ)≜~(ψ,~ψ,~ψ). d x_ψdψ= d x_sds· dsdψ=- b(s, x_s, u_s)=- b(T+t_l-ψ, x_ψ, u_ψ) b(ψ, x_ψ, u_ψ). Functional. Since s↦ψs ψ reverses orientation on [tl,T][t_l,T], substituting s=T+tl−ψs=T+t_l-ψ, ds=−dψds=-dψ into (49) and flipping the limits of integration (s=tl↦ψ=Ts=t_l ψ=T, s=t↦ψ=T+tl−t=τs=t ψ=T+t_l-t=τ), ∫tltL(s,s,s)s=∫τTL(T+tl−ψ,~ψ,~ψ)ψ≜∫τTL~(ψ,~ψ,~ψ)ψ, _t_l^tL(s, x_s, u_s)\,ds= _τ^TL(T+t_l-ψ, x_ψ, u_ψ)\,dψ _τ^T L(ψ, x_ψ, u_ψ)\,dψ, where L~(ψ,~ψ,~ψ)≜L(T+tl−ψ,~ψ,~ψ) L(ψ, x_ψ, u_ψ) L(T+t_l-ψ, x_ψ, u_ψ). The bounds of integration now match Problem E.5’s: the free variable τ as the lower limit, the fixed time T as the upper limit. Using tl=~T x_t_l= x_T, J(t,t,t)=∫τTL~(ψ,~ψ,~ψ)ψ+K(tl,~T).J(t, x_t, u_t)= _τ^T L(ψ, x_ψ, u_ψ)\,dψ+K(t_l, x_T). As s∈U(s)⇔~ψ∈U(T+tl−ψ)≜U~(ψ) u_s∈ U(s) u_ψ∈ U(T+t_l-ψ) U(ψ), taking the supremum over [tl,t] u_[t_l,t] is equivalent to taking it over ~[τ,T] u_[τ,T], so, writing V~(τ,~τ)≜V^(t,t) V(τ, x_τ) V(t, x_t), V~(τ,~τ)=sup~[τ,T][∫τTL~(ψ,~ψ,~ψ)ψ+K(tl,~T)]. V(τ, x_τ)= _ u_[τ,T] [ _τ^T L(ψ, x_ψ, u_ψ)\,dψ+K(t_l, x_T) ]. Min-max flip. Define V¯≜−V~ V - V, L¯(ψ,~ψ,~ψ)≜−L~(ψ,~ψ,~ψ) L(ψ, x_ψ, u_ψ) - L(ψ, x_ψ, u_ψ), and K¯(~T)≜−K(tl,~T) K( x_T) -K(t_l, x_T). Then sup⋅=−inf−⋅ \·\=- \-·\ gives V¯(τ,~τ)=inf~[τ,T][∫τTL¯(ψ,~ψ,~ψ)ψ+K¯(~T)], V(τ, x_τ)= _ u_[τ,T] [ _τ^T L(ψ, x_ψ, u_ψ)\,dψ+ K( x_T) ], subject to ~˙ψ=~(ψ,~ψ,~ψ) x_ψ= b(ψ, x_ψ, u_ψ) on [τ,T][τ,T]. This is precisely Problem E.5 with t replaced by τ (and its dummy variable s correspondingly by ψ), and L,K,,UL,K, b,U replaced by L¯,K¯,~,U~ L, K, b, U. By Theorem E.6, V¯ V therefore satisfies (48) under this substitution: −V¯τ(τ,~τ)=inf∈U~(τ)L¯(τ,~τ,)+⟨V¯~τ(τ,~τ),~(τ,~τ,)⟩,τ∈[tl,T).- V_τ(τ, x_τ)= _ v∈ U(τ) \ L(τ, x_τ, v)+ V_ x_τ(τ, x_τ), b(τ, x_τ, v) \, τ∈[t_l,T). Back-substitution. Since V¯(τ,~τ)=−V^(t,t) V(τ, x_τ)=- V(t, x_t) with t=T+tl−τt=T+t_l-τ, the chain rule gives V¯τ(τ,~τ)=V^t(t,t) V_τ(τ, x_τ)= V_t(t, x_t) and V¯~τ(τ,~τ)=−V^t(t,t) V_ x_τ(τ, x_τ)=- V_ x_t(t, x_t). Substituting these together with L¯(τ,~τ,)=−L(t,t,) L(τ, x_τ, v)=-L(t, x_t, v), ~(τ,~τ,)=−(t,t,) b(τ, x_τ, v)=- b(t, x_t, v), and U~(τ)=U(t) U(τ)=U(t), −V^t(t,t)=inf∈U(t)−L(t,t,)+⟨V^t(t,t),(t,t,)⟩,t∈(tl,T],- V_t(t, x_t)= _ v∈ U(t) \-L(t, x_t, v)+ V_ x_t(t, x_t), b(t, x_t, v) \, t∈(t_l,T], using ⟨−,−⟩=⟨,⟩ - a,- b = a, b . Multiplying by −1-1 and using −inf−⋅=sup⋅- \-·\= \·\ gives (52). The boundary condition follows from V^(tl,tl)=−V¯(T,~T)=−K¯(~T)=K(tl,tl) V(t_l, x_t_l)=- V(T, x_T)=- K( x_T)=K(t_l, x_t_l). ∎ Sufficient condition for optimality (reverse-time): The following lemma is the mirror image of Lemma E.7, obtained by transporting it through the same change of variables used to prove Lemma E.9. We first record the single-point statement that falls out of a direct transport, then extend it to hold on the whole interval. Lemma E.10 (Reverse-Time Sufficient Condition for Optimality). Suppose Vˇ∈C1([tl,T]×ℝm) V∈ C^1([t_l,T]×R^m) satisfies the reverse-time HJB equation (52) and boundary condition of Lemma E.9. Suppose there exists a control ˇ u with ˇt∈U(t) u_t∈ U(t) and trajectory ˇ x, ˇT x_T given, such that L(t,ˇt,ˇt)−⟨Vˇt(t,ˇt),(t,ˇt,ˇt)⟩=maxt∈U(t)L(t,ˇt,t)−⟨Vˇt(t,ˇt),(t,ˇt,t)⟩L(t, x_t, u_t)- V_ x_t(t, x_t), b(t, x_t, u_t) = _ u_t∈ U(t) \L(t, x_t, u_t)- V_ x_t(t, x_t), b(t, x_t, u_t) \ for every t∈[tl,T]t∈[t_l,T]. Then Vˇ(T,T)=V^(T,T) V(T, x_T)= V(T, x_T) and ˇ u is an optimal control. Proof. Apply the change of variables from the proof of Lemma E.9, at the level of the free variable alone: t≜T+tl−τt T+t_l-τ, ~τ≜T+tl−τ x_τ x_T+t_l-τ, ~τ≜T+tl−τ u_τ u_T+t_l-τ (no dummy variable is needed, as the hypothesis to be transported is a pointwise condition rather than an integral). As shown there, the reverse-time HJB equation and boundary condition transport Vˇ V into a candidate V¯ˇ≜−Vˇ(T+tl−τ,~τ) V - V(T+t_l-τ, x_τ) satisfying the (forward) HJB equation (48) and boundary condition of Theorem E.6, for the problem with (L,K,,U)(L,K, b,U) replaced by (L¯,K¯,~,U~)( L, K, b, U). Since t↦τt τ is a bijection of [tl,T][t_l,T] onto itself, "for every t∈[tl,T]t∈[t_l,T]" transports directly to "for every τ∈[tl,T]τ∈[t_l,T]"; applying the same substitution to the stationarity hypothesis above (using ⟨−,−⟩=⟨,⟩ - a,- b = a, b and max−f=−minf \-f\=- \f\, as in that proof) shows that ~ˇτ≜ˇT+tl−τ u_τ u_T+t_l-τ and ~ˇτ≜ˇT+tl−τ x_τ x_T+t_l-τ satisfy L¯(τ,~ˇτ,~ˇτ)+⟨V¯ˇ~τ(τ,~ˇτ),~(τ,~ˇτ,~ˇτ)⟩=min∈U~(τ)L¯(τ,~ˇτ,)+⟨V¯ˇ~τ(τ,~ˇτ),~(τ,~ˇτ,)⟩ L(τ, x_τ, u_τ)+ V_ x_τ(τ, x_τ), b(τ, x_τ, u_τ) = _ v∈ U(τ) \ L(τ, x_τ, v)+ V_ x_τ(τ, x_τ), b(τ, x_τ, v) \ for every τ∈[tl,T]τ∈[t_l,T]–precisely the hypothesis of Lemma E.7, with ~ˇtl=ˇT x_t_l= x_T given. Lemma E.7 therefore gives V¯ˇ(tl,~ˇtl)=V¯(tl,~ˇtl) V(t_l, x_t_l)= V(t_l, x_t_l) and that ~ˇ u is optimal for the transported problem. Translating back via τ=tl⇔t=Tτ=t_l t=T and V¯ˇ(tl,~ˇtl)=−Vˇ(T,T) V(t_l, x_t_l)=- V(T, x_T), V¯(tl,~tl)=−V^(T,T) V(t_l, x_t_l)=- V(T, x_T) gives Vˇ(T,T)=V^(T,T) V(T, x_T)= V(T, x_T), and optimality of ~ˇ u for the transported problem translates back to optimality of ˇ u for Problem E.8. ∎ CFG-style guidance as optimal control: We now show that a guidance scheme built from Tweedie’s estimate and the class-conditional score-ratio solves the reverse-time optimal control problem of Definition E.3, for an entire family of running rewards indexed by a free schedule r(s)r(s). Theorem E.11 (CFG-Style Guidance Solves the Reverse-Time HJB Equation). Fix ξ∈ξ and tl∈(0,T)t_l∈(0,T) (so that βs2>0 _s^2>0 throughout [tl,T][t_l,T]), let r:[tl,T]→(0,∞)r:[t_l,T]→(0,∞) be continuous, and suppose U(s)⊆ℝmU(s) ^m is nonempty, closed, and convex for every s∈[tl,T]s∈[t_l,T].55 5 When U(s)U(s) is bounded, the regularity of Problem E.5 (joint continuity, local Lipschitz in x, linear growth) is understood to hold on the set; when U(s)U(s) is unbounded, as in Corollary E.12, the regularity of Problem E.5 (joint continuity, local Lipschitz in x, linear growth) is understood to hold on every compact subset of ℝmR^m rather than globally, as Assumption 12.2.1(i) of Berkovitz & Medhin (2012) requires. Define ϕ(s,s)≜log(p(s∣ξ)p(s)),φ(s, x_s) ( p( x_s ξ)p( x_s) ), (53) and consider Problem E.8 with dynamics ˙s=(s,s,s)≜f(s)s−12g(s)2βs2(αss−s), x_s= b(s, x_s, u_s) f(s) x_s- 12 g(s)^2 _s^2 ( _s u_s- x_s ), (54) running reward L(s,s,s)≜ L(s, x_s, u_s) −r(s)‖s−^0(s,s,ΩY)‖22+12g(s)2⟨∇sϕ(s,s),∇slogp(s∣ξ)⟩ -r(s) u_s- x_0(s, x_s, _Y) _2^2+ 12g(s)^2 _ x_sφ(s, x_s), _ x_s p( x_s ξ) +r(s)‖Υ(s,s)‖22−12g(s)2αsβs2⟨∇sϕ(s,s),Υ(s,s)⟩ +r(s) (s, x_s) _2^2- 12 g(s)^2 _s _s^2 _ x_sφ(s, x_s), (s, x_s) +12g(s)2Δsϕ(s,s), + 12g(s)^2 _ x_sφ(s, x_s), (55) and initial reward K(tl,tl)≜ϕ(tl,tl)K(t_l, x_t_l) φ(t_l, x_t_l), where Υ(s,s)≜projU(s)−^0(s,s,ΩY)14g(s)2αsr(s)βs2∇sϕ(s,s). (s, x_s) _U(s)- x_0(s, x_s, _Y) \ 14 g(s)^2 _sr(s) _s^2 _ x_sφ(s, x_s) \. (56) Then the value function of this problem is V^(t,t)=ϕ(t,t) V(t, x_t)=φ(t, x_t) for every (t,t)∈[tl,T]×ℝm(t, x_t)∈[t_l,T]×R^m, and the control t⋆≜^0(t,t,ΩY)+Υ(t,t) u_t x_0(t, x_t, _Y)+ (t, x_t) (57) is optimal. Proof. We verify the hypotheses of Lemma E.10 for Vˇ≜ϕ V φ and ˇ≜⋆ u u . Regularity. Since tl>0t_l>0, βt2>0 _t^2>0 for every t∈[tl,T]t∈[t_l,T], so by the argument preceding Theorem E.3 both p(⋅∣ξ)p(· ξ) and p(⋅)p(·) are positive-everywhere and C1,∞C^1,∞ on [tl,T]×ℝm[t_l,T]×R^m; hence ϕ∈C1,∞([tl,T]×ℝm)φ∈ C^1,∞([t_l,T]×R^m). Stationarity. Fix (t,t)(t, x_t) and write ^0≜^0(t,t,ΩY) x_0 x_0(t, x_t, _Y), ∇ϕ≜∇tϕ(t,t)∇φ _ x_tφ(t, x_t) for brevity. As (t,t,t) b(t, x_t, u_t) is affine in t u_t and the only t u_t-dependence of L(t,t,t)L(t, x_t, u_t) is through −r(t)∥t−^0∥22-r(t) u_t- x_0 _2^2 (every remaining term of (55) depends on (t,t)(t, x_t) alone), the map H(t)≜L(t,t,t)−⟨∇ϕ,(t,t,t)⟩H( u_t) L(t, x_t, u_t)- ∇φ, b(t, x_t, u_t) is, as a function of t u_t, a strictly concave quadratic (since r(t)>0r(t)>0): H(t)=−r(t)∥t−^0∥22+12g(t)2αtβt2⟨∇ϕ,t⟩+C(t,t)H( u_t)=-r(t) u_t- x_0 _2^2+ 12 g(t)^2 _t _t^2 ∇φ, u_t +C(t, x_t) for some t u_t-independent C(t,t)C(t, x_t). Completing the square, H is maximised over ℝmR^m uniquely at 0≜^0+14g(t)2αtr(t)βt2∇ϕ u_0 x_0+ 14 g(t)^2 _tr(t) _t^2∇φ. As U(t)U(t) is nonempty, closed, and convex, the Hilbert-space projection theorem gives that H restricted to U(t)U(t) is maximised uniquely at projU(t)0=^0+projU(t)−^00−^0=^0+Υ(t,t)=t⋆.proj_U(t)\ u_0\= x_0+proj_U(t)- x_0\ u_0- x_0\= x_0+ (t, x_t)= u_t . HJB equation. It remains to show H(t⋆)=ϕt(t,t)H( u_t )= _t(t, x_t), i.e. that (52) holds at Vˇ=ϕ V=φ, t=t⋆ u_t= u_t . Writing A≜logp(t∣ξ)A p( x_t ξ), B≜logp(t)B p( x_t) (so ϕ=A−Bφ=A-B), the Kolmogorov forward equation for the canonical image diffusion of Definition E.1 gives, for either log-density, ∂tlogp=−f(t)(m+⟨t,∇logp⟩)+12g(t)2(∥∇logp∥22+Δlogp), _t p=-f(t) (m+ x_t,∇ p )+ 12g(t)^2 ( ∇ p _2^2+ p ), and subtracting the two copies (for A and B; the −f(t)m-f(t)m terms cancel, and ∥∇A∥22−∥∇B∥22=⟨∇A−∇B,∇A+∇B⟩=⟨∇ϕ,∇A⟩+⟨∇ϕ,∇B⟩ ∇ A _2^2- ∇ B _2^2= ∇ A-∇ B,∇ A+∇ B = ∇φ,∇ A + ∇φ,∇ B since ∇A−∇B=∇ϕ∇ A-∇ B=∇φ) gives ϕt(t,t)= _t(t, x_t)= −f(t)⟨t,∇ϕ⟩+12g(t)2⟨∇ϕ,∇tlogp(t∣ξ)⟩+12g(t)2⟨∇ϕ,∇tlogp(t)⟩ -f(t) x_t,∇φ + 12g(t)^2 ∇φ, _ x_t p( x_t ξ) + 12g(t)^2 ∇φ, _ x_t p( x_t) +12g(t)2Δϕ. + 12g(t)^2 φ. (58) On the other hand, substituting t⋆=^0+Υ u_t = x_0+ into b and using Tweedie’s formula (Theorem E.3) in the form αt^0=βt2∇tlogp(t)+t _t x_0= _t^2 _ x_t p( x_t)+ x_t (which follows from combining Theorem E.3 with (34) at ξ=ΩYξ= _Y), the ∓12g(t)2βt2t∓ 12 g(t)^2 _t^2 x_t terms cancel and ⟨∇ϕ,(t,t,t⋆)⟩=f(t)⟨t,∇ϕ⟩−12g(t)2⟨∇ϕ,∇tlogp(t)⟩−12g(t)2αtβt2⟨∇ϕ,Υ⟩. ∇φ, b(t, x_t, u_t ) =f(t) x_t,∇φ - 12g(t)^2 ∇φ, _ x_t p( x_t) - 12 g(t)^2 _t _t^2 ∇φ, . Substituting t=t⋆ u_t= u_t into (55) (so t⋆−^0=Υ u_t - x_0= , and the ∓r(t)∥Υ∥22∓ r(t) _2^2 terms cancel) and subtracting the expression above, H(t⋆) H( u_t ) =L(t,t,t⋆)−⟨∇ϕ,(t,t,t⋆)⟩ =L(t, x_t, u_t )- ∇φ, b(t, x_t, u_t ) =12g(t)2⟨∇ϕ,∇tlogp(t∣ξ)⟩−12g(t)2αtβt2⟨∇ϕ,Υ⟩+12g(t)2Δϕ = 12g(t)^2 ∇φ, _ x_t p( x_t ξ) - 12 g(t)^2 _t _t^2 ∇φ, + 12g(t)^2 φ −f(t)⟨t,∇ϕ⟩+12g(t)2⟨∇ϕ,∇tlogp(t)⟩+12g(t)2αtβt2⟨∇ϕ,Υ⟩ -f(t) x_t,∇φ + 12g(t)^2 ∇φ, _ x_t p( x_t) + 12 g(t)^2 _t _t^2 ∇φ, =−f(t)⟨t,∇ϕ⟩+12g(t)2⟨∇ϕ,∇tlogp(t∣ξ)⟩+12g(t)2⟨∇ϕ,∇tlogp(t)⟩ =-f(t) x_t,∇φ + 12g(t)^2 ∇φ, _ x_t p( x_t ξ) + 12g(t)^2 ∇φ, _ x_t p( x_t) +12g(t)2Δϕ, + 12g(t)^2 φ, where the ∓12g(t)2αtβt2⟨∇ϕ,Υ⟩∓ 12 g(t)^2 _t _t^2 ∇φ, terms cancel. This is precisely (58), so H(t⋆)=ϕt(t,t)H( u_t )= _t(t, x_t), and since t⋆ u_t maximises H over U(t)U(t), (52) holds at Vˇ=ϕ V=φ for every t∈[tl,T]t∈[t_l,T]. Boundary condition. Vˇ(tl,tl)=ϕ(tl,tl)=K(tl,tl) V(t_l, x_t_l)=φ(t_l, x_t_l)=K(t_l, x_t_l) by definition of K. The hypotheses of Lemma E.10 hold on [tl,T][t_l,T] with Vˇ=ϕ V=φ, ˇ=⋆ u= u . Since V^(t,t) V(t, x_t) depends, by Definition E.3, only on L,,KL, b,K restricted to [tl,t][t_l,t], these hypotheses (inherited by restriction) give ϕ(t,t)=V^(t,t)φ(t, x_t)= V(t, x_t) for every t∈(tl,T]t∈(t_l,T], not merely t=Tt=T; equality at t=tlt=t_l follows directly from the boundary condition. Hence ϕ=V^φ= V on [tl,T]×ℝm[t_l,T]×R^m, and ⋆ u is optimal. ∎ Corollary E.12 (Unconstrained CFG-Style Guidance). Under the hypotheses of Theorem E.11, if U(s)=ℝmU(s)=R^m for every s∈[tl,T]s∈[t_l,T], then Υ(t,t)=14g(t)2αtr(t)βt2∇tϕ(t,t) (t, x_t)= 14 g(t)^2 _tr(t) _t^2 _ x_tφ(t, x_t), and the optimal control (57) reduces to t⋆=^0(t,t,ΩY)+14g(t)2αtr(t)βt2∇tlog(p(t∣ξ)p(t)). u_t = x_0(t, x_t, _Y)+ 14 g(t)^2 _tr(t) _t^2 _ x_t ( p( x_t ξ)p( x_t) ). Proof. U(t)−^0(t,t,ΩY)=ℝmU(t)- x_0(t, x_t, _Y)=R^m, and projection onto ℝmR^m is the identity map. ∎