You Only Look One Step:利用梯度捷径加速扩散采样中的反向传播
You Only Look One Step: Accelerating Backpropagation in Diffusion Sampling with Gradient Shortcuts
AI总结:
针对扩散模型生成中全链路反向传播成本高的问题,本文提出 SDO,仅保留单步计算图传播梯度,可优化各类采样参数,成本降低约90%且性能更优。
摘要:
扩散模型(DMs)最近在建模大规模数据分布方面展现出显著成功。然而,许多下游任务需要根据特定的可微指标引导生成内容,这通常要求在生成过程中进行反向传播。该方法在计算上代价高昂,因为使用 DMs 生成往往需要数十到数百次递归网络调用,从而导致较高的内存占用和大量时间消耗。本文提出一种更高效的替代方案,从并行去噪的角度处理该问题。我们表明,没有必要在整个生成过程中进行完整反向传播。通过在生成期间仅保留一步的计算图,从而为梯度传播提供捷径,即可优化下游指标。由此得到的方法称为 Shortcut Diffusion Optimization(SDO,捷径扩散优化),具有通用性、高性能和计算轻量性,能够优化扩散采样中的所有参数类型。我们在多项真实任务上证明了 SDO 的有效性,包括通过优化潜变量来控制生成,以及通过微调网络参数来对齐 DMs。与完整反向传播相比,本方法将计算成本降低约 90%,同时保持优异性能。代码可在 https://github.com/deng-ai-lab/SDO 获取。
英文摘要:
Diffusion models (DMs) have recently demonstrated remarkable success in modeling large-scale data distributions. However, many downstream tasks require guiding the generated content based on specific differentiable metrics, typically necessitating backpropagation during the generation process. This approach is computationally expensive, as generating with DMs often demands tens to hundreds of recursive network calls, resulting in high memory usage and significant time consumption. In this paper, we propose a more efficient alternative that approaches the problem from the perspective of parallel denoising. We show that full backpropagation throughout the entire generation process is unnecessary. The downstream metrics can be optimized by retaining the computational graph of only one step during generation, thus providing a shortcut for gradient propagation. The resulting method, which we call Shortcut Diffusion Optimization (SDO), is generic, high-performance, and computationally lightweight, capable of optimizing all parameter types in diffusion sampling. We demonstrate the effectiveness of SDO on several real-world tasks, including controlling generation by optimizing latent and aligning the DMs by fine-tuning network parameters. Compared to full backpropagation, our approach reduces computational costs by $\sim 90\%$ while maintaining superior performance. Code is available at https://github.com/deng-ai-lab/SDO.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。