Abstract
Diffusion models have set new standards in image synthesis but remain computationally expensive due to iterative denoising and massive parameter counts. While model caching and quantization offer temporal and structural acceleration respectively, their naive combination often leads to significant quality degradation. We present CacheQuant, a training-free framework that jointly optimizes these techniques. By employing a Dynamic Programming Schedule (DPS) for optimal caching and Decoupled Error Correction (DEC) to mitigate compounding noise, CacheQuant achieves a 5.18× speedup and 4× compression on Stable Diffusion with negligible impact on image quality.
Introduction: The Cost of Diffusion
Modern diffusion models like Stable Diffusion and Diffusion Transformers (DiT) are characterized by high temporal redundancy—requiring hundreds of denoising steps—and extreme structural complexity. Current acceleration strategies typically target one of these levels:
- Temporal Level: Utilizing model caching to skip redundant calculations across steps.
- Structural Level: Applying quantization (e.g., INT8) to reduce memory footprint and increase throughput.
As shown in the figure above, these methods independently offer speedups but come with trade-offs. Caching often leads to high memory usage or low performance if not scheduled correctly, while quantization typically requires costly retraining to maintain performance.
The Synergy Trap
A critical finding of this research is that caching and quantization are not "orthogonal." When combined, the quantization noise interferes with the temporal similarity that caching relies on, causing errors to compound. This "synergy trap" results in a massive drop in Fréchet Inception Distance (FID) scores if the two methods are simply stacked without coordination. The authors found that to maintain high performance, these optimizations must be solved together.
The CacheQuant Framework
CacheQuant bridges the gap between caching and quantization through two primary innovations designed to work in tandem without requiring any model fine-tuning.
1. Dynamic Programming Schedule (DPS)
Rather than relying on manual heuristics, CacheQuant treats the caching schedule as an optimization problem. DPS analyzes feature maps across denoising steps to identify mathematically optimal refresh points. By minimizing the total error introduced by the joint application of caching and quantization, DPS ensures the most efficient path through the denoising trajectory. Optimization constraints were implemented to reduce the search time for this schedule from 4 hours to just 8 minutes.
2. Decoupled Error Correction (DEC)
Standard error correction methods often fail when faced with "blended" errors from multiple sources. DEC addresses this by mathematically separating temporal errors (from caching) and structural errors (from quantization). It applies channel-wise correction for each:
- Cache Correction: Aligns cached outputs with ground-truth feature maps.
- Quantization Correction: Aligns quantized outputs with their floating-point counterparts. This training-free approach can be folded directly into the model's weights, introducing zero operational overhead during inference.
Experimental Results
CacheQuant was evaluated across diverse benchmarks, including MS-COCO, ImageNet, and LSUN, using both UNet and DiT architectures.
- Performance Gains: On Stable Diffusion (MS-COCO), the framework achieved a 5.18× speedup and a 4× reduction in model size.
- Quality Preservation: The quality loss was nearly imperceptible, with only a 0.02 drop in CLIP score. On ImageNet (LDM-4), CacheQuant improved the FID score from 15.36 (naive stacking) to 7.21.
- Hardware Versatility: Beyond high-end GPUs, the framework demonstrated significant efficiency gains on CPU and ARM-based mobile devices, where memory constraints are most severe.
Conclusion
CacheQuant demonstrates that the key to accelerating diffusion models lies in the joint optimization of temporal and structural redundancies. By decoupling error sources and using dynamic programming for scheduling, it provides a practical, training-free solution for deploying state-of-the-art generative models on resource-constrained hardware. Future work will explore extending these optimizations to video diffusion and ultra-low bitwidth (4-bit) quantization.
Summary updated