MeanCache: From Instantaneous to Average Velocity for Accelerating Flow Matching Inference
Huanlin Gao, Ping Chen, Fuyuan Shi, Ruijia Wu, Li YanTao, Qiang Hui, Yuren You, Ting Lu, Chao Tan, Shaoan Zhao, Zhaoxiang Liu, Fang Zhao, Kai Wang, Shiguo Lian
TL;DR
MeanCache tackles the instability of caching-based acceleration in Flow Matching by shifting from instantaneous velocity caching to an average-velocity framework and coupling it with a JVP-based correction. By defining the interval mean velocity $u(z_t,t,s)$ and leveraging a start-point identity alongside a reference-point JVP estimator, the method reconstructs stable trajectories without retraining. A trajectory-stability scheduling algorithm—built on a graph of timesteps and a peak-suppressed shortest-path objective—optimally places caches under budget constraints. Experiments on FLUX.1, Qwen-Image, and HunyuanVideo demonstrate 3–4x speedups with consistent or improved generation quality, highlighting MeanCache’s practical potential for commercial-scale generative models.
Abstract
We present MeanCache, a training-free caching framework for efficient Flow Matching inference. Existing caching methods reduce redundant computation but typically rely on instantaneous velocity information (e.g., feature caching), which often leads to severe trajectory deviations and error accumulation under high acceleration ratios. MeanCache introduces an average-velocity perspective: by leveraging cached Jacobian--vector products (JVP) to construct interval average velocities from instantaneous velocities, it effectively mitigates local error accumulation. To further improve cache timing and JVP reuse stability, we develop a trajectory-stability scheduling strategy as a practical tool, employing a Peak-Suppressed Shortest Path under budget constraints to determine the schedule. Experiments on FLUX.1, Qwen-Image, and HunyuanVideo demonstrate that MeanCache achieves 4.12X and 4.56X and 3.59X acceleration, respectively, while consistently outperforming state-of-the-art caching baselines in generation quality. We believe this simple yet effective approach provides a new perspective for Flow Matching inference and will inspire further exploration of stability-driven acceleration in commercial-scale generative models.
