OTCache: Optimal Transport for Geometry-Aware Caching in Diffusion Models

Huanlin Gao, Fang Zhao, Qiang Hui, Fuyuan Shi, Shaoan Zhao, Yantao Li, Chao Tan, Ting Lu, Yuren You, Kai Wang, Shiguo LianarXiv 2026

TL;DR

OTCache is a training-free framework that significantly accelerates diffusion model inference by predicting optimal feature-caching schedules. By framing schedule prediction as a smooth geometric interpolation in policy space via Optimal Transport, OTCache achieves up to 4.7× acceleration on state-of-the-art models like FLUX.1 and HunyuanVideo while maintaining superior image and video fidelity compared to existing baselines.

What Problem Does This Paper Address?

Modern generative models based on Flow Matching (FM) and Diffusion Transformers (DiTs)—such as FLUX.1 and HunyuanVideo—produce stunning high-fidelity images and videos. However, their massive parameter scale and iterative sampling process require substantial computational overhead, creating a major barrier for real-time or resource-constrained deployment.

To speed up inference without expensive retraining, researchers often use caching techniques that reuse intermediate layer features across adjacent timesteps. State-of-the-art graph-based methods (like MeanCache) plan these caching schedules by solving a constrained shortest-path problem. Crucially, these methods rely on an additive independence assumption, treating the total end-to-end quality degradation as a simple sum of local, independent errors.

The authors discover that this assumption completely breaks down in the high-acceleration (low Number of Function Evaluations, or NFE) regime. When steps are far apart, early caching errors propagate nonlinearly and interact with later steps, causing traditional graph-based schedulers to deviate significantly from the true optimal schedule.

Fig. 1: Performance gain and structural insights on FLUX.1 [dev]. (A) Fail- ure of additive surrogates: MeanCache deviates from the optimal boundary in the ultra-low NFE regime, reflecting the limitations of local error aggregation. OTCache recovers this fidelity loss, significantly narrowing the gap to the search-based optimum. (B) Structural regularity of optimal paths: Optimal schedules across different NFE (budgets) demonstrate strong structural relationships rather than independent patterns, suggesting a shared underlying policy trajectory that OTCache exploits via geometric interpolation.

Methods

Instead of treating caching schedules for different inference budgets as completely independent discrete problems, OTCache views them as a smooth, continuous evolution along a trajectory in policy space—a policy geodesic.

The framework operates in three distinct stages:

  1. Stage 1: Reference Schedule: The authors use a standard graph-based caching method (MeanCache) under a conservative, high-NFE budget (e.g., 20 steps). In this regime, the additive error assumption still holds, providing a highly reliable, high-fidelity structural prior ($\pi_{ref}$).
  2. Stage 2: Anchor Search: To establish the other end of the trajectory, they perform a lightweight black-box optimization (using Optuna and CMA-ES) under an extreme low-budget setting (e.g., 8 steps). This search directly optimizes an end-to-end perceptual objective (LPIPS) on a small calibration set, yielding a robust low-budget anchor policy ($\pi_{anc}$).
  3. Stage 3: Optimal Path Prediction: To find the optimal schedule for any arbitrary target budget between the anchor and reference, OTCache lifts the discrete schedules into continuous warping curves using shape-preserving splines (PCHIP). It then performs quantile interpolation (inspired by 1D Wasserstein geodesics in Optimal Transport) between the continuous reference and anchor embeddings. Finally, a power-law warping function discretizes the predicted curve back into a concrete step schedule.
Fig. 2: Overview of OTCache. Stage 1: use graph-based caching methods to obtain a reliable high-NFE(budget) schedule as the reference policy. Stage 2: perform black- box search to find a near-optimal low-NFE schedule as the anchor policy. Stage 3: inspired by optimal transport (OT), convert both endpoint schedules into continuous warping curves via PCHIP and apply quantile interpolation to predict the target- budget schedule πB.

Datasets

The authors evaluated OTCache across three diverse, large-scale generative frameworks:

  • FLUX.1 [dev] for high-fidelity text-to-image synthesis (1024×1024 resolution).
  • Qwen-Image for text-to-image generation (1664×928 resolution).
  • HunyuanVideo for large-scale text-to-video generation.

Evaluation prompts were sampled following the DrawBench protocol for text-to-image tasks and the T2V-CompBench dataset (50 representative prompts across multiple attributes) for text-to-video tasks.

Key Insights and Ideas

  • The "Aha!" Moment on Structural Regularity: The authors noticed that the first-order differences (the temporal gaps between cached states) of optimal schedules across different budgets are highly correlated and evolve smoothly. This geometric regularity implies that optimal policies share an underlying continuous trajectory, making Optimal Transport interpolation highly effective.
  • Bypassing the Curse of Dimensionality: Finding an optimal caching schedule is a massive combinatorial problem (e.g., $\approx 1.26 \times 10^{14}$ possibilities for choosing 25 steps out of 50). By searching only at an extreme low-budget anchor point (where the search space is a manageable $\approx 5.36 \times 10^8$) and interpolating, OTCache completely bypasses the peak complexity regime.
  • Perceptual vs. Surrogate Objectives: Directly optimizing for end-to-end perceptual metrics (LPIPS) at the low-budget anchor prevents the catastrophic content drift and structural distortions common to surrogate-based methods.

Key Results

OTCache establishes a new state-of-the-art Pareto frontier for training-free diffusion acceleration:

  • FLUX.1 [dev]: Achieves 4.50× acceleration while maintaining an ImageReward of 0.996 and an LPIPS of 0.254, significantly outperforming MeanCache (4.12×) and avoiding common artifacts like malformed anatomy or distorted objects.
  • Qwen-Image: Delivers 4.70× acceleration with an SSIM of 0.864 and a PSNR of 21.48. At 3.20× speedup, it achieves a near-lossless LPIPS of 0.069.
  • HunyuanVideo: Reaches 3.66× acceleration with a VBench score of 80.37%, successfully eliminating temporal flickering and structural distortions that plague competing methods like TeaCache and DiCache.

Limitations and Future Work

While OTCache is training-free and highly efficient during online inference, it does require an offline calibration cost in Stage 2 to find the anchor schedule for a given backbone model. For instance, executing the 200-trial Optuna search takes about 7.7 minutes for FLUX.1 and up to 50.5 minutes for HunyuanVideo per prompt on an H100 GPU (though this is a one-time cost that can be easily parallelized across multiple GPUs).

Future directions include exploring zero-shot anchor policy estimation to eliminate the offline search stage entirely, and extending this geometry-aware caching paradigm to other modalities like audio and 3D generation.

Summary updated

BibTeX
@misc{gao2026otcache,
  author = {Huanlin Gao and Fang Zhao and Qiang Hui and Fuyuan Shi and Shaoan Zhao and Yantao Li and Chao Tan and Ting Lu and Yuren You and Kai Wang and Shiguo Lian},
  title = {{OTCache: Optimal Transport for Geometry-Aware Caching in Diffusion Models}},
  year = {2026},
  eprint = {2606.31026},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.31026},
}
Figure