Abstract
Text-to-image generation employing diffusion models has attained significant popularity due to its capability to produce high-quality images that adhere to textual prompts. However, the integration of diffusion models faces critical challenges into resource-constrained mobile and edge environments because it requires multiple denoising steps from the original random noise. A practical way to speed up denoising is to initialize the process with a noised reference image that is similar to the target, since both images share similar layouts, structures, and details, allowing for fewer denoising steps. Based on this idea, we present CacheGenius, a hybrid image generation system in edge computing that accelerates generation by combining text-to-image and image-to-image workflows. It generates images from user text prompts using cached reference images. CacheGenius introduces a semantic-aware classified storage scheme and a request-scheduling algorithm that ensures semantic alignment between references and targets. To ensure sustained performance, it employs a cache maintenance policy that proactively evicts obsolete entries via correlation analysis. Evaluated in a distributed edge computing system, CacheGenius reduces generation latency by 41% and computational costs by 48% relative to baselines, while maintaining competitive evaluation metrics.
The Challenge of Edge-Based Diffusion Models
Generating high-quality images using Diffusion Models (DMs) like Stable Diffusion is computationally expensive. These models typically start from pure random noise and require dozens of iterative "denoising" steps to produce a final image. While this works well on high-end cloud GPUs, it presents a major bottleneck for edge computing—such as tablets, in-vehicle systems, or AR glasses—where hardware is limited and users expect near-instant results.
Existing acceleration methods usually involve model compression (pruning or quantization), which often degrades image quality. CacheGenius identifies a different opportunity: if the denoising process starts with a "noised" reference image that already shares semantic layout with the target, the final result can be reached in significantly fewer steps. The core challenge lies in efficiently storing, finding, and managing these reference images across a distributed network of edge nodes.
CacheGenius: A Hybrid Generation Framework
CacheGenius addresses these challenges through a multi-layered system architecture designed for distributed edge environments.
Key Components:
- Hybrid Generation Pipeline: Instead of always starting from scratch, the system checks a cache. If a highly similar image exists, it is returned immediately. If a moderately similar image is found, it serves as a "warm start" for an image-to-image (i2i) process, requiring roughly 20 steps instead of the standard 50. If no match is found, it falls back to standard text-to-image (t2i).
- Storage Classifier: To manage distributed nodes, the system applies K-means clustering on CLIP embeddings. This ensures that semantically similar images are co-located on the same edge node, accelerating retrieval.
- Prompt Optimizer: Diffusion models are sensitive to word order. CacheGenius uses BERT attention weights and dependency parsing to restructure user prompts, prioritizing "semantic anchors" during generation.
- Least Correlation Used (LCU) Policy: Traditional cache eviction (like LRU) is ineffective for AI content. LCU calculates the center of a semantic cluster and evicts outliers that don't align with the current distribution of user requests, keeping the cache relevant.
The Efficiency of Semantic Warm Starts
A central insight of this work is that image-to-image denoising reaches a high Peak Signal-to-Noise Ratio (PSNR) much faster than text-to-image generation. Starting from a noisy version of a similar image is mathematically more efficient than starting from pure Gaussian noise.
In edge computing, user requests are often repetitive or semantically related (e.g., users in a specific location asking for similar themes). By caching based on meaning rather than just time, the system achieves much higher hit rates for its acceleration pipeline. Furthermore, CacheGenius is model-agnostic; it acts as a "plug-in" layer for standard Stable Diffusion models without requiring retraining of the underlying neural networks.
Performance Evaluation
The system was evaluated using the COCO, DiffusionDB, and Flickr30k datasets in a 4-node edge cluster. Key results include:
- Latency & Cost: CacheGenius reduced generation latency by 41% and cut GPU-related computational costs by 48% compared to standard Stable Diffusion.
- Throughput: The system achieved a 2.1× improvement in throughput, allowing a small edge cluster to handle the load of a much larger one.
- Quality: Quantitative metrics (Inception Score and FID) showed that CacheGenius maintains quality nearly identical to full-step Stable Diffusion. In a human evaluation survey of 40 participants, images generated via the i2i pipeline achieved a 59.3% acceptance rate.
Conclusion
CacheGenius demonstrates that semantic-aware caching is a powerful tool for deploying heavy diffusion models at the edge. By leveraging the mathematical efficiency of image-to-image workflows and intelligent distributed storage, the system provides a significant boost to performance without sacrificing the visual fidelity users expect. Future work will explore extending these caching principles to the even more computationally demanding field of edge-based video generation.
Summary updated