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

Edge-Cloud Routing for Text-to-Image Model with Token-Level Multi-Metric Prediction

Zewei Xin, Qinya Li, Chaoyue Niu, Fan Wu · OpenReview

Abstract: Large text-to-image models demonstrate impressive generation capabilities; however, their substantial size necessitates expensive cloud servers for deployment. Conversely, light-weight models can be deployed on edge devices at lower cost but often with inferior generation quality for complex user prompts. To strike a balance between performance and cost, we propose a routing framework, called RouteT2I, which dynamically selects either the large cloud model or the light-weight edge model for each user prompt. Since generated image quality is challenging to measure directly, RouteT2I establishes multi-dimensional quality metrics, particularly, by evaluating the similarity between the generated images and both positive and negative texts that describe each specific quality metric. RouteT2I then predicts the expected quality of the generated images by identifying key tokens in the prompt and comparing their impact on the quality. RouteT2I further introduces the Pareto relative superiority to compare the multi-metric quality of the generated images. Based on this comparison and predefined cost constraints, RouteT2I allocates prompts to either the edge or the cloud. Evaluation reveals that RouteT2I significantly reduces the number of requesting large cloud model while maintaining high-quality image generation.

Introduction

State-of-the-art text-to-image (T2I) models, such as Stable Diffusion 3.5, have achieved remarkable fidelity but come with significant computational costs. Deploying these models typically requires expensive cloud infrastructure. While "edge" versions—optimized through quantization or pruning—can run locally on consumer hardware, they often struggle with complex prompts, leading to visual artifacts or poor adherence to instructions.

The central challenge is routing: determining automatically which prompts are simple enough for local edge execution and which require the superior capabilities of the cloud. Unlike text-based Large Language Models (LLMs), where routing can often rely on single-dimensional confidence scores, image quality is inherently multi-dimensional. A single image might excel in color accuracy while failing in anatomical realism or object integrity.

The RouteT2I framework dynamically routes user requests to either a cloud-based large model or an edge-based light-weight model based on predicted quality.

The RouteT2I Framework

To address these challenges, we introduce RouteT2I, a framework that treats routing as a multi-objective optimization problem. The system is built upon three core innovations:

1. Multi-Metric Quality Assessment

Rather than relying on a single aesthetic score, RouteT2I evaluates images across 10 distinct dimensions, including realism, object integrity, and sharpness. It utilizes a contrastive approach with CLIP embeddings, comparing generated images against "positive" and "negative" text pairs (e.g., "High definition photo" vs. "Low definition photo") to quantify specific quality attributes.

2. Pareto Relative Superiority (PRS)

To compare the multi-metric performance of edge versus cloud models, we define Pareto Relative Superiority. PRS identifies prompts where the cloud model provides a substantial, non-trivial upgrade across the metric suite, ensuring that cloud resources are only utilized when they offer a clear advantage.

3. Dual-Gate Token Selection MoE

The core of the router is a Mixture-of-Experts (MoE) model that predicts quality at the token level. By using a "token selection gate," the router identifies which specific words in a prompt (e.g., "skeleton" or "frosting") are most likely to influence specific quality metrics. This allows the system to be sensitive to the nuances of prompt composition.

Key Insights: The Noun Count Heuristic

Our analysis revealed a strong correlation between prompt complexity and the performance gap between models. By using the number of nouns as a proxy for complexity, we observed that simple prompts often yield diminishing returns when sent to the cloud. As the complexity increases, the cloud model's ability to maintain object integrity and realism becomes significantly more valuable.

Quantitative analysis shows that the quality gap (ImageReward Score Gap) and the cloud model's win rate increase significantly as the number of nouns in a prompt grows.

Experimental Results

We evaluated RouteT2I using the COCO 2014 and LAION2B-en-aesthetic datasets across 18 different model pairs, including various versions of Stable Diffusion and PixArt-α.

  • Efficiency: When configured to route 50% of requests to the cloud, RouteT2I captured 83.97% of the maximum possible quality improvement.
  • Cost Savings: Compared to a random routing baseline, RouteT2I achieved the same quality targets while reducing cloud requests by 70.24%.
  • Performance: The framework consistently outperformed adapted LLM routing baselines (like RouteLLM) across all 10 quality metrics.
  • Low Overhead: The routing model is highly efficient, featuring only 58M parameters and adding approximately 64ms of latency on edge hardware like the NVIDIA Jetson TX2.

Conclusion

RouteT2I demonstrates that intelligent, token-level routing can effectively bridge the gap between high-performance cloud models and cost-effective edge deployment. By predicting multi-metric quality gaps, the framework ensures that computational resources are allocated where they provide the most significant visual benefit, paving the way for more sustainable and accessible generative AI.

Summary updated

BibTeX
@misc{xin2024edge,
  author = {Zewei Xin and Qinya Li and Chaoyue Niu and Fan Wu},
  title = {{Edge-Cloud Routing for Text-to-Image Model with Token-Level Multi-Metric Prediction}},
  year = {2024},
  eprint = {2411.13787},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.13787},
}
Figure