Abstract
Diffusion models achieve great success in generating diverse and high-fidelity images. The performance improvements come with low generation speed per image, which hinders the application diffusion models in real-time scenarios. While some certain predictions benefit from the full computation of the model in each sample iteration, not every iteration requires the same amount of computation, potentially leading to computation waste. In this work, we propose DeeDiff (also referred to as AdaDiff), an early exiting framework that adaptively allocates computation resources in each sampling step to improve the generation efficiency of diffusion models. Specifically, we introduce a timestep-aware uncertainty estimation module (UEM) for diffusion models which is attached to each intermediate layer to estimate the prediction uncertainty of each layer. The uncertainty is regarded as the signal to decide if the inference terminates. Moreover, we propose uncertainty-aware layer-wise loss to fill the performance gap between full models and early-exited models. With such loss strategy, our model is able to obtain comparable results as full-layer models. Extensive experiments of class-conditional, unconditional, and text-guided generation on several datasets show that our method achieves state-of-the-art performance and efficiency trade-off compared with existing early exiting methods on diffusion models.
Introduction
While diffusion models produce state-of-the-art images, they are notoriously slow. Their "progressive denoising" process requires passing an image through a deep neural network hundreds or even thousands of times. Most research focuses on reducing the number of sampling steps. However, AdaDiff addresses a different bottleneck: the redundancy within the network itself.
The authors observed that in many sampling steps, the intermediate representations of an image stabilize long before reaching the final layer. Using the full depth of the model for every single iteration is computationally wasteful. The challenge lies in determining exactly when it is safe to "exit" the network early without accumulating errors that ruin the final image.
The Plateau Effect
Analysis of the Mean Squared Error (MSE) between intermediate layers and the final output shows a sharp drop followed by a plateau across various datasets. This confirms that shallow layers often have the capacity to generate results comparable to deeper layers, providing a strong motivation for dynamic early exiting.
Methodology
The AdaDiff framework consists of two primary innovations designed to enable adaptive computation:
- Timestep-Aware Uncertainty Estimation Module (UEM): Unlike classification models that use "confidence" to exit early, diffusion models perform regression (predicting noise). AdaDiff attaches a lightweight UEM to each layer. This module takes the current layer's output and the specific timestep as input to predict the "uncertainty" of the current prediction. If the uncertainty falls below a predefined threshold $\theta$, the model terminates the current step's inference and moves to the next denoising iteration.
- Uncertainty-Aware Layer-wise Loss (UAL): Training a model to exit early is difficult because shallow layers aren't naturally as accurate as deep ones. The authors introduced a new loss function that weights layer-wise predictions based on their estimated uncertainty. This forces the model to retain more information in fewer layers, bridging the performance gap between the adaptive version and the full-depth original.
The framework is "backbone-agnostic," meaning it can be integrated into both Convolutional Neural Networks (CNNs) and Transformers (like U-ViT).
Key Results and Insights
AdaDiff significantly outperforms existing early-exiting techniques (like BERTxiT or CALM) which often see massive quality degradation when pushed for efficiency.
- Efficiency and Quality: The method achieved a reduction in GFLOPs and average layers used by approximately 40% to 47% across all datasets. On CIFAR-10, AdaDiff reached an FID of 3.7 with a 47.7% layer reduction, whereas other methods saw FID scores jump to 20+ for similar savings.
- Text-to-Image Performance: On MS-COCO, it maintained a strong FID of 7.4 while cutting computation by 43.6%.
- Synergy with Samplers: Adaptive computation is complementary to fast samplers like DPM-Solver. Users can reduce the number of steps and the cost of each step simultaneously for compound speedups.
- Better than Pruning: Unlike static structural pruning, which removes layers permanently, AdaDiff keeps the layers available for "hard" samples or critical timesteps while skipping them for "easy" ones.
Conclusion and Future Work
AdaDiff demonstrates that dynamic layer skipping is a viable path for accelerating diffusion models without sacrificing image fidelity. However, the authors noted a "60% ceiling": pushing efficiency beyond a 60% reduction causes image quality (FID) to drop more sharply, suggesting a fundamental limit to how much information can be compressed into the shallowest layers. Future work could explore "width" adaptation (skipping channels) or more complex adaptive sampling steps to further push the boundaries of generative efficiency.
Summary updated