NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rethinking Token-wise Feature Caching: Accelerating Diffusion Transformers with Dual Feature Caching

Chang Zou, Shikang Zheng, Evelyn Zhang, Runlin Guo, Haohang Xu, Zhengyi Shi, Conghui He, Xuming Hu, Linfeng Zhang · DOI

TL;DR

DuCa (Dual Feature Caching) significantly accelerates Diffusion Transformers (DiTs) by alternating between aggressive and conservative feature caching across timesteps. Crucially, the paper debunks the need for complex "important token" selection heuristics, showing that simple random token selection yields superior generation quality while restoring compatibility with FlashAttention for a massive real-world latency speedup.

What Problem Does This Paper Address?

Diffusion Transformers (DiTs)—powering state-of-the-art models like FLUX and OpenSora—deliver incredible visual generation quality but come with massive computational costs. To speed up inference, researchers use feature caching, which reuses network activations from previous denoising timesteps to skip expensive layer computations in subsequent steps.

However, existing caching methods face a strict trade-off:

  • Aggressive Caching: Skips entire layers across multiple steps. While fast, errors accumulate exponentially, severely degrading image/video quality.
  • Conservative Caching (e.g., Token-wise Caching / ToCa): Computes only a subset of "important" tokens during cache steps to correct errors. While it preserves quality, calculating token "importance" requires analyzing attention maps. This introduces a heavy $O(N^2)$ memory/compute overhead and breaks compatibility with hardware-optimized kernels like FlashAttention, severely limiting actual wall-clock speedups.

The authors set out to answer two fundamental questions: Is it truly necessary to compute these "important" tokens at every step, and are they actually important?

Methods

The authors introduce DuCa (Dual Feature Caching), which optimizes the caching pipeline through two main innovations:

  1. Alternating Caching Strategy: Instead of sticking to one caching style, DuCa dynamically alternates. It initializes with a full computation step, executes a highly efficient one-step aggressive cache (skipping almost all layers), and follows it with a one-step conservative cache to correct the accumulated error.
Fig. 1. Comparison between conservative caching (a) and aggressive caching (b): Conservative caching skips some tokens instead of all tokens in each layer to maintain the generation quality, but also leads to lower acceleration ratios. t and t −1 denote the refreshing and caching timesteps, respectively.
  1. Random Token Selection: Instead of using complex, slow metrics to rank token importance, DuCa simply selects tokens to compute randomly during the conservative caching phase. This completely bypasses the need for attention-map extraction.
Overview of DuCa framework

Datasets

The authors evaluated DuCa across several prominent open-source generative models and benchmarks:

  • Text-to-Image: FLUX.1-dev, HiDream, and PixArt-α, evaluated using DrawBench (for image quality via Image Reward) and GenEval (for text-image alignment).
  • Text-to-Video: OpenSora, evaluated using the VBench framework across 16 distinct metrics.
  • Class-Conditional Image Generation: DiT-XL/2 trained on ImageNet (evaluated via FID-50k, sFID, Precision, and Recall).

Key Insights and Ideas

  • The First Step is "Free": The authors observed that immediately after a fresh computation step, the error difference between aggressive and conservative caching is negligible. Constantly calculating token importance at every single step is wasteful; you only need to correct errors periodically.
  • Diversity Beats "Importance": Surprisingly, selecting tokens based on the highest attention scores often performed worse than random selection. The authors discovered that token selection shouldn't focus on semantic "importance," but rather on minimizing duplication. Random selection naturally ensures a semantically diverse subset of tokens is processed, which provides a better error-correction signal to the cache.
  • Unlocking FlashAttention: By switching to random token selection, DuCa eliminates the $O(N^2)$ overhead of tracking attention scores. This makes the algorithm fully compatible with FlashAttention, turning theoretical FLOP reductions into massive real-world wall-clock speedups.

Key Results

DuCa consistently outperformed previous state-of-the-art training-free acceleration methods:

  • FLUX.1-dev: Achieved a 3.45× FLOPs reduction and a 2.93× actual latency speedup (compared to ToCa’s modest 1.59× speedup) with virtually lossless image quality and text alignment.
  • OpenSora (Video): Generated 480p videos in just 19.16 seconds (a 2.50× speedup), outperforming ToCa (29.03s) while achieving the highest VBench score (78.83) among all accelerated baselines.
  • ImageNet (DiT-XL/2): Delivered a lower (better) FID score (2.84) at a 2.48× speedup compared to ToCa's attention-based variant (2.88 FID).

Limitations and Future Work

While DuCa provides an excellent training-free plug-and-play acceleration framework, it relies on two primary hyperparameters: the cycle length ($N$) and the cache ratio ($R$). Ablation studies showed that $N=5$ and $R=0.9$ yield the best trade-off for FLUX, but these parameters may still require manual tuning when adapting DuCa to entirely new model architectures or distinct downstream tasks. Future work could explore automated or adaptive schedules for these parameters during the denoising process.

Summary updated

BibTeX
@misc{zou2024rethinking,
  author = {Chang Zou and Shikang Zheng and Evelyn Zhang and Runlin Guo and Haohang Xu and Zhengyi Shi and Conghui He and Xuming Hu and Linfeng Zhang},
  title = {{Rethinking Token-wise Feature Caching: Accelerating Diffusion Transformers with Dual Feature Caching}},
  year = {2024},
  eprint = {2412.18911},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.18911},
}
Figure