改进扩散模型的无分类器引导,提升生成质量。
Improving Classifier-Free Guidance in Masked Diffusion: Low-Dim Theoretical Insights with High-Dim Impact
- 从低维掩码扩散模型出发,分析引导调度对生成的影响。
- 早期高引导损害质量,晚期引导提升效果,现有方法存在不平衡过渡问题。
- 提出简单有效的改进方案,仅需一行代码,适用于图像与文本生成任务。
无分类器引导(CFG)是连续扩散模型中用于条件生成和提升样本质量的常用技术,其在离散扩散模型中的扩展也正被研究。为更严谨地改进算法,本文首先在低维掩码扩散模型背景下,深入分析了CFG的作用机制,重点关注引导调度策略。分析表明:采样初期(输入高度掩码时)过早施加高引导会损害生成质量,而后期引导则能有效提升质量。该发现为近期关于引导调度的实证观察提供了理论解释。此外,分析揭示了当前CFG实现中的缺陷——可能导致不均衡的解掩码过程,如早期解掩码过快,从而降低样本质量。基于此,我们提出一种新的无分类器引导机制:通过平滑数据分布与初始(掩码)分布间的传输路径,改善生成质量。该方法仅需一行代码即可实现。在条件图像和文本生成任务上的实验验证了其有效性。
原文摘要 · Abstract (English)
Classifier-Free Guidance (CFG) is a widely used technique for conditional generation and improving sample quality in continuous diffusion models, and its extensions to discrete diffusion has recently started to be investigated. In order to improve the algorithms in a principled way, this paper starts by analyzing the exact effect of CFG in the context of a low-dimensional masked diffusion model, with a special emphasis on the guidance schedule. Our analysis shows that high guidance early in sampling (when inputs are heavily masked) harms generation quality, while late-stage guidance improves it. These findings provide a theoretical explanation for empirical observations in recent studies on guidance schedules. The analysis also reveals an imperfection of the current CFG implementations. These implementations can unintentionally cause imbalanced transitions, such as unmasking too rapidly during the early stages of generation, which degrades the quality of the resulting samples. To address this, we draw insight from the analysis and propose a novel classifier-free guidance mechanism. Intuitively, our method smooths the transport between the data distribution and the initial (masked) distribution, resulting in improved sample quality. Remarkably, our method is achievable via a simple one-line code change. Experiments on conditional image and text generation empirically confirm the efficacy of our method.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。