SpecDiff: Accelerating Diffusion Model Inference with Self-Speculation

Jiayi Pan, Jiaming Xu, Yongkang Zhou, Guohao Dai

TL;DR

SpecDiff is a training-free acceleration framework that speeds up Diffusion Transformer (DiT) inference by 2.7x to 3.2x with negligible loss in image quality. It breaks the traditional speed-accuracy trade-off by introducing "self-speculation"—running a few-step denoising process in advance to "peek into the future" and more accurately decide which features can be cached and reused.

What Problem Does This Paper Address?

Modern diffusion models like Stable Diffusion 3 and FLUX produce stunning results but are computationally expensive due to their iterative denoising process. Each step requires running a massive transformer backbone, leading to high latency.

To solve this, researchers use feature caching: identifying "unimportant" tokens and reusing their calculations from previous steps. However, existing methods rely solely on historical information (what happened in previous steps). The authors point out a critical flaw: history is a poor predictor of the future in diffusion processes, especially when an image undergoes "mutations" during denoising. Relying only on the past leads to a "Pareto bottleneck" where you can't get more speed without a massive drop in image quality.

Methods

SpecDiff introduces a novel paradigm called Self-Speculation. Instead of just looking backward, it looks forward.

  1. Self-Speculative Information: The system runs a "mini" version of the denoising process (with very few steps) in advance. Because the information at the same time-step across different iteration counts is highly similar, this "speculative" run provides a roadmap of which tokens will be important in the full-quality run.
  2. Token Hierarchy Algorithm (T1): It calculates a dynamic importance score for every token by combining:
  3. Historical scores (attention from the previous step).
  4. Speculative scores (attention from the "future" speculative run).
  5. Starvation scores: A clever mechanism that tracks how often a token has been cached. If a token is cached too many times, its "starvation" increases, forcing the model to recompute it to prevent cumulative errors.
  6. Multi-level Feature Classification (T2): Based on the importance scores, tokens are split into three tiers:
  7. C1 (Compute): High-importance tokens that undergo full network computation.
  8. C2 (Reuse): Very low-importance tokens that directly copy features from the previous step.
  9. C3 (Approximate): Medium-importance tokens that use a weighted average of the features from the last three steps to approximate the current value.

Datasets

The authors evaluated SpecDiff using:

  • Models: Stable Diffusion 3 (SD3), Stable Diffusion 3.5, and FLUX.1 Dev.
  • Data: 5,000 text-image pairs randomly selected from the COCO 2014 validation set.
  • Metrics: FID (Fréchet Inception Distance), Clip Score (text-alignment), and VQA Score (visual quality), along with SSIM and PSNR for consistency.

Key Insights and Ideas

  • The 50% Prediction Gap: The authors found that historical data can only predict about 50% of the truly important tokens in a given step. Speculation fills this gap, allowing the model to identify "future-important" tokens that history would have missed.
  • Skewed Importance: Token importance follows a long-tail distribution. About 25% of tokens account for 75% of the "importance," meaning most of the image can be cached if you pick the right 25% to compute.
  • Weighted History is Better than Static History: For tokens that aren't fully computed, using a weighted approximation of the last three steps (based on time-step similarity) is significantly more accurate than simply copying the immediate previous step.
  • Minimal Overhead: The "speculation" steps are so lightweight that they add less than 5% to the total inference time and less than 0.1% to memory usage, yet they enable massive savings in the main computation.

Key Results

SpecDiff consistently outperforms state-of-the-art caching methods like RAS and TaylorSeer:

  • Stable Diffusion 3: Achieves a 2.80x speedup with almost no change in FID or Clip Score.
  • Stable Diffusion 3.5: Achieves a 2.74x speedup.
  • FLUX.1 Dev: Achieves a 3.17x speedup, pushing the inference speed on an NVIDIA A800 from baseline to over 3x faster while maintaining high-fidelity details.
  • Visual Fidelity: Qualitative results show that SpecDiff maintains sharp edges and text-image alignment (e.g., correctly rendering "STOP" signs) even at high caching ratios where other methods fail.

Limitations and Future Work

  • CFG Sensitivity: The authors noted that high Classifier-Free Guidance (CFG) values can unify the style of generated images, which might make FID scores less sensitive to certain quality drops.
  • Fixed Speculation Steps: While the paper explores 2 to 4 speculation steps, future work could involve adaptive speculation, where the number of look-ahead steps changes based on the complexity of the prompt or the current stage of denoising.
  • Video Diffusion: The authors suggest that this approach is highly promising for video generation, where temporal redundancy between frames is even higher than spatial redundancy within a single image.

Summary updated

BibTeX
@inproceedings{pan2026specdiff,
  author = {Jiayi Pan and Jiaming Xu and Yongkang Zhou and Guohao Dai},
  title = {{SpecDiff: Accelerating Diffusion Model Inference with Self-Speculation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i10.37771},
}
Figure