Lune

NeurIPS2024Top-tier venue

Learning-to-Cache: Accelerating Diffusion Transformer via Layer Caching

Xinyin Ma, Gongfan Fang, Michael Bi Mi, Xinchao Wang

Abstract

Diffusion Transformers have recently demonstrated unprecedented generative capabilities for various tasks. The encouraging results, however, come with the cost of slow inference, since each denoising step requires inference on a transformer model with a large scale of parameters. In this study, we make an interesting and somehow surprising observation: the computation of a large proportion of layers in the diffusion transformer, through introducing a caching mechanism, can be readily removed even without updating the model parameters. In the case of U-ViT-H/2, for example, we may remove up to 93.68% of the computation in the cache steps (46.84% for all steps), with less than 0.01 drop in FID. To achieve this, we introduce a novel scheme, named Learning-to-Cache (L2C), that learns to conduct caching in a dynamic manner for diffusion transformers. Specifically, by leveraging the identical structure of layers in transformers and the sequential nature of diffusion, we explore redundant computations between timesteps by treating each layer as the fundamental unit for caching. To address the challenge of the exponential search space in deep models for identifying layers to cache and remove, we propose a novel differentiable optimization objective. An input-invariant yet timestep-variant router is then optimized, which can finally produce a static computation graph. Experimental results show that L2C largely outperforms samplers such as DDIM and DPM-Solver, alongside prior cache-based methods at the same inference speed. Code is available at https://github.com/horseee/learning-to-cache

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

75 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • High-Resolution Image Synthesis with Latent Diffusion Models cites Diffusion Models Beat GANs on Image Synthesis
  • High-Resolution Image Synthesis with Latent Diffusion Models cites Denoising Diffusion Probabilistic Models
  • High-Resolution Image Synthesis with Latent Diffusion Models cites Denoising Diffusion Implicit Models
  • Diffusion Models Beat GANs on Image Synthesis cites Denoising Diffusion Probabilistic Models
  • Diffusion Models Beat GANs on Image Synthesis cites Denoising Diffusion Implicit Models
  • Autoregressive Adversarial Post-Training for Real-Time Interactive Video Generation cites Denoising Diffusion Probabilistic Models
  • dKV-Cache: The Cache for Diffusion Language Models cites Denoising Diffusion Probabilistic Models
  • LazyDiT: Lazy Learning for the Acceleration of Diffusion Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • LazyDiT: Lazy Learning for the Acceleration of Diffusion Transformers cites Diffusion Models Beat GANs on Image Synthesis
  • LazyDiT: Lazy Learning for the Acceleration of Diffusion Transformers cites Denoising Diffusion Probabilistic Models
  • LazyDiT: Lazy Learning for the Acceleration of Diffusion Transformers cites Denoising Diffusion Implicit Models
  • Denoising Diffusion Implicit Models cites Denoising Diffusion Probabilistic Models
  • MagCache: Fast Video Generation with Magnitude-Aware Cache cites High-Resolution Image Synthesis with Latent Diffusion Models
  • MagCache: Fast Video Generation with Magnitude-Aware Cache cites Diffusion Models Beat GANs on Image Synthesis
  • MagCache: Fast Video Generation with Magnitude-Aware Cache cites Denoising Diffusion Probabilistic Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers75

  1. dKV-Cache: The Cache for Diffusion Language ModelsXinyin Ma, Runpeng Yu, Gongfan Fang, Xinchao WangNeurIPS 2025 · 145 citations
  2. Autoregressive Adversarial Post-Training for Real-Time Interactive Video GenerationShanchuan Lin, Ceyuan Yang, Hao He, Jianwen Jiang et al.NeurIPS 2025 · 89 citations
  3. SP-VLA: A Joint Model Scheduling and Token Pruning Approach for VLA Model AccelerationYe Li, Yuan Meng, Zewen Sun, Kangye Ji et al.ICLR 2026 · 60 citations
  4. MagCache: Fast Video Generation with Magnitude-Aware CacheZehong Ma, Longhui Wei, Feng Wang, Shiliang Zhang et al.NeurIPS 2025 · 41 citations
  5. LazyDiT: Lazy Learning for the Acceleration of Diffusion TransformersXuan Shen, Zhao Song, Yufa Zhou, Bo Chen et al.AAAI 2025 · 40 citations

Builds on39

  1. Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 citations
  4. High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
  5. Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 citations

Related papers

  1. Cache Me if You Can: Accelerating Diffusion Models through Block CachingFelix Wimbauer, Bichen Wu, Edgar Schönfeld, Xiaoliang Dai et al.CVPR 2024 · 25 citations
  2. Beyond Fixed Formulas: Data-Driven Linear Predictor for Efficient Diffusion ModelsZhirong Shen, Rui Huang, Jiacheng Liu, Chang Zou et al.CVPR 2026 · 1 citation
  3. DiffSparse: Accelerating Diffusion Transformers with Learned Token SparsityHaowei Zhu, Ji Liu, Ziqiong Liu, Dong Li et al.ICLR 2026 · 2 citations
  4. DeepCache: Accelerating Diffusion Models for FreeXinyin Ma, Gongfan Fang, Xinchao WangCVPR 2024 · 87 citations
  5. Diffusion on Demand: Selective Caching and Modulation for Efficient GenerationHee Min Choi, Hyoa Kang, Dokwan Oh, Nam Ik ChoNeurIPS 2025 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines