[Paper Review] ScaleLong: Towards More Stable Training of Diffusion Model via Scaling Network Long Skip Connection
This paper proposes ScaleLong, a framework that stabilizes training in diffusion models by scaling the coefficients of U-Net's long skip connections (LSCs). Theoretically, it shows that large LSC coefficients cause feature and gradient oscillations, and empirically demonstrates that coefficient scaling reduces oscillations and accelerates training by up to 1.5× across multiple datasets and architectures.
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
Motivation & Objective
- To understand why U-Net training in diffusion models is unstable despite its long skip connections.
- To theoretically explain the stabilizing effect of LSC coefficient scaling, particularly the $1/\sqrt{2}$-scaling technique.
- To develop a principled framework that improves training stability and convergence speed in diffusion models.
- To empirically validate that scaling LSC coefficients reduces feature and gradient oscillations and accelerates training.
Proposed method
- Theoretically derives bounds on hidden feature and gradient norms in U-Net, showing oscillation ranges scale with $\mathcal{O}(m\sum_{i=1}^{N}\kappa_i^2)$, where $\kappa_i$ are LSC coefficients.
- Proves that robustness of U-Net to input perturbations is bounded by $\mathcal{O}(\sum_{i=1}^{N}\kappa_i M_0^i)$, with $M_0 > 1$ indicating instability risk.
- Proposes ScaleLong, a framework that applies adaptive coefficient scaling to LSCs to reduce oscillation ranges and improve training stability.
- Empirically validates the theoretical bounds using feature visualization and gradient tracking across CIFAR10, CelebA, and ImageNet64.
- Introduces two novel yet effective coefficient scaling methods within ScaleLong that outperform the $1/\sqrt{2}$-scaling baseline.
- Uses ablation studies to show that $\kappa > 1$ exacerbates instability, especially with small batch sizes, while $\kappa \in (0,1)$ ensures stability.
Experimental results
Research questions
- RQ1Why does U-Net exhibit unstable training in diffusion models despite its long skip connections?
- RQ2How do the coefficients of long skip connections affect the stability of forward and backward propagation in U-Net?
- RQ3What is the theoretical basis for the stabilizing effect of $1/\sqrt{2}$-scaling on LSC coefficients?
- RQ4Can a principled coefficient scaling framework improve training stability and convergence speed beyond empirical heuristics?
- RQ5How does the robustness of U-Net to input perturbations depend on LSC coefficients?
Key findings
- The oscillation range of hidden features and gradients in U-Net is $\mathcal{O}(mN)$ when $\kappa_i = 1$, explaining observed instability during training.
- Scaling LSC coefficients to $1/\sqrt{2}$ reduces the oscillation range and improves training stability, but does not fully eliminate instability.
- Theoretical bounds show that gradient magnitude is upper-bounded by $\mathcal{O}(m\sum_{i=1}^{N}\kappa_i^2)$, which is large when $\kappa_i = 1$, leading to unstable parameter updates.
- Robustness of U-Net to input perturbations is bounded by $\mathcal{O}(\sum_{i=1}^{N}\kappa_i M_0^i)$, with $M_0 > 1$, indicating sensitivity to small input changes.
- ScaleLong reduces feature and gradient oscillations, leading to a 1.5× acceleration in training across multiple diffusion models with UNet or UViT backbones.
- Experiments confirm that $\kappa > 1$ causes rapid training collapse, especially under small batch sizes, validating the theoretical domain restriction $\kappa \in (0,1)$.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.