OnCache: Learning Dynamic Caching Schedules for Efficient Diffusion Inference
Zhikang Xie, Xichen Ye, Yifan Wu, Yuxuan Liu, Qianlong Wang, Haoshen Yu, Peizhu Gong, Weizhong Zhang, Cheng Jin
Abstract
Diffusion models have revolutionized generative tasks but incur high inference latency due to iterative denoising. Cache-based strategies accelerate inference by reusing intermediate features, yet they largely rely on static, sample-agnostic schedules. Our empirical analysis reveals two factors that these schedules overlook. (i) denoising dynamics and computational requirements vary across prompts, motivating adaptive computation allocation. (ii) sensitivity to caching errors varies across timesteps, so static schedules may reuse features at error-sensitive steps or waste computation at less sensitive ones. We therefore propose OnCache, a dynamic caching framework that makes prompt-adaptive decisions online about how much computation to allocate and when to refresh cached features. A policy is trained offline on paired compute and cache continuations from identical denoising states, using differences in terminal fidelity and the number of function evaluations (NFE) to account for the downstream consequences of each decision. To further improve the generation quality, a neural corrector compensates for caching-induced errors and mitigates their accumulation throughout the denoising trajectory. Both components are lightweight and introduce negligible additional inference latency. On FLUX.1-dev, OnCache achieves a nearly generation speedup at resolution, with LPIPS of and SSIM of . We further extend OnCache to video generation on Wan2.1-T2V-1.3B, achieving state-of-the-art efficiency--quality trade-offs across both modalities.
Create a lesson
Related papers
RadAG: Reward-Adversarial Attention Guidance for Efficient Inference-Time Alignment of Diffusion Models
Shared title terminology · Hyeongchan Jeon, Kwanyoung Kim
Stein Guidance without Gradients: Discretization Uniform Diffusion Inference Time Scaling beyond Particle SMC
Shared title terminology · Youheng Zhu, Chenyang Wang, Minshuo Chen et al.
From States to Dynamics: Detecting Rule Violations in OthelloGPT
Shared title terminology · David L. Cao, Sai Sumedh R. Hindupur, Demba Ba
Loop-Count Schedules in Looped Transformers: An Empirical Study
Shared title terminology · Konstantin Kolokolov
CrysLDM: Latent Diffusion Model for Crystal Material Generation
Shared title terminology · Subhojyoti Khastagir, Kishalay Das, Pawan Goyal et al.
From Learning Rates to Rotational Schedules: Finite-Horizon Theory on the Sphere
Shared title terminology · Jacopo Graldi, Antonio Orvieto, Anastasia Koloskova