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

Accelerating Diffusion Transformer via Gradient-Optimized Cache

Junxiang Qiu, Lin Liu, Shuo Wang, Jinda Lu, Kezhou Chen, Yanbin Hao

TL;DR

This paper introduces Gradient-Optimized Cache (GOC), a novel caching strategy for Diffusion Transformers (DiTs) that significantly accelerates image generation by intelligently reusing intermediate computations. GOC addresses the critical issue of error accumulation in traditional caching methods by employing a gradient-based compensation mechanism and a novel decision strategy to selectively apply caching, leading to substantial improvements in generation quality and efficiency without increased computational cost.

What Problem Does This Paper Address?

Diffusion Transformers (DiTs) have shown remarkable success in generating high-quality content across various modalities. However, their sampling process is computationally intensive, hindering their real-world deployment. Feature caching, which reuses intermediate computations from previous steps, offers a promising solution for acceleration. The main challenge with existing caching methods is the progressive accumulation of approximation errors, especially when a large portion of blocks are cached (over 50%). These errors can severely degrade generation quality. Furthermore, current error compensation techniques often overlook the dynamic patterns of feature variations during the caching process, leading to suboptimal error correction. This paper aims to tackle these limitations by developing a more robust and effective caching mechanism that minimizes error propagation and maximizes acceleration benefits.

Methods

The core of this paper is the Gradient-Optimized Cache (GOC), which comprises two key innovations:

  1. Gradient Cache (GC): This is the fundamental caching mechanism. Instead of directly reusing features from a single previous step, GC uses features from the two most recent steps ($g_{t-1}$ and $g_t$) to compute a compensated feature for the next step ($g_{t+1}$). This is achieved by calculating the gradient difference between the two recent features and using it to adjust the current feature: $g_{t+1} := g_t + \eta \cdot (g_t - g_{t-1})$. The parameter $\eta$ controls the magnitude of this gradient compensation.
  2. Gradient Optimization Determination (GOD): This component addresses the problem of excessive GC application leading to new errors. GOD analyzes the model's statistical information and the current step's position within the sampling process to decide whether to apply GC. It identifies "inflection points" where the denoising trajectory is likely to change direction, and where applying GC might introduce conflicting gradients. By combining the number of blocks exhibiting "inverse gradients" (where gradients conflict) with the step's position, GOD calculates a "negative impact" score $B(t)$. If $B(t)$ is below a threshold $\Gamma$, GC is applied; otherwise, normal caching or no caching is used. This selective application prevents major error introduction and confines residual errors to later stages where they have less impact.

The paper also details how they extract model statistics by analyzing feature variations across different prompts and how they define "inverse gradients" based on the relationship between consecutive features.

Datasets

The experiments were conducted on two benchmark datasets:

  • ImageNet: Used for class-conditional generation.
  • MS-COCO: Used for text-to-image synthesis.

No new benchmarks were introduced; the focus was on evaluating the proposed method on existing, widely-used datasets.

Key Insights and Ideas

  • Gradient-based error correction is crucial: Simply reusing features isn't enough; understanding the direction of change (gradients) is key to correcting approximation errors introduced by caching.
  • Temporal context matters: Using features from two previous steps, not just one, provides a richer temporal signal for more accurate gradient estimation and compensation.
  • Not all caching steps are equal: Applying caching indiscriminately can be detrimental. Identifying "risky" steps where caching might introduce more harm than good is essential for maintaining generation quality.
  • Inflection points are critical: The denoising process has dynamic shifts. Aligning caching decisions with these shifts (where the trajectory changes direction) is vital for stable and high-quality generation.
  • GOC complements existing methods: GOC can be integrated with other caching strategies (like FORA and L2C) to further enhance their performance, demonstrating its versatility.

Key Results

GOC demonstrated significant improvements in both generation quality and efficiency:

  • ImageNet: With 50% cached blocks, GOC achieved an Inception Score (IS) of 216.28 (a 26.3% increase) and a Fréchet Inception Distance (FID) of 3.907 (a 43% decrease) compared to the baseline DiT, while maintaining identical computational costs.
  • FORA+GOC: When applied to the FORA caching strategy, GOC significantly improved metrics. For 50% caching, IS increased from 190.046 to 216.280, and FID decreased from 6.857 to 3.907. For 25% caching, IS increased from 220.011 to 222.805, and FID decreased from 3.870 to 3.524.
  • L2C+GOC: Similarly, applying GOC to L2C improved metrics, with FID decreasing to 3.192 for 22% caching.
  • Computational Cost: The overhead introduced by GOC was negligible, with latency increases of only around 1.2-2.0%, which are deemed acceptable given the substantial FID improvements.
  • Qualitative Results: Generated images showed improved detail and reduced artifacts compared to methods without GOC, closely resembling the quality of no-cache configurations.

Limitations and Future Work

The authors acknowledge that the current implementation of GOC is limited by fixed parameters and bound steps. They plan to investigate the development of a more general embedding procedure for GOC in the future, suggesting a direction for further research into making the method more adaptive and broadly applicable.

Summary updated

BibTeX
@inproceedings{qiu2025accelerating,
  author = {Junxiang Qiu and Lin Liu and Shuo Wang and Jinda Lu and Kezhou Chen and Yanbin Hao},
  title = {{Accelerating Diffusion Transformer via Gradient-Optimized Cache}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure