[Paper Review] Timestep-Aware Block Masking for Efficient Diffusion Model Inference
Introduces per-timestep learned binary masks to skip computation in diffusion models, achieving faster sampling across DDPM, LDM, DiT, and PixArt with minimal quality loss. Masks are trained end-to-end per timestep using feature fidelity, sparsity, and bi-modal regularization with timestep-aware loss scaling and knowledge-guided rectification.
Diffusion Probabilistic Models (DPMs) have achieved great success in image generation but suffer from high inference latency due to their iterative denoising nature. Motivated by the evolving feature dynamics across the denoising trajectory, we propose a novel framework to optimize the computational graph of pre-trained DPMs on a per-timestep basis. By learning timestep-specific masks, our method dynamically determines which blocks to execute or bypass through feature reuse at each inference stage. Unlike global optimization methods that incur prohibitive memory costs via full-chain backpropagation, our method optimizes masks for each timestep independently, ensuring a memory-efficient training process. To guide this process, we introduce a timestep-aware loss scaling mechanism that prioritizes feature fidelity during sensitive denoising phases, complemented by a knowledge-guided mask rectification strategy to prune redundant spatial-temporal dependencies. Our approach is architecture-agnostic and demonstrates significant efficiency gains across a broad spectrum of models, including DDPM, LDM, DiT, and PixArt. Experimental results show that by treating the denoising process as a sequence of optimized computational paths, our method achieves a superior balance between sampling speed and generative quality. Our code will be released.
Motivation & Objective
- Motivate reducing inference cost in diffusion models by exploiting stable feature dynamics across timesteps.
- Propose a per-timestep binary mask framework to skip or reuse block computations without retraining the base models.
- Ensure memory-efficient training by optimizing masks independently for each timestep.
- Incorporate timestep-aware loss scaling and a knowledge-guided mask rectification to maintain generation quality.
Proposed method
- Train a T×B binary mask m, where t indexes timesteps and b indexes network blocks, to decide if a block is computed or its cached feature is reused.
- Freeze diffusion model parameters and optimize the mask per timestep using end-to-end training with a feature fidelity loss to match the original model.
- Use continuous relaxation s in [0,1] for m with L1 sparsity and bi-modal regularization to encourage binarization of s.
- Introduce timestep-aware loss weighting based on feature variation delta[t] to prioritize fidelity during sensitive denoising phases.
- Apply a knowledge-guided post-processing rule to rectify masks by propagating dependencies across blocks and timesteps to further accelerate inference.
- Provide an architecture-agnostic approach applicable to UNet-like CNNs and diffusion transformers (e.g., MHA/MLP in DiT, ResBlock/AttnBlock in U-Net).
Experimental results
Research questions
- RQ1Can per-timestep masking accelerate diffusion model inference without retraining the original model?
- RQ2How to train such masks efficiently to preserve generation quality while achieving high speedups?
- RQ3What role do timestep-aware loss and mask rectification play in maintaining fidelity while maximizing acceleration?
- RQ4Is the method universal across different diffusion architectures (DDPM, LDM, DiT, PixArt) and datasets?
Key findings
- Achieves meaningful speedups across multiple architectures: 1.63× on CIFAR-10 with DDPM, 1.31×–1.63× on LSUN variants, and 2.75× on ImageNet with LDM-4-G, with competitive FID/IS metrics.
- On CIFAR-10, LSUN-Bedroom, and LSUN-Churches, our method consistently improves speed while preserving or slightly improving FID compared to baselines (DeepCache, Diff-Pruning, CT).
- For DiT-XL/2 on ImageNet, our method matches or exceeds L2C in accuracy while offering faster acceleration (1.67× on 256×256, competitive on 512×512).
- Ablations show random mask sampling outperforms Gumbel-Softmax for this setting; mask rectification and timestep-aware loss scaling significantly boost speedups with minimal quality loss.
- Mask values concentrate near 0 or 1 in trained models, indicating stable, decisive block-skipping decisions.
- The method requires only Gaussian noise as input for mask training and does not modify pretrained model weights.
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.