arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.13545cs.CVcs.AI
收藏

ScaleLong:通过网络长跳跃连接缩放实现扩散模型更稳定训练

ScaleLong: Towards More Stable Training of Diffusion Model via Scaling Network Long Skip Connection

Sun Yat-Sen University(中山大学);Sea AI Lab(Sea人工智能实验室)

Zhongzhan Huang, Pan Zhou, Shuicheng Yan, Liang Lin

AI总结:

本文从理论上揭示了扩散模型中UNet长跳跃连接系数导致训练不稳定的机制,提出ScaleLong框架通过缩放LSC系数有效提升训练稳定性并实现约1.5倍加速。

摘要:

在扩散模型中,UNet是最受欢迎的网络主干,因为其连接远端网络块的长跳跃连接可以聚合长距离信息并缓解梯度消失。遗憾的是,UNet在扩散模型中常遭遇不稳定的训练,而通过缩小其LSC系数可以缓解这一问题。然而,目前仍缺乏对扩散模型中UNet不稳定性以及LSC缩放带来性能提升的理论理解。为了解决这一问题,我们从理论上证明了UNet中LSC的系数对前向和反向传播的稳定性及UNet的鲁棒性有很大影响。具体而言,UNet在任意层的隐藏特征和梯度都可能出现振荡,且其振荡范围实际上很大,这解释了UNet训练的不稳定性。此外,可证明UNet对扰动输入也很敏感,并预测出远离期望输出的结果,从而导致振荡的损失和振荡的梯度。另外,我们还观察到了UNet的LSC系数缩放在隐藏特征和梯度的稳定性以及鲁棒性方面的理论益处。最后,受我们的理论启发,我们提出了一种有效的系数缩放框架ScaleLong,该框架对UNet中的LSC系数进行缩放,从而更好地提升UNet的训练稳定性。在四个著名数据集上的实验结果表明,我们的方法在稳定训练方面具有优越性,并在使用UNet或UViT主干的不同扩散模型上实现了约1.5倍的训练加速。代码:https://github.com/sail-sg/ScaleLong

英文摘要:

In diffusion models, UNet is the most popular network backbone, since its long skip connects (LSCs) to connect distant network blocks can aggregate long-distant information and alleviate vanishing gradient. Unfortunately, UNet often suffers from unstable training in diffusion models which can be alleviated by scaling its LSC coefficients smaller. However, theoretical understandings of the instability of UNet in diffusion models and also the performance improvement of LSC scaling remain absent yet. To solve this issue, we theoretically show that the coefficients of LSCs in UNet have big effects on the stableness of the forward and backward propagation and robustness of UNet. Specifically, the hidden feature and gradient of UNet at any layer can oscillate and their oscillation ranges are actually large which explains the instability of UNet training. Moreover, UNet is also provably sensitive to perturbed input, and predicts an output distant from the desired output, yielding oscillatory loss and thus oscillatory gradient. Besides, we also observe the theoretical benefits of the LSC coefficient scaling of UNet in the stableness of hidden features and gradient and also robustness. Finally, inspired by our theory, we propose an effective coefficient scaling framework ScaleLong that scales the coefficients of LSC in UNet and better improves the training stability of UNet. Experimental results on four famous datasets show that our methods are superior to stabilize training and yield about 1.5x training acceleration on different diffusion models with UNet or UViT backbones. Code: https://github.com/sail-sg/ScaleLong

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑