通过交换词元引导扩散模型
Guiding a Diffusion Model by Swapping Its Tokens
把 CFG 的「条件-无条件」差分替换为「干净预测-词元交换扰动预测」的差分,使无条件和条件扩散模型都能在推理阶段获得保真度提升,且无需训练、可直接插入任意扩散模型。
原文依据 The key idea is to generate a perturbed prediction via simple token swap operations, and use the direction between it and the clean prediction to steer sampling
摘要译文
由模型翻译 · 术语统一 · 请对照原文核对关键结论无分类器引导(CFG)是一种广泛使用的推理阶段技术,用于提升扩散模型的图像质量。然而,它对文本条件的依赖使其无法用于无条件生成。我们提出一种简单方法,使类 CFG 引导能够同时用于条件生成与无条件生成。其核心思想是通过简单的词元交换操作生成一个扰动预测,并利用该预测与干净预测之间的方向来引导采样走向更高保真度的分布。在实践中,我们在空间或通道维度上交换语义最不相似的一对词元潜变量。与在全局或约束较弱的方式下施加扰动的现有方法不同,我们的方法有选择地交换并重组词元潜变量,从而对扰动及其对生成样本的影响实现更精细的控制。在 MS-COCO 2014、MS-COCO 2017 和 ImageNet 数据集上的实验表明,所提出的自交换引导(SSG)应用于常用扩散模型时,在不同设置下于图像保真度和提示词对齐方面均优于以往的无条件方法。其细粒度的扰动粒度还提升了鲁棒性,在更广的扰动强度范围内减少了副作用。总体而言,SSG 将 CFG 扩展到包括条件生成与无条件生成在内的更广泛应用范围,并且可以作为一种即插即用模块轻松插入任意扩散模型,从而立即获得改进。
英文原文摘要 1481 字符
Classifier-Free Guidance (CFG) is a widely used inference-time technique to boost the image quality of diffusion models. Yet, its reliance on text conditions prevents its use in unconditional generation. We propose a simple method to enable CFG-like guidance for both conditional and unconditional generation. The key idea is to generate a perturbed prediction via simple token swap operations, and use the direction between it and the clean prediction to steer sampling towards higher-fidelity distributions. In practice, we swap pairs of most semantically dissimilar token latents in either spatial or channel dimensions. Unlike existing methods that apply perturbation in a global or less constrained manner, our approach selectively exchanges and recomposes token latents, allowing finer control over perturbation and its influence on generated samples. Experiments on MS-COCO 2014, MS-COCO 2017, and ImageNet datasets demonstrate that the proposed Self-Swap Guidance (SSG), when applied to popular diffusion models, outperforms previous condition-free methods in image fidelity and prompt alignment under different set-ups. Its fine-grained perturbation granularity also improves robustness, reducing side-effects across a wider range of perturbation strengths. Overall, SSG extends CFG to a broader scope of applications including both conditional and unconditional generation, and can be readily inserted into any diffusion model as a plug-in to gain immediate improvements.