TL;DR
Dynamic Token Scheduling (DTSched) is a lightweight, plug-and-play framework that accelerates text-to-image diffusion models by dynamically selecting which text tokens are processed at each denoising step. By shifting the focus from model compression to input-adaptive conditioning, DTSched achieves up to a 1.68× speedup on Stable Diffusion while simultaneously improving text-image alignment and generation quality.
What Problem Does This Paper Address?
While text-to-image diffusion models generate stunning imagery, their iterative denoising process is computationally expensive. Most existing acceleration methods are model-centric—focusing on pruning network layers, quantizing weights, or caching features. However, these approaches overlook a major source of inefficiency: the conditioning mechanism itself.
Standard diffusion pipelines use a static conditioning strategy. When you give a model a prompt, the text encoder tokenizes and pads it to a fixed length (typically 77 tokens for CLIP). This full sequence of text embeddings is fed into the cross-attention layers uniformly at every single denoising step.
The authors identify two major flaws in this paradigm:
- Token-level semantic imbalance: Not all tokens contribute equally. Some tokens dominate the generation, while others (like padding tokens) add little value or even introduce distracting noise.
- Timestep-level variation in token relevance: The importance of a token changes as the image progresses from a noisy blob to a crisp picture. Treating all tokens as equally relevant across the entire trajectory results in redundant computation and dilutes crucial semantic cues.
Methods
To solve these inefficiencies, the authors introduce Dynamic Token Scheduling (DTSched), an input-adaptive framework that selectively schedules text conditioning across both tokens and timesteps based on prompt semantics.
The core components of DTSched include:
- Semantic-Aware Strategy Generator ($G$): A lightweight neural network (~20M parameters) consisting of two sub-networks: a timestep selector ($G_T$) that decides which denoising steps are essential, and a token selector ($G_C$) that predicts the most informative subset of tokens for a given step.
- Controllable Thresholding: Two hyperparameters, $\alpha$ and $\beta$, act as knobs to tune the trade-off between speed and quality. $\alpha$ controls how aggressively timesteps are skipped, while $\beta$ governs token sparsity.
- Pseudo-Label Training: Because there is no ground-truth dataset for "optimal token schedules," the authors constructed one using diffusion simulations. They greedily tested different token combinations at each step and selected the ones that maximized the image's alignment score (CLIPScore).
- Multi-Token Prediction (MTP): To ensure that token selection doesn't radically fluctuate from one step to the next, the generator is trained with an auxiliary loss that predicts the optimal token subset for the next timestep, enforcing temporal consistency.
By reducing the number of tokens passed to cross-attention layers at step $t$ from the full length $L$ to a subset $|c_t|$, the computational complexity of cross-attention drops from $O(L^2)$ to $O(|c_t|^2)$.
Datasets
The authors evaluated DTSched across several widely recognized benchmarks:
- COCO 2017 (Validation Set): Used to evaluate general text-image alignment and aesthetic quality.
- DiffusionDB: A large-scale prompt gallery dataset. A subset of 1,800 prompts was used to train the strategy generator, ensuring no overlap with evaluation splits.
- HPDv2 (Test Set): Used to benchmark human preference alignment.
- DrawBench: A challenging dataset designed to test models on complex semantic compositions, counting, and spatial relations.
Key Insights and Ideas
- The Surprising Benefit of Dropping Tokens: Counterintuitively, removing certain tokens can actually improve image quality. For instance, the authors found that omitting padding (
[PAD]) or content ([COT]) tokens at specific stages prevented the model from diluting key details, correcting issues like incorrect object counts or missing prompt elements. - Temporal Trajectories of Text: Different token types have distinct lifecycles. Start-of-text (
[SOT]) tokens dominate global semantics early on, but their relevance decreases over time. Conversely, content tokens ([COT]) and end-of-text ([EOT]) tokens become increasingly critical during the later stages of denoising to refine fine-grained details.
Key Results
DTSched was validated across multiple versions of Stable Diffusion (1.4, 1.5, 2.0, 2.1) and successfully extended to the Transformer-based PixArt-$\alpha$ architecture.
- Efficiency Gains: On DrawBench using Stable Diffusion 2.1, DTSched reduced latency from 4.35 seconds to 2.92 seconds, achieving a 1.50× speedup while reducing Multiply-Accumulate Operations (MACs) from 34.60T to 22.96T. On Stable Diffusion 2.0, it reached up to 1.68× acceleration.
- Quality Improvement: Unlike traditional acceleration methods that trade off quality for speed, DTSched consistently improved text-image alignment. It boosted the CLIPScore by +0.45 on Stable Diffusion 2.0 and yielded higher PickScores and HPDv2 scores across the board.
Limitations and Future Work
Currently, DTSched operates within a constrained search space defined by coarse-grained, predefined token-combination candidates. This means it cannot dynamically generate entirely arbitrary token subsets on the fly.
The authors note that exploring more expressive decision-making mechanisms—such as reinforcement learning or online policy optimization—could allow the framework to learn even more adaptive, fine-grained scheduling policies directly from model feedback.
Summary updated