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

Adaptive Routing of Text-to-Image Generation Requests Between Large Cloud Model and Light-Weight Edge Model

Zewei Xin, Qinya Li, Chaoyue Niu, Fan Wu, Guihai Chen

TL;DR

RouteT2I is a smart routing framework that dynamically decides whether a text-to-image prompt should be processed by a local, lightweight edge model or a powerful, expensive cloud model. By predicting the "quality gap" between models using a novel multi-metric Mixture-of-Experts (MoE) architecture, it achieves over 80% of the quality of a full-cloud setup while slashing cloud requests by up to 70%.

What Problem Does This Paper Address?

The deployment of state-of-the-art text-to-image (T2I) models like Stable Diffusion 3.5 is a double-edged sword. While they produce stunning visuals, their massive size (often billions of parameters) requires expensive cloud infrastructure, leading to high operational costs for commercial applications. Conversely, "edge" models—smaller versions optimized for smartphones or laptops—are cost-effective and private but often struggle with complex prompts, producing distorted or low-quality images.

The core challenge is that not every prompt needs a giant model. A simple request like "a red apple" might look identical coming from a small edge model or a massive cloud model. However, a complex scene with multiple interacting entities requires the "heavy lifting" of the cloud. The authors tackle the problem of predictive routing: how can we determine, before generating an image, which model is "good enough" for a specific prompt to maximize quality while minimizing cost?

Figure 1. Routing for text-to-image generation requests.

Methods

The authors introduce RouteT2I, which consists of three main innovations:

  1. Multi-Dimensional Quality Metrics: Instead of a single "quality score," the system evaluates 10 distinct metrics (e.g., realism, clarity, object integrity, color accuracy). Each metric is measured by comparing a generated image to a pair of positive and negative text prompts (e.g., "High definition photo" vs. "Low definition photo"). This contrastive approach makes the evaluation more robust than looking at a single positive prompt.
  2. Pareto Relative Superiority (PRS): Since an edge model might be better at one metric (like color) but worse at another (like object integrity), the authors use PRS to quantify the overall quality gap between the edge and cloud models across all dimensions.
  3. Dual-Gate Token Selection MoE: This is the "brain" of the router. It treats the user prompt as a sequence of tokens.
  4. Token Selection: Specific "experts" in the model (each aligned to a quality metric) proactively choose the most relevant tokens in the prompt that will impact their specific metric.
  5. Dual-Gate: It uses both positive and negative gates to distinguish between tokens that enhance a quality metric versus those that might cause distortions or errors.

Based on the predicted PRS, the router applies a threshold: if the cloud model is predicted to offer a significant quality boost, the request is sent to the cloud; otherwise, it stays on the edge.

The RouteT2I framework architecture.

Datasets

The researchers evaluated RouteT2I using:

  • COCO 2014: A standard dataset for image captioning, providing a wide variety of objective user prompts.
  • LAION2B-en-aesthetic: A subset of the massive LAION dataset, offering more colloquial and stylistic prompts to test the system's generalization.
  • 18 Model Pairs: They tested routing between various combinations of cloud models (like SD3, SDXL, PixArt-$\alpha$) and edge models (like SD1.5, SD2.1).

Key Insights and Ideas

  • Complexity is the Key: The quality gap between small and large models grows as the number of nouns (entities) in a prompt increases. Simple prompts are "safe" for the edge.
  • Image Quality is Multi-Faceted: A single score often misses subtle failures. By breaking quality down into 10 metrics, the router can detect when a small model might fail on a specific aspect, like "object twisting," even if the overall colors look good.
  • Contrastive Supervision: Training the router to predict the difference between positive and negative quality descriptions (rather than just a raw score) provides a much clearer signal for the model to learn from.
  • Efficiency on the Edge: The routing model itself is tiny (~58M parameters) and runs in about 65ms on a mobile-grade NVIDIA Jetson TX2, adding negligible latency compared to the seconds required for image generation.
Impact of noun count on the quality gap between large and small models.

Key Results

  • Quality Retention: By routing only 50% of requests to the cloud, RouteT2I achieves 83.97% of the quality improvement that would be gained by sending all requests to the cloud.
  • Cost Savings: To reach a target of 50% quality improvement, RouteT2I reduces the number of cloud requests by 70.24% compared to a random routing policy.
  • Robustness: The system outperformed existing routing methods designed for Large Language Models (LLMs), which struggle with the vast and subjective output space of images.
  • Human Alignment: The router's decisions align well with human preference scores (HPSv2), showing that its internal metrics capture what users actually care about.

Limitations and Future Work

The authors acknowledge a few areas for further exploration:

  • Metric Dependency: The system relies on CLIP-based models to measure quality during training. If these models have biases, the router may inherit them.
  • Static Thresholds: Currently, the routing threshold is preset. Future versions could adaptively change the threshold based on real-time cloud pricing or server load.
  • Multi-Model Routing: This work focuses on routing between one edge and one cloud model. Extending this to choose between multiple cloud tiers (e.g., "Small Cloud" vs. "Large Cloud") could further optimize the cost-performance curve.

Summary updated

BibTeX
@misc{xin2024adaptive,
  author = {Zewei Xin and Qinya Li and Chaoyue Niu and Fan Wu and Guihai Chen},
  title = {{Adaptive Routing of Text-to-Image Generation Requests Between Large Cloud Model and Light-Weight Edge Model}},
  year = {2024},
  eprint = {2411.13787},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.13787},
}
Figure