arXiv:2607.29398cs.LG2026-07

动态调整扩散模型缓存策略,提升推理速度同时保持生成质量。

OnlineCache: Learning Dynamic Caching Policies with Error Correction for Efficient Diffusion Inference

论文配图:OnlineCache: Learning Dynamic Caching Policies with Error Correction for Efficient Diffusion Inference
图 1 · 摘自论文原文
  • 根据输入难易和时间步误差动态决定缓存时机
  • 在FLUX.1-dev上实现近3倍加速且保持生成精度
  • 适合需要高效生成的图像/视频应用开发者

扩散模型虽在生成任务中表现卓越,但因迭代去噪导致延迟高。现有基于缓存的加速方法多依赖静态、不随样本变化的调度策略。本文实证发现两点:(i) 不同提示词生成难度不同,需动态分配计算资源;(ii) 各时间步误差敏感度不同,静态策略可能缓存高误差步骤或浪费计算在低误差步骤。为此提出OnlineCache,一种联合学习缓存时机与误差修正的动态缓存框架。采用策略梯度训练轻量网络实现自适应速度-质量权衡,并引入可学习校正器缓解缓存带来的误差。两模块在双层优化框架中联合优化,策略关注全局生成质量,校正器最小化局部误差。方法自动跨样本与时间步分配资源,显著提升整体生成质量。大量实验表明其优势明显:在FLUX.1-dev模型上实现近3倍加速且保留生成保真度;在DiT与CogVideoX上同样实现高效加速,无质量损失;所有场景下均优于现有缓存加速基线。

原文摘要 · Abstract (English)

Diffusion models have revolutionized generative tasks but incur high latency due to iterative denoising. While cache-based strategies accelerate inference by reusing intermediate features, they largely rely on static, sample-agnostic schedules. We argue that this rigidity overlooks two facts empirically validated in this paper: (i) generation difficulty varies across prompts, requiring adaptive resource allocation--complex inputs demand more computation while simpler ones require less; (ii) error sensitivity fluctuates across timesteps, where static policies may cache high-error steps or waste computation on low-error ones. We therefore propose OnlineCache, a dynamic caching framework that jointly learns when to cache and how to correct approximation errors. We leverage policy gradient to train a lightweight network for adaptive speed-quality trade-offs, and incorporate a learnable corrector to mitigate caching-induced errors. Both modules are jointly optimized under a bilevel optimization framework, with the policy targeting global generation quality and the corrector minimizing local errors. Our method automatically allocates computational resources across both samples and timesteps, improving overall generation quality. Extensive experiments demonstrate clear superiority. On FLUX.1-dev model, OnlineCache achieves nearly 3 speedup while preserving generation fidelity. On DiT and CogVideoX, it similarly delivers competitive acceleration without compromising quality; across all scenarios, it consistently outperforms existing cache-based acceleration baselines.

扩散模型缓存优化推理加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。