Manuscript Offprint

arXiv:2611.01846

Z-Cache: Accelerating Diffusion Transformers via Self-Reflection

Zegang Cheng, Zhikai Wang, Jiacheng Liu, Xiaobing Tu, Chang Zou, Junjie Chen, Yue Ma, Zhiyuan Ma, Jinkui Ren, Likai Zou, Linfeng Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Diffusion transformers have become the most powerful models for visual generation, but still suffer from massive computation costs. To solve this problem, feature caching has been proposed to cache the features of diffusion models in the previous computation steps and then reuse them in the following caching steps, which brings significant acceleration but also degradation in generation quality. To address this problem, this paper proposes Z-cache as a feature caching method that can maintain high-quality generation through self-reflection. Concretely, we observe that the error from feature caching tends to be sharply reduced after each full computation. Based on this observation, Z-Cache is designed to first predict the features in the future caching steps and then perform a full computation. After that, Z-Cache returns to the caching steps and re-predicts them based on the previous and the current computation steps, which brings correction in features. Experiments demonstrate that with Z-Cache, diffusion transformers achieve comparable generation quality to the original model but with faster inference speed, for instance, 6.22×6.22\times acceleration on FLUX-dev for text-to-image generation. Our code is released on GitHub.

Preprint.

Figure

Figure 2: Visualization of the per-layer L1 error from feature caching. It is observed that there exists a periodic decline in L1 error, which is caused by the full-computation step in feature caching. The proposed Z-Cache utilizes this phenomenon and derives fewer cumulative errors.

1 Introduction

Diffusion models [Ho et al., 2020, Song et al., 2021, Liu et al., 2023] have become a dominant paradigm for high-quality visual generation, but their iterative denoising process remains computationally expensive, especially for high-resolution image and video synthesis. This cost limits practical deployment and motivates a broad set of acceleration methods. Among them, feature caching [Selvaraju et al., 2024, Qiu et al., 2025, Zou et al., 2024b, Liu et al., 2024, 2025c, Feng et al., 2025, Zheng et al., 2025b, Liu et al., 2025d] is particularly attractive because it is training-free: instead of running the full denoising network at every timestep, it reuses or predicts intermediate hidden states across nearby timesteps.

The key assumption behind feature caching is temporal redundancy. Hidden states at adjacent denoising steps are often similar, allowing expensive transformer blocks to be skipped with minor quality loss. However, this assumption becomes fragile under aggressive acceleration. As the cache interval grows, single-anchor reuse or forecasting accumulates hidden-state errors, which can lead to semantic drift, local artifacts, and degraded prompt fidelity. This creates a central trade-off: larger cache windows improve efficiency but increasingly deviate from the true denoising trajectory.

We start from a simple empirical observation. As shown in Figure 2, cache-induced feature error tends to grow within each cache window, but drops sharply when a scheduled full-computation step is performed. This suggests that full-computation anchors partially pull the accelerated trajectory back toward the original denoising path. Rather than only using a full step as the starting point for the next cache window, we ask whether the newly obtained future anchor can also be used to correct the provisional states inside the previous active window.

Based on this observation, we propose Z-Cache, a training-free and predictor-agnostic reflection framework for diffusion feature caching. For each active cache window, Z-Cache first uses a base cache predictor to forecast intermediate hidden states from a past full-computation anchor and runs the corresponding provisional denoising transitions. After reaching the next scheduled full-computation anchor, Z-Cache revisits the same window, estimates each intermediate hidden state with both the past and future anchors, and re-samples the window trajectory before committing the reflected window-end latent. Therefore, Z-Cache is not a post-hoc smoothing operation over already generated samples. Instead, it is an in-loop trajectory correction mechanism that changes the subsequent denoising path. Extensive experiments demonstrate the effectiveness of Z-Cache in text-to-image, text-to-video, and image editing tasks, as well as its compatibility with other feature caching methods and other diffusion acceleration methods such as step distillation and quantization.

Our contributions are summarized as follows:

  • We identify a cache-induced error pattern in diffusion feature caching: hidden-state errors tend to accumulate within a cache window but are sharply reduced after scheduled full-computation anchors, which motivates using future anchors to correct the previous active cache window.

  • We propose Z-Cache, a training-free cache-then-check framework that performs dual-anchor reflection and active-window re-sampling. Unlike post-hoc smoothing, Z-Cache revises the latent trajectory inside the denoising loop and continues sampling from the reflected window-end state.

Figure

Figure 3: Pipeline of Z-Cache. The figure uses the reverse-diffusion notation t,t−1,…t, t-1, \ldots for visualization, while the text uses a sampling-order index that increases along denoising. Traditional feature caching forecasts an active window from a past full-computation anchor and directly moves to the next window. In contrast, Z-Cache treats the window as provisional: after obtaining the next scheduled full-computation anchor, it revisits the same window, constructs dual-anchor hidden estimates, re-samples the window trajectory, and commits the reflected window-end latent. Z-Cache therefore performs in-loop trajectory correction without adding extra full-computation steps.

  • We establish Z-Cache as a plug-and-play and composable acceleration module. It can be attached to compatible feature-cache predictors, generalizes beyond free-form generation to image editing and video synthesis, and remains compatible with orthogonal acceleration techniques such as few-step distillation and low-bit quantization.

References (63)