Introduction
Diffusion Transformers (DiTs) have emerged as the state-of-the-art backbone for visual generation, powering models like Stable Diffusion 3 (SD3), Sora, and FLUX.1. Despite their impressive generative capabilities, DiTs suffer from significant computational overhead. The primary bottleneck is the self-attention mechanism, which scales quadratically with the number of visual tokens. As image resolutions increase, the thousands of tokens required for high-fidelity generation make real-time inference prohibitively slow.
To address this, researchers have explored token reduction techniques such as merging or pruning redundant tokens. However, existing methods like ToMeSD or AT-EDM often employ static strategies that ignore the inherent temporal dynamics of the diffusion process. This paper introduces Structure-then-Detail Token Merging (SDTM), a post-training acceleration technique that dynamically prunes tokens by leveraging the "structure-then-detail" denoising prior, achieving significant speedups without the need for fine-tuning.
The Denoising Prior in DiTs
The fundamental insight behind SDTM is that diffusion models do not generate all image components simultaneously. By applying discrete wavelet transforms to the denoising process, the authors demonstrate that DiTs follow a strict temporal progression:
- Structure Formation: In the first ~40% of denoising steps, low-frequency components (global structure) change rapidly.
- Detail Refinement: In the remaining ~60% of steps, high-frequency components (fine details) are refined.
Existing token merging methods fail because they apply uniform pruning throughout these stages. In the early steps, redundancy is typically local (e.g., adjacent patches in a blurry background), while in later steps, redundancy becomes global and sparse (e.g., specific detailed areas that no longer require updates). SDTM adapts to this shift by "attending to what is not attended."
Methodology
SDTM is a training-free framework consisting of three core components designed to align token reduction with the denoising trajectory.
1. Two-Stage Visual Token Merging
Instead of a one-size-fits-all merging strategy, SDTM employs two distinct mechanisms:
- Similarity-prioritized Structure Merging (SSM): During the early structure-formation stage, the model identifies local tokens with high cosine similarity. These tokens—often representing flat or low-variance areas like backgrounds—are merged to reduce redundancy while preserving the emerging global layout.
- Inattentive-prioritized Detail Merging (IDM): During the later detail-refinement stage, the model switches to a global merging strategy. It utilizes the model's own attention maps to identify "inattentive" tokens—those that receive the least attention from other tokens. These tokens are considered less critical for fine-detail generation and are merged globally.
2. Compression Ratio Adjusting (CRA)
The amount of redundant information in a DiT naturally decreases as the image resolves. To account for this, SDTM utilizes Compression Ratio Adjusting (CRA), which dynamically reduces the merging ratio over time following a cosine decay. An advanced variant, SDTM*, further optimizes this by adaptively adjusting the threshold based on the specific complexity of the image being generated.
3. Prompt Token Reweighting (PTR)
A common side effect of token merging is the dilution of the text prompt's influence; with fewer visual tokens to interact with, the model may lose alignment with the user's description. SDTM introduces Prompt Token Reweighting (PTR) to counteract this. Using an LLM (e.g., ChatGPT) to pre-classify prompt words as either "structure" (e.g., "dog") or "detail" (e.g., "fluffy"), the system artificially boosts the attention weights of structure words in early steps and detail words in later steps. This ensures strict prompt adherence even under high compression.
Experimental Results
The authors evaluated SDTM on standard benchmarks, including MS-COCO 2017 and PartiPrompts, across various DiT architectures.
Performance and Quality
On Stable Diffusion 3 Medium, SDTM achieved a 1.55x speedup with virtually no impact on image quality. Quantitative metrics remained stable, with an FID of 28.97 (compared to the 29.02 baseline) and a CLIP score of 0.3237 (compared to 0.3267).
Comparison with State-of-the-Art
SDTM significantly outperforms existing training-free methods. At a 1.5x speedup level, competing methods like ToMeSD and AT-EDM experienced catastrophic quality degradation (ToMeSD's FID rose to 75.44). Remarkably, SDTM also outperformed several methods that require expensive fine-tuning, such as TokenCache and DyDiT, proving that intelligent post-training strategies can match or exceed the performance of training-based approaches.
Generalization
The method proved highly adaptable, successfully accelerating a wide range of models including SD3.5 Large, SD3.5 Large Turbo, and FLUX.1-dev. It also showed compatibility with various sampling schedulers, such as Rectified Flow and DPM-Solver++.
Conclusion
SDTM demonstrates that the efficiency of Diffusion Transformers can be significantly improved by respecting the temporal priors of the denoising process. By switching from local similarity merging to global inattentive merging and protecting prompt alignment through reweighting, SDTM provides a robust, training-free solution for DiT acceleration. Future work may involve combining SDTM with complementary techniques like progressive distillation to push the boundaries of real-time high-resolution image synthesis.
Summary updated