Z-Cache: Accelerating Diffusion Transformers via Self-Reflection

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

TL;DR

Generating crisp images and videos with Diffusion Transformers (DiTs) usually means sitting through dozens of painfully slow, repetitive computation steps. Z-Cache speeds this up by letting the model skip steps using educated guesses, and then—once it reaches a scheduled checkpoint—look backward to fix its own errors before moving on. The result is a plug-and-play, training-free wrapper that accelerates models like FLUX.1-dev by over 6× while keeping visual quality remarkably intact.

High-resolution sample generated by FLUX.1-dev accelerated 6.22x using Z-Cache.

What Problem Does This Paper Address?

Diffusion models conjure images from pure noise through an iterative denoising loop—running a massive neural network dozens of times in sequence. Because neighboring steps in this loop produce very similar internal representations (hidden states), a popular training-free shortcut called feature caching simply computes the full network once, saves the internal features, and reuses or extrapolates them for the next several steps.

Here is the catch: it’s like driving down a winding road with your eyes closed for three seconds at a time. Small approximation errors compound rapidly inside each "cache window." Stretch that window too far for higher speedups, and the trajectory drifts off course—leading to warped hands, missing objects, and semantic drift. Existing caching methods only ever extrapolate forward from a past checkpoint, wasting a golden opportunity when the model inevitably opens its eyes at the next full computation step.

Methods

The authors noticed a striking heartbeat pattern in cached diffusion models: approximation error climbs steadily during skipped steps, then plummets the moment a scheduled full-computation step occurs. Instead of merely using that fresh, accurate checkpoint to launch the next cache window, Z-Cache uses it to audit and repair the previous one.

Z-Cache acts as a predictor-agnostic, "cache-then-check" wrapper around existing caching methods (like TaylorSeer, SpeCa, or MagCache). For any cache window between a past full-computation anchor $a$ and a future anchor $b$, it runs a three-stage dance—forming a "Z" shape in time:

  1. Provisional Forward Pass: Starting at anchor $a$, a base cache predictor forecasts intermediate features to step through the window provisionally until reaching step $b$, where the scheduled full network evaluation happens.
  2. Dual-Anchor Reflection: Now holding both the past anchor ($a$) and the newly computed future anchor ($b$), Z-Cache re-estimates the intermediate features by blending predictions from both ends. It uses a hyperparameter-free linear weight $w_i = \frac{i-a}{b-a}$, trusting the past anchor early in the window and smoothly shifting trust to the future anchor near the end.
  3. Active-Window Re-sampling: Crucially, this isn't post-hoc smoothing. Z-Cache throws away the provisional noisy latents inside the window, re-runs the cheap denoising updates using the corrected features, and commits the newly refined endpoint before continuing the loop.

Because the expensive neural network blocks aren't re-evaluated during reflection—only the lightweight feature blending and sampler transitions—it adds zero extra full-computation steps.

Datasets

Because Z-Cache is completely training-free, no training datasets are used. Instead, the authors evaluate across four established generation benchmarks (introducing no new datasets):

  • ImageNet (256×256): For class-conditional image generation (50,000 sampled images).
  • DrawBench: For text-to-image prompt fidelity and acceleration trade-offs.
  • VBench: For evaluating temporal consistency and quality in text-to-video synthesis.
  • Gedit-bench: For testing structure and background preservation in image editing.

Key Insights and Ideas

  • Interpolation beats extrapolation: Forecasting hidden states purely from the past is brittle. Waiting a few milliseconds for the next scheduled full step turns risky extrapolation into bounded interpolation between two known anchors.
  • In-loop trajectory healing: In diffusion, latent errors snowball recursively. Visualizing PCA trajectories of hidden features reveals that standard caching creates jarring "bumps," whereas Z-Cache's re-sampling actively pulls the latent path back onto the ground-truth rails before errors lock in.
  • Orthogonal composability: Because Z-Cache only wraps the caching schedule, it stacks cleanly with other compression tricks—including 8-bit quantization, U-Net architectures (SDXL), and few-step distilled models.

Key Results

  • Class-to-Image (DiT-XL/2 on ImageNet): At a 6.22× FLOPs speedup, Z-Cache achieves an FID of 3.25 and Inception Score of 219.30, cleanly beating TaylorSeer (3.60 FID) while older baselines like FORA, ToCa, and DuCa suffer catastrophic quality collapse (FID > 12).
  • Text-to-Image (FLUX.1-dev on DrawBench): Wrapped around four different predictors (TeaCache, TaylorSeer, SpeCa, MagCache), Z-Cache improves PSNR, SSIM, and LPIPS in 100% of matched settings, adding less than 0.7% FLOPs overhead (up to 6.22× FLOPs speedup).
  • Text-to-Video (HunyuanVideo on VBench): Hits state-of-the-art VBench scores of 80.10% at 4.96× FLOPs speedup (5.05× wall-clock speedup) and 79.60% at 6.20× FLOPs speedup (6.28× wall-clock speedup), fixing deformed objects and extra clock hands seen in baselines.
  • Stacking with Quantization: Layering Z-Cache onto an 8-bit quantized model boosts wall-clock speedup from 2.10× to 3.12× while improving PSNR (32.33 to 33.60) and LPIPS.
Sharp detail and natural textures preserved under aggressive acceleration.

Limitations and Future Work

  • FLOPs-light does not always mean latency-free: While extra arithmetic is tiny (<0.7% FLOPs), revisiting a window requires holding intermediate states in memory and running extra sampler steps. On TaylorSeer and SpeCa, wall-clock overhead is minimal; however, paired with adaptive methods like TeaCache and MagCache, the current implementation incurs noticeable latency slowdowns (e.g., TeaCache drops from 4.96× to 2.00× wall-clock speedup at $\mathcal{N}=8$) and roughly 4 GiB of extra peak VRAM.
  • ** Representation compatibility: Z-Cache assumes the underlying predictor caches compatible representations and state updates, meaning engineering care is needed when adapting it to exotic caching policies. (Future work directions are not explicitly discussed in the main text.)

Summary updated

BibTeX
@inproceedings{cheng2026z,
  author = {Zegang Cheng and Zhikai Wang and Jiacheng Liu and Xiaobing Tu and Chang Zhou and Junjie Chen and Yue Ma and Zhiyuan Ma and Jinkui Ren and Likai Zou and Linfeng Zhang},
  title = {{Z-Cache: Accelerating Diffusion Transformers via Self-Reflection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=18HPiP28RE},
}
Figure