TL;DR
CEM (Cumulative Error Minimization) is a training-free, plug-and-play plugin designed to boost the generation quality of accelerated Diffusion Transformers (DiTs). By modeling caching errors offline and using dynamic programming to find the optimal time-dependent caching schedule, CEM eliminates the fidelity degradation typical of training-free acceleration methods without adding any runtime computational overhead.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have become the state-of-the-art backbone for visual generation (powering models like FLUX and Hunyuan). However, their iterative denoising process makes inference notoriously slow, often requiring dozens of sequential steps.
To speed things up without expensive retraining, researchers frequently turn to caching mechanisms. These methods skip computations in certain layers or timesteps by reusing previously calculated hidden states. While caching provides a "free" speedup, it introduces approximation errors that compound over the denoising steps, severely degrading the final image or video quality.
Existing error-correction methods try to mitigate this by pruning tokens or predicting changes, but they rely on rigid, hand-crafted caching schedules (like skipping a constant number of steps throughout the entire process). They fail to account for the fact that a model's sensitivity to caching changes drastically depending on when you cache and how long the cache interval is.
Methods
The authors introduce CEM (Cumulative Error Minimization), a model-agnostic framework that optimizes the caching schedule dynamically. It consists of three main phases:
- Offline Error Modeling: Before inference, CEM profiles the target model by running a tiny batch of random generations (typically just 10 to 100 samples). It measures the Cosine loss between the ground-truth layer outputs and cached outputs across every combination of timestep ($t$) and cache interval ($n$). This creates a content-agnostic "prior error matrix."
- Dynamic Caching Strategy: Direct modeling of cumulative error is computationally intractable. CEM bypasses this by using a cumulative error approximation—simply taking the cumulative sum (CUMSUM) of the single-step errors. Guided by this approximation, it uses a dynamic programming (DP) algorithm to find the exact sequence of cache intervals that minimizes total error under a strict acceleration budget (number of allowed compute steps).
- Plug-and-Play Deployment: The optimized schedule is exported and seamlessly replaces the fixed schedules in existing acceleration frameworks (like ToCa, DuCa, TaylorSeer, or FasterSD) or quantized models (like Q-DiT).
Datasets
The authors evaluated CEM across nine distinct generation models spanning three major tasks:
- Text-to-Image: StableDiffusion 1.5 (evaluated on MS-COCO 2017 10K), PixArt-$\alpha$ (MS-COCO 2017 30K), and FLUX.1-dev (DrawBench).
- Text-to-Video: HunyuanVideo, Wan2.1-1.3B, and OpenSora (all evaluated using the VBench benchmark).
- Class-to-Image: DiT-XL/2 using both DDPM and DDIM samplers (evaluated on ImageNet 10K/50K).
Key Insights and Ideas
- Errors are Model-Intrinsic, Not Content-Dependent: A key discovery is that a model's sensitivity to caching is a structural property of the network itself. The error distribution remains highly consistent regardless of the prompt or generated content. This allows the error profiling to be done entirely offline using random noise, introducing zero runtime overhead during actual inference.
- The Power of CUMSUM: Because DiT blocks exhibit high structural similarity (due to residual connections), input perturbations propagate near-linearly. This justifies using a simple cumulative sum to approximate complex, multi-step error accumulation, making the dynamic programming step incredibly fast (taking less than 2 milliseconds).
Key Results
CEM consistently restores or improves the generation fidelity of various baseline acceleration methods while maintaining or enhancing their speedups:
- Fidelity Breakthroughs: On PixArt-$\alpha$, adding CEM to the DuCa baseline improved the Fréchet Inception Distance (FID) dramatically from 41.56 to 27.57. On StableDiffusion 1.5, CEM helped FasterSD achieve an FID of 19.99, actually outperforming the original unaccelerated model's baseline FID of 21.75.
- Synergy with Quantization: When plugged into the quantized Q-DiT model, CEM unlocked an additional 2× speedup (achieving up to 5.2× total acceleration) while keeping generation quality stable or slightly improved.
Limitations and Future Work
While CEM provides an elegant, training-free boost to caching methods, the authors note a few limitations:
- Gap with Training-Based Methods: Although it outperforms existing training-free baselines, its absolute performance still lags behind heavy, training-based distillation methods.
- One-Step Models: CEM relies on scheduling across an iterative denoising process, meaning it cannot be applied to single-step generation models (like consistency models).
For future work, the authors suggest adapting this offline error-modeling approach to capture pruning-induced errors, potentially enabling adaptive token-pruning schedules for one-step generation.
Summary updated