TL;DR
Diffusion models are powerful but slow to generate samples. This paper introduces DuoDiff, a dual-backbone approach that uses a shallow network for early, easy steps and a deeper network for later, harder steps, significantly speeding up generation without sacrificing quality.
What Problem Does This Paper Address?
Diffusion models have revolutionized generative tasks, producing impressive images, videos, and more. However, their iterative nature means generating a single sample requires many sequential calls to a denoising network, making inference slow. While methods like early-exiting aim to speed this up by allowing the network to stop processing early if a sample is deemed "easy," the authors observed a consistent pattern: early-exiting predominantly happens in the initial stages of the diffusion process, followed by a sudden switch to using the full network. This suggests a fixed, two-stage approach might be more efficient than dynamic, per-sample early-exiting.
Methods
The core idea of DuoDiff is to exploit the observed "phase transition" in diffusion model inference. Instead of dynamically deciding when to exit for each sample, DuoDiff employs a static, dual-backbone architecture:
- Shallow Backbone: Used for the initial sampling steps (when
tis large). This network is designed to be computationally lighter. - Full Backbone: Used for the later sampling steps (when
tis small). This is the standard, deeper network.
Both backbones are trained from scratch on the same dataset using the same diffusion objective. The key innovation is the fixed transition point (ts) between the shallow and full backbones, which is determined after training. This static approach simplifies implementation and avoids the batching inefficiencies of dynamic early-exit methods.
Datasets
The authors evaluated DuoDiff on several standard datasets:
- CIFAR-10: 32x32 images for unconditional generation.
- CelebA: 64x64 images for unconditional generation.
- ImageNet: 64x64 and 256x256 images for class-conditional generation. For the 256x256 resolution, diffusion was performed in latent space.
Key Insights and Ideas
- Consistent Early-Exit Pattern: The most crucial insight is the discovery of a predictable "phase transition" in diffusion model inference. Early-exiting is not random but consistently occurs in the initial, "easier" steps of the denoising process.
- Static Dual-Backbone Efficiency: This consistent pattern suggests that a static, two-stage approach (shallow then deep) can be more efficient than dynamic, per-sample early-exiting, which can introduce overhead and batching issues.
- DuoDiff's Simplicity and Complementarity: DuoDiff is presented as an easy-to-implement method that can be combined with other acceleration techniques like DDIM and latent diffusion.
Key Results
- Inference Speed: DuoDiff significantly outperforms AdaDiff (a leading early-exit method) in inference speed across various datasets and resolutions. For example, on ImageNet 256x256, DuoDiff achieved a FID score of 32 with a computational budget of 7s per sample, while AdaDiff achieved a FID of 57.
- Image Quality: Despite the speedup, DuoDiff maintains competitive image quality. While increasing the shallow backbone's usage (
ts) or AdaDiff's threshold (θ) generally leads to lower FID scores, DuoDiff's decline in quality is less severe. - Compatibility: DuoDiff works seamlessly with DDIM sampling and latent diffusion, further enhancing its applicability.
Limitations and Future Work
- Hyperparameter Tuning: The paper notes that increasing the threshold hyperparameters (
θfor AdaDiff,tsfor DuoDiff) leads to faster inference but degrades image quality. They suggest future work could focus on more principled mechanisms for selecting these thresholds. - Shallow Backbone Depth: Future research could explore increasing the number of layers in the shallow transformer to potentially increase the effective
tswithout sacrificing too much efficiency. - Alternative Parametrizations: Investigating early-exit trends with different diffusion model parametrizations (e.g., predicting the original image instead of noise) is also suggested.
- Batching Inefficiencies (AdaDiff): The paper highlights that AdaDiff's dynamic early-exit makes batch inference challenging, and they had to resort to approximations for measuring its inference time. DuoDiff's static approach avoids this issue.
Summary updated