NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MoDM: Efficient Serving for Image Generation via Mixture-of-Diffusion Models

Yuchen Xia, Divyam Sharma, Souvik Kundu, Nishil Talati

TL;DR

MoDM is a caching-based serving framework for diffusion models that pairs small and large models to optimize the latency-versus-quality trade-off. Instead of caching model-specific latent states, MoDM caches final images, retrieves them using cross-modal text-to-image similarity, and refines them with lightweight models while saving large models for cache misses. Guided by a PID-regulated global scheduler, MoDM achieves up to a 3.2× throughput speedup and cut energy use by up to 66% with negligible loss in visual quality.

What Problem Does This Paper Address?

Text-to-image diffusion models generate stunning visuals but require iterative denoising over dozens of steps, making serving them slow (taking tens of seconds) and computationally expensive.

Prior serving systems attempt to cut computation via approximate caching (e.g., Nirvana), storing intermediate noisy latent tensors to skip early denoising steps. However, latent caching has major pitfalls:

  1. Model Lock-In: Latent representations are tightly coupled to a specific model architecture, preventing heterogeneous multi-model serving.
  2. High Storage Overhead: Storing multi-step latent states requires substantial memory (e.g., 2.5 MB per image vs. 1.4 MB for compressed images).
  3. Retrieval Mismatch: Retrieval based solely on text-to-text embeddings often selects images that match prompt keywords but fail visually to align with user intent.

Methods

MoDM reimagines diffusion serving as a mixture-of-models pipeline supported by cross-modal image caching:

  • Caching Final Images: MoDM stores final rendered images (e.g., in PNG/JPEG) along with their CLIP embeddings. Final images are universally interpretable and can be fed into any model architecture.
  • Text-to-Image Cache Retrieval: When a query prompt arrives, MoDM computes its CLIP text embedding and searches the cache for the most visually and semantically aligned image via cosine similarity.
  • Controlled Noise Injection & Dynamic $k$-Selection: If a cached match exceeds a quality threshold, MoDM adds a calibrated amount of Gaussian noise—skipping the first $k$ denoising steps. The value of $k \in \{5, 10, \dots, 30\}$ is dynamically chosen based on similarity score to guarantee an image quality factor $\ge 95\%$ relative to generating from scratch.
  • Small Model Refinement: Because early diffusion steps determine coarse global structure while later steps refine fine details, MoDM offloads the remaining $T - k$ steps of cache hits to a lightweight model (e.g., SDXL or SANA-1.6B). Cache misses are generated from scratch on a large model (e.g., SD3.5-Large or FLUX).
  • PID-Driven Global Monitor: GPU workers dynamically switch roles between hosting large and small models. A Global Monitor continuously tracks hit rates, prompt arrival rates, and workload skew, employing a Proportional-Integral-Derivative (PID) controller to smoothly adjust GPU worker allocation across two operating modes: Quality-Optimized and Throughput-Optimized.
  • FIFO Cache Maintenance: Over 90% of cache hits occur within four hours of the original generation due to bursty user prompt refinement. MoDM adopts a FIFO sliding-window eviction scheme, which maintains high cache utility without biasing generations toward a small set of historically popular images.
Incoming Prompt ---> [Request Scheduler]
                           |
            +--------------+--------------+
            | (Cache Hit)                 | (Cache Miss)
    Retrieve Image + Noise                |
            |                             |
    [Small Model Worker]         [Large Model Worker]
    (Fast Refinement, T-k steps) (Full Denoising, T steps)
            |                             |
            +--------------> Image Out <--+

Datasets

  • DiffusionDB: A production trace of 2 million user prompts and generated images with timestamps, reflecting authentic prompt variations, temporal locality, and user behavior.
  • MJHQ-30k: A curated benchmark of 30,000 high-quality Midjourney-generated images spanning multiple visual categories (used to test scenarios with lower temporal locality).

Key Insights and Ideas

  • Text-to-image similarity beats text-to-text retrieval: Matching prompt text against cached image embeddings achieves higher CLIPScore and PickScore than prompt-to-prompt comparison, filtering out semantic false friends.
  • Cross-model transferability: Because natural images are model-agnostic, a small model (SANA or SDXL) can cleanly denoise and refine an image initially hallucinated by an 8B+ parameter model (SD3.5-Large or FLUX).
  • Super-linear cluster scaling: As GPU count scales, requests are processed faster, populating the FIFO cache sooner. This lifts the effective cache hit rate and yields super-linear throughput scaling on multi-GPU clusters.

Key Results

  • Throughput Improvements: On DiffusionDB, MoDM delivers 2.5× higher throughput using SDXL as the small model, and 3.2× higher throughput using SANA-1.6B, compared to large-model-only serving (SD3.5-Large). When using FLUX as the large backbone, MoDM achieves up to a 2.9× speedup.
  • SLO Compliance & Tail Latency: Under heavy request loads, MoDM maintains steady 99th-percentile response times, sustaining more than 2× the request rate of Nirvana or Vanilla serving before incurring Service Level Objective (SLO) violations.
  • Energy Savings: Measured via the Zeus toolkit, MoDM-SDXL cuts serving energy by 46.7%, while MoDM-SANA cuts energy consumption by 66.3% relative to the Vanilla large model.
  • Output Quality: Cache-hit images guided by the dynamic threshold heuristic achieve an average CLIPScore of 28.50 (99.7% of full-generation baseline quality 28.59). FID scores remain significantly better than running standalone small or distilled models.

Limitations and Future Work

  • Diversity Quantification: While FIFO eviction prevents popular images from monopolizing the cache, the paper acknowledges that rigorous quantitative metrics for generation diversity over long horizons require further study.
  • Model Switching Overhead: Transitioning GPU workers between small and large models involves weight-swapping overhead; while dampening parameters in the PID controller minimize oscillations, rapid unexpected traffic spikes could still trigger re-allocation latency.

Summary updated

BibTeX
@inproceedings{xia2026modm,
  author = {Yuchen Xia and Divyam Sharma and Souvik Kundu and Nishil Talati},
  title = {{MoDM: Efficient Serving for Image Generation via Mixture-of-Diffusion Models}},
  booktitle = {ASPLOS},
  year = {2026},
  url = {https://openreview.net/forum?id=Rqjm9XKWnd},
}
Figure