Abstract
Diffusion models have become the standard for high-fidelity image generation but suffer from high computational costs due to their iterative denoising process. We present ALTER (All-in-One Layer Pruning and Temporal Expert Routing), a framework that transforms diffusion models into a dynamic mixture of "temporal experts." By routing specific denoising timesteps to specialized, pruned sub-networks through a unified single-stage optimization, ALTER achieves a 3.64× speedup and utilizes only ~26% of the original computational cost while maintaining or even improving the visual fidelity of Stable Diffusion v2.1.
Introduction
While diffusion models like Stable Diffusion produce state-of-the-art results, their deployment on edge devices is hindered by the "heavy" nature of their UNet backbones, which must be executed repeatedly. Current acceleration strategies typically focus on either reducing the number of sampling steps or compressing the model through static pruning. However, static pruning removes the same layers across all steps, failing to account for the varying complexity of the denoising process—where early steps establish global structure and later steps refine fine textures.
Methodology
ALTER addresses these inefficiencies by treating the diffusion model as a collection of specialized sub-networks tailored to different stages of the denoising trajectory.
The ALTER Framework
The core of the system is a Hypernetwork ($H_\Phi$) composed of two primary modules:
- Expert Generator: This module generates $N_e$ unique binary pruning masks. Each mask defines a "temporal expert"—a specific configuration of the UNet where certain layers are skipped to save computation.
- Temporal Router: This module receives the current timestep embedding and dynamically selects the most appropriate expert for that phase of denoising.
Single-Stage Co-Optimization
Unlike traditional "prune-then-fine-tune" workflows, ALTER employs a single-stage optimization where the UNet backbone and the hypernetwork are updated simultaneously. This allows the sub-networks to co-adapt with the evolving backbone weights. To handle the discrete nature of layer skipping and expert selection, the authors utilize Gumbel-Sigmoid and Gumbel-Softmax tricks with a Straight-Through Estimator (STE), making the entire process differentiable.
Experimental Results
The model was trained on a 0.3M subset of LAION-Aesthetics V2 and evaluated on CC3M and MS-COCO datasets.
Efficiency and Quality
ALTER demonstrates significant performance gains over both the base Stable Diffusion v2.1 and other state-of-the-art compression methods like BK-SDM and APTP.
- Efficiency: ALTER achieved a 3.64× speedup and reduced total MACs (Multiply-Accumulate operations) to just 25.9% of the 50-step original model.
- Quality: On the MS-COCO dataset, ALTER (at 20 steps) achieved an FID of 13.89, actually outperforming the original 50-step SD v2.1 (FID 14.29) while being significantly faster.
- Sparsity: The framework successfully maintains a 35% layer-wise sparsity without the artifacts common in static pruning.
Discussion and Conclusion
A key insight of this work is that temporal asymmetry is fundamental to diffusion. By allowing the architecture to be "lean" during simpler phases and "full-powered" during complex ones, ALTER maximizes efficiency without sacrificing quality. Unlike sample-wise dynamic methods that choose a sub-network based on the prompt, ALTER leverages the timestep axis, ensuring the entire model capacity is utilized effectively across the generation trajectory.
While ALTER requires a final "clean-up" fine-tuning stage to reach peak performance, it represents a significant step toward making high-quality diffusion models viable for real-time and resource-constrained applications.
Summary updated