We study personalized LLM routing, where a router selects among heterogeneous models with different costs and capabilities. The router must minimize cumulative inference cost while ensuring reliable realized response quality, even though user preferences are unknown and must be learned from feedback during deployment. We formulate this problem as a constrained contextual bandit and develop an algorithm that learns preferences while balancing cost and quality. Under a logistic preference model and a strict-feasibility condition, we establish sublinear expected cost regret relative to an optimal stationary randomized contextual oracle and a high-probability guarantee on realized cumulative satisfaction. The framework extends beyond LLM routing to broader online model-selection problems with reliability requirements.
Figures & tables
Method
Online
Personalized
Safety
FrugalGPT
×
×
×
RouteLLM
×
×
×
PersonalizedRouter
×
✓
×
MetaRouter
✓
✓
×
BaRP
✓
✓
×
Conformal Routing
×
×
✓
Table 1: Comparison of LLM routing approaches.
at←argmina∈A[c(a)−λtUCBt(a)].
Algorithm 1 Primal-Dual GLM-UCB Router
Figure 1: Comparison of the proposed routing algorithm with alternative routing strategies as the satisfaction tolerance ϵ varies. In the third panel, the green and orange curves overlap.
Figure 2: Overall performance and ablation results. Error bars denote 95% confidence intervals. The dotted lines indicate the required satisfaction level 1−ϵ=0.8 and constraint probability 1−δ=0.95 , respectively.
Figure 3: Real-LLM routing POC: (a) average routing cost as a function of ϵ and (b) model-selection composition as a function of ϵ .
Figure 4: Personalized and global routing costs for Users 1–3.
Figure 5: Per-round and cumulative cost gap relative to the oracle across horizons.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Sensitivity to the satisfaction tolerance ϵ . Dashed lines indicate the corresponding satisfaction and constraint thresholds.
Figure 7: Confidence Calibration
Figure 8: Empirical probability of satisfying the chance constraint over 5000 independent trials.
Large language model routing selects models, tools, experts, or inference strategies to balance answer quality, cost, latency, and deployment constraints.
Large language models (LLMs) present a trade-off between performance and cost, where more powerful models incur greater expense. LLM routing aims to mitigate expenses while maintaining performance by sending queries to the most suitable model. However, existing methods cannot perform well for different user cost-performance preferences. To address this gap, we introduce a novel perceptive LLM routing paradigm for personalized and user-centric cost-performance optimization, which efficiently learns users' implicit preferences through little interaction. To handle the challenge of heterogeneous user needs, we formulate preference profiles as a set of distinct tasks in contextual bandit and propose MetaRouter, a meta-learning framework designed for preference-aware LLM routing. Experimental results show that MetaRouter outperforms strong baselines on both in-distribution and out-of-distribution tasks. Furthermore, it exhibits high efficiency in learning user preferences, robustness to changes in the routable LLMs, and scalability to multi-model routing.
Jiahao Zeng, Ming Tang, Ningning Ding
Hong Kong University of Science and Technology (Guangzhou) · Southern University of Science and Technology
Large language models (LLMs) achieve impressive performance across multiple domains, but using the most capable model for every query is prohibitive at scale. LLM routing exploits diversity in model capability and cost by assigning each query to a suitable model to balance utility and budget. Current methods have two limitations: (i) they either use heuristics that do not always enforce the budget constraint or impose a fixed per-query budget that cannot adapt across the workload and leads to suboptimal performance; (ii) they require supervised learning on a dense dataset with statistics for every query-model pair, which is expensive to collect. To address these challenges, we formulate LLM routing as a constrained contextual multi-armed bandit problem and introduce WISERouter (WR for short), a framework that supports offline learning from historical interactions as well as online learning with exploration. We further prove that WR-Online achieves a sublinear regret bound of O(T) over a time horizon T. Empirical results on RouterBench and SWE-Bench demonstrate that (i) WR-Offline surpasses existing baselines in performance under a fixed budget and adheres more closely to budget constraints, and (ii) WR-Online achieves comparable performance to the baselines, while using substantially less exploration data.
Inference costs for large language model (LLM) applications are rapidly growing, driven by surging demand and rising infrastructure cost. Users expect high-quality responses, and in commercial settings this is formally codified in Service Level Agreements (SLAs), creating a fundamental tension between cost and quality. Recent progress on cost-aware LLM request routing has shown potential to resolve this tension, but existing approaches rely on complete feedback signals, offline training, extensive per-workload tuning, and most lack SLA guarantees or inference-time adaptivity. We introduce SLARouter, an online routing algorithm that learns a cost-optimal policy from the sparse, one-sided user feedback available in production systems. SLARouter provides theoretical guarantees for both cost optimality and strict SLA compliance. Experiments across a wide range of LLM benchmarks show that SLARouter satisfies SLA constraints without the need for per-benchmark tuning, reducing operating cost by up to 2.2x over existing baselines.
Herbert Woisetschläger, Arastun Mammadli, Ryan Zhang +1
Technical University of Munich Germany · University of Exeter United Kingdom · Horace Greeley High School United States