Introduction
Diffusion models have set new benchmarks in high-fidelity image generation. However, their iterative denoising process—often requiring 50 or more steps—imposes significant computational overhead. This leads to high GPU costs and latencies that impede real-time interactive applications. While traditional caching works for exact prompt matches, it fails for the diverse, long-tail nature of user queries. NIRVANA addresses this by introducing "approximate caching," a method that reuses intermediate states from semantically similar prompts to accelerate the generation process.
Methodology: The NIRVANA System
NIRVANA optimizes the diffusion pipeline by identifying that early denoising steps primarily establish high-level image characteristics like layout and color, while later steps refine specific details.
The system consists of four primary components:
- Approximate Caching: Uses CLIP embeddings and a Vector Database (VDB) to find similar prompts and retrieve their intermediate noise states ($x_K$).
- Match Predictor: A lightweight One-Class SVM that determines if a cache hit is likely, preventing unnecessary VDB lookups.
- Cache Selector: A heuristic module that dynamically chooses the number of steps ($K$) to skip based on prompt similarity.
- LCBFU Policy: A specialized cache eviction policy (Least Computationally Beneficial and Frequently Used) that prioritizes states offering the highest cumulative computation savings.
Key Insights: Semantic Reconditioning
A core finding of this work is that the diffusion process is robust to "reconditioning." An intermediate state generated for one prompt (e.g., "A cat with a pullover") can be successfully steered toward a different but related prompt (e.g., "A woman in a hijab with a sweatshirt") if the transition occurs early enough in the denoising process.
The researchers observed that layout is typically "frozen" within the first 20% of steps, while fine artistic style is determined in the final 50%. By skipping up to $K=25$ steps, NIRVANA allows the model sufficient iterations to adapt the retrieved noise to the specific nuances of the new request.
Evaluation and Results
The system was evaluated using DiffusionDB and a large-scale production dataset (SYSTEM-X) containing over 7 million images.
- Efficiency: NIRVANA achieved a 21% reduction in GPU compute and a 19.8% reduction in end-to-end latency on real production workloads.
- Throughput: System throughput improved by 27% compared to vanilla implementations.
- Quality: Human evaluations showed that 79% of users preferred NIRVANA-generated images, nearly matching the 86% preference for vanilla models while being significantly faster.
- Cost: The system reduced the dollar-cost of image generation by approximately 19%.
Conclusion
NIRVANA demonstrates that approximate caching is a viable strategy for scaling diffusion model inference. By exploiting the temporal dynamics of the denoising process and using semantic similarity to warm-start generation, the system provides substantial cost and latency savings without compromising visual quality. Future work includes improving CLIP's handling of long prompts and investigating the impact of state reuse on image diversity.
Summary updated