Fast Sampling Through The Reuse Of Attention Maps In Diffusion Models
Rosco Hunter, Łukasz Dudziak, Mohamed S. Abdelfattah, Abhinav Mehrotra, Sourav Bhattacharya, Hongkai Wen
TL;DR
This work tackles the latency of diffusion-model sampling by introducing a training-free method that reuses attention maps across sampling steps, leveraging the ODE formulation of reverse diffusion. It defines memory-based reuse with a binary schedule $oldsymbol{C0}$ and develops two strategies, HURRY (late reuse) and PHAST (greedy-perturbed search), to locate near-optimal reuse patterns, supported by a Lyapunov-exponent-like analysis. Empirically, attention-map reuse yields higher PSNR than equivalent-step reductions and remains competitive on FID and CLIP across multiple models and datasets, albeit at the cost of increased memory to cache maps. The approach offers a practical, model-agnostic path to speed up high-quality image synthesis without retraining or distillation, with potential refinements in memory management and extensions to reuse other internal tensors.
Abstract
Text-to-image diffusion models have demonstrated unprecedented capabilities for flexible and realistic image synthesis. Nevertheless, these models rely on a time-consuming sampling procedure, which has motivated attempts to reduce their latency. When improving efficiency, researchers often use the original diffusion model to train an additional network designed specifically for fast image generation. In contrast, our approach seeks to reduce latency directly, without any retraining, fine-tuning, or knowledge distillation. In particular, we find the repeated calculation of attention maps to be costly yet redundant, and instead suggest reusing them during sampling. Our specific reuse strategies are based on ODE theory, which implies that the later a map is reused, the smaller the distortion in the final image. We empirically compare our reuse strategies with few-step sampling procedures of comparable latency, finding that reuse generates images that are closer to those produced by the original high-latency diffusion model.
