CACFG:用曲率约束改进 CFG 高强度引导下的扩散采样
CACFG: Curvature-Aware Classifier-Free Guidance and Optimal Control
扩散模型用 CFG 时强度调高就容易崩,这篇把原因讲清楚了,还给出一个超球面约束的修法,做生成模型的话值得跑跑代码对比。
arXiv 论文提出 CACFG(curvature-aware CFG),将 classifier-free guidance 重新表述为连续时间最优控制问题。作者求解 Hamilton-Jacobi-Bellman 方程,证明 CFG 对应无约束控制集下的特解,并认为这种无约束正是高引导强度下画质退化的原因。CACFG 把控制集限制在由 VAE 高斯正则化导出的超球面上,实验显示在中高强度引导下生成质量优于普通 CFG,质量-多样性权衡更缓和。
CACFG: Curvature-Aware Classifier-Free Guidance and Optimal Control
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.