TL;DR
Deploying large language model (LLM) routers traditionally requires expensive, manually annotated in-domain datasets to balance cost and performance. This paper introduces a multi-level task-profile-guided data synthesis framework that automatically generates diverse training data, alongside TRouter, a routing model that leverages latent task types to achieve robust, state-of-the-art routing performance in cold-start scenarios without any human-labeled data.
What Problem Does This Paper Address?
Different LLMs exhibit massive variance in both financial cost and response quality depending on the complexity of the query. LLM routing systems solve this by dynamically directing user queries to the most cost-effective model capable of handling the task.
However, existing routers face a severe cold-start problem: they rely on extensive in-domain training data where every query has been pre-evaluated across all candidate LLMs. Collecting this data is slow, expensive, and impractical for early-stage products or individual developers. Furthermore, standard routers generalize poorly when encountering domain shifts at deployment.
Methods
The authors propose a two-pronged approach to eliminate the need for human-annotated routing data:
- Task-Profile-Guided Data Synthesis: Starting from a few basic seed domains, an LLM automatically constructs a three-level hierarchical task taxonomy consisting of Domains, Subcategories, and Difficulty Levels. A Task Type Quality Evaluator uses iterative self-critique to eliminate taxonomic redundancy. Finally, a Question-Answer Pair Generator produces diverse QA pairs for each difficulty profile, using sentence-transformer embeddings to filter out near-duplicates.
- TRouter (Task-Type-Aware Router): Instead of predicting cost and performance directly from raw query text embeddings (which leads to overfitting), TRouter introduces an unobserved latent task-type variable ($t$). It uses a variational framework to approximate the task type distribution for a query, predicting performance and cost as a weighted combination of task-specific metrics. The model is optimized using the Evidence Lower Bound (ELBO) to regularize the router against domain shifts.
Datasets
The framework was rigorously evaluated across multiple distinct datasets:
- Primary Evaluation: Alpaca (Hybrid QA), GSM8K (Grade-school Math Reasoning), SQuAD (Reading Comprehension), and Multi-News (Summarization).
- Supplementary Tasks: WMT (Translation), MBPP (Python Programming), LegalBench (Legal Domain), and MedMcQA (Medical QA).
The candidate model pools featured the open-source Qwen 3 series (ranging from 0.6B to 235B parameters) as well as commercial APIs including the Gemini series and Doubao-Seed models.
Key Insights and Ideas
- Difficulty-Conditioned Sampling Wins: Generating synthetic data purely based on broad domains or subcategories quickly hits a redundancy wall. By explicitly conditioning the generation prompts on fine-grained difficulty levels (e.g., Easy vs. Expert), the LLM generates highly diverse queries that accurately mimic real-world test distributions. Sampling efficiency across taxonomy levels
- Latent Semantics Prevent Overfitting: Standard regression routers overfit to surface-level textual features. Forcing the router to map queries to an intermediate latent task space acts as a powerful regularizer, ensuring the router focuses on the underlying structural complexity of the task.
- High Sample Efficiency: TRouter doesn't need massive datasets. Because the latent task taxonomy provides structured priors, the router achieves near-optimal routing utility with as few as 5 to 10 synthetic training examples per task type.
Key Results
- Cold-Start Superiority: In strict cold-start settings (zero real-world training data), TRouter trained purely on synthetic data ($D_{syn}$) substantially outperformed all baseline methods, including rule-based adaptive routing and prompt-based LLM selectors.
- Beating In-Domain Baselines: When evaluated using an LLM-as-a-judge protocol, TRouter trained solely on synthetic data outperformed established routing frameworks (like RouterDC and GraphRouter) that were trained on actual in-domain data.
- Cross-Domain Robustness: While traditional regression routers suffered severe performance degradation under domain shifts, TRouter maintained stable utility sums across both open-source and commercial closed-source model pools.
Limitations and Future Work
- Minimal Human Bootstrapping: The framework still requires a human to provide initial seed domains or a high-level application description to kickstart the taxonomy generation.
- Evaluation Protocol Sensitivity: The authors noted a discrepancy in performance patterns between traditional surface-form metrics (like F1 score) and LLM-as-a-judge evaluations. They emphasize that developers must carefully align their router's training evaluation protocol with the actual downstream application needs.
- Unvalidated Synthetic Quality: While the framework filters out semantic duplicates, it does not explicitly validate the factual correctness of the generated QA pairs, relying instead on the router's inherent robustness to task-level statistical noise.
Summary updated