ReCache: 通过REINFORCE学习扩散模型的预算感知缓存调度
ReCache: Learning Budget-Aware Caching Schedules for Diffusion Models via REINFORCE
AI总结:
提出ReCache,利用策略梯度学习在给定计算预算下最大化生成质量的去噪步骤重计算调度,无需标注数据且兼容多种缓存机制。
摘要:
现代扩散模型生成高质量图像和视频,但其迭代去噪过程导致推理成本高昂。特征缓存通过重用或预测相邻去噪步骤的中间激活来加速采样,利用沿反向轨迹的计算冗余。本文关注缓存调度:选择哪些去噪步骤应完全重计算。现有调度要么是固定的(如均匀),要么根据每步误差启发式自适应选择;这两种情况下,实际计算成本是手动调整阈值的副作用,而非用户可指定的量。我们提出ReCache,它反转了这一过程:给定目标预算k,学习最大化生成质量的重计算调度,将计算变为可直接控制的输入。ReCache通过策略梯度训练,避开了通过完整扩散推理的反向传播,且不使用任何标注数据。来自无缓存推理的生成作为匹配目标,并配以生成质量的奖励。ReCache兼容任何缓存机制,包括特征重用和特征预测;对于每种机制,单个训练好的策略在推理时适应不同计算预算。ReCache持续优于调度基线:在FLUX上减少$ imes5.04$ FLOPs时,与DiCache相比,LPIPS降低31%(从0.456降至0.316);在Wan 2.1上实现$\sim imes2.6$加速时,与均匀HiCache相比,LPIPS降低65%(从0.480降至0.169),VBench分数提升7%(5.6分,从70.4升至76.0)。代码见https://github.com/thecrazymage/ReCache。
英文摘要:
Modern diffusion models generate high-quality images and videos, but their iterative denoising process makes inference expensive. Feature caching accelerates sampling by reusing or predicting intermediate activations across neighboring denoising steps, exploiting the redundancy of computations along the reverse trajectory. In this work, we focus on the caching schedule: selecting which denoising steps should be fully recomputed. Existing schedules are either fixed (e.g. uniform) or chosen adaptively from per-step error heuristics; in both cases, the actual compute cost is a side-effect of hand-tuned thresholds rather than a quantity the user can specify. We propose ReCache, which inverts this: given a target budget k, it learns the recomputation schedule that maximizes generation quality, turning compute into a directly controllable input. ReCache trains via policy gradients, sidestepping backpropagation through full diffusion inference, and uses no labelled data. Generations from uncached inference serve as matching targets, paired with a reward for generation quality. ReCache is compatible with any caching mechanism, including feature reuse and feature forecasting; for each mechanism, a single trained policy adapts across computational budgets at inference time. ReCache consistently outperforms scheduling baselines: under a $\times5.04$ FLOPs reduction on FLUX, it reduces LPIPS by 31% (from 0.456 to 0.316) compared to DiCache; on Wan 2.1 at a $\sim \times2.6$ speedup, it drops LPIPS by 65% (from 0.480 to 0.169) and boosts the VBench score by 7% (5.6 points, from 70.4 to 76.0) over uniform HiCache. Code is available at https://github.com/thecrazymage/ReCache.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。