Universal Model Routing for Efficient LLM Inference
Wittawat Jitkrittum, Harikrishna Narasimhan, Ankit Singh Rawat, Jeevesh Juneja, Congchao Wang, Zifeng Wang, Alec Go, Chen-Yu Lee, Pradeep Shenoy, Rina Panigrahy, Aditya Krishna Menon, Sanjiv Kumar
TL;DR
This work addresses the challenge of routing prompts to among a dynamic set of unseen LLMs to minimize inference cost without retraining routers. It introduces UniRoute, a universal routing framework that represents each LLM by a prediction-error-based feature vector and couples it with a prompt representation to learn a cost-aware routing rule that generalizes to unseen models. Two concrete instantiations are proposed: a cluster-based LLM representation (with unsupervised K-means and a learned cluster map) and a general plug-in routing approach using a prediction-error vector; both come with theoretical excess-risk guarantees. Empirical results across diverse benchmarks show UniRoute can effectively route over 30 unseen LLMs, achieving favorable deferral curves and robust performance with limited validation data. The approach offers practical, low-overhead deployment for evolving LLM ecosystems where new models appear frequently.
Abstract
Model routing is a simple technique for reducing the inference cost of large language models (LLMs), wherein one maintains a pool of candidate LLMs, and learns to route each prompt to the smallest feasible LLM. Existing works focus on learning a router for a fixed pool of LLMs. In this paper, we consider the problem of dynamic routing, where new, previously unobserved LLMs are available at test time. We propose UniRoute, a new approach to this problem that relies on representing each LLM as a feature vector, derived based on predictions on a set of representative prompts. Based on this, we detail two effective instantiations of UniRoute, relying on cluster-based routing and a learned cluster map respectively. We show that these are estimates of a theoretically optimal routing rule, and quantify their errors via an excess risk bound. Experiments on a range of public benchmarks show the effectiveness of UniRoute in routing amongst more than 30 unseen LLMs.
