TL;DR
DiCache is a training-free, adaptive caching strategy that significantly accelerates diffusion models. By using shallow-layer "probes" to decide in real-time when to reuse features, the model autonomously determines its own caching schedule. Combined with a novel trajectory alignment technique, DiCache achieves over 2x to 3x speedups on state-of-the-art models like Flux and HunyuanVideo while maintaining higher visual fidelity than existing methods.
The Bottleneck in Diffusion Models
Diffusion models (like Stable Diffusion, Flux, and WAN 2.1) are the current gold standard for image and video synthesis, but they are notoriously slow. They require dozens of iterative "denoising" steps, each passing through a massive Transformer or U-Net architecture.
To speed this up, researchers use feature caching: if the features at step $t$ are very similar to step $t-1$, the model can skip recomputing the deep layers and simply reuse the old features. However, current caching methods suffer from two main flaws:
- "When to cache": They rely on "one-size-fits-all" rules or dataset-level priors that don't adapt to specific prompts. A complex scene might need more computation than a simple one, but current rules treat them the same.
- "How to use cache": Simply reusing old features (zero-order approximation) leads to "ghosting" or loss of detail. Existing fixes use handcrafted rules that often fail on diverse samples.
How DiCache Works
The authors introduce DiCache, a "plug-and-play" framework based on two key observations: shallow layers correlate strongly with deep layers in how much they change between steps, and features across different layers follow similar trajectories.
DiCache consists of two main components:
- Online Probe Profiling Scheme: Instead of running all $M$ layers of a model, DiCache runs only the first $m$ layers (the "probe," where $m$ is typically just 1). It calculates the difference between the current probe output and the previous one. If this "caching error" is below a threshold, the model skips the remaining deep layers and reuses the previous cache. If the error is high, it resumes computation from where the probe left off.
- Dynamic Cache Trajectory Alignment (DCTA): Rather than just copying the old cache, DCTA uses the trajectory of the shallow probe to "nudge" or extrapolate the cached deep features. This first-order approximation ensures the reused features are better aligned with the current timestep, preserving textures and fine details that simple caching usually destroys.
Key Insights
- The Shallow-Deep Correlation: You don't need to look at the whole model to know if it's safe to cache. The very first layer provides a reliable "on-the-fly" indicator of the total model's evolution for that specific sample.
- Trajectory Similarity: Different blocks in a Diffusion Transformer (DiT) move in similar directions in the latent space. This allows the shallow probe to act as a "steering wheel" for the cached deep features.
- Training-Free & Adaptive: Unlike distillation methods that require expensive retraining, DiCache is entirely inference-time. It is truly adaptive; the model "decides" its own compute budget per frame or image.
Evaluation and Results
The researchers evaluated DiCache across several high-end models using diverse benchmarks, including WAN 2.1 (14B) and HunyuanVideo for video generation, and Flux.1-dev for image generation.
DiCache consistently outperformed state-of-the-art (SOTA) methods like TeaCache and TaylorSeer in both speed and quality:
- Flux (Image): Achieved a 3.22x speedup with an LPIPS of 0.2704, significantly better than TaylorSeer (0.4709) at a similar speed, preserving fine details like animal fur and background textures.
- HunyuanVideo: Delivered a 2.34x speedup while maintaining a high SSIM (0.9396) and PSNR (32.79), outperforming EasyCache.
- WAN 2.1: Achieved a 2.45x speedup with the lowest perceptual error (LPIPS 0.1734) among all tested caching methods.
- Compatibility: DiCache is "stackable." When combined with Sparse VideoGen (SVG), it pushed HunyuanVideo to a 3.08x speedup with negligible quality loss.
Limitations and Future Work
- Probing Overhead: While minimal, running the shallow probe still takes time. For the 57-layer Flux model, the probe accounts for about 4% of total inference time. Exploring ways to further reduce this overhead is a priority.
- Threshold Sensitivity: The "reuse threshold" needs to be set per model. While the paper provides a recommended range (0.1 to 0.5), finding the absolute optimal point for a brand-new architecture still requires a small amount of manual sweeping.
- Future Directions: The authors aim to explore even more sophisticated trajectory predictors beyond first-order approximations to push the speedup past 4x or 5x without degradation.
Summary updated