IN THIS BREAKDOWN · 10 SECTIONS
You can read 22% of this breakdown.
The paper in one minute
Large models answer hard questions better, but the price gap between a frontier model and a small one can exceed 50× per token. Many queries, such as greetings, simple lookups and short rewrites, are answered just as well by the small model. A router that sends each query to the cheapest model that will handle it well can cut cost without hurting quality, provided it can tell easy from hard before any model answers.
RouteLLM, from Berkeley and Anyscale (Isaac Ong, Amjad Almahairi, Ion Stoica and colleagues), frames this as learning from preferences. Chatbot Arena collects human votes on which of two models' answers was better for a real user query. From about 65,000 such comparisons across 64 models, grouped into 10 strength tiers, the authors train a win-prediction model: given a query, the probability that a strong model's answer would beat a weak model's. A threshold on that probability decides routing, so one setting trades cost for quality. Each query goes to exactly one model, unlike cascades that try the cheap model first and escalate, which add latency.
They compare four router designs: a similarity-weighted Elo ranking computed at query time, matrix factorization over query and model embeddings, a BERT classifier, and a classifier fine-tuned from Llama 3 8B. Arena data alone worked for open-ended chat but routed math and multiple-choice questions no better than random, because those look unlike Arena traffic. Augmenting with about 120,000 GPT-4-judged comparisons (costing about $700), or with roughly 1,500 gold-labeled MMLU validation items, fixed that.
Routing between GPT-4 and Mixtral-8x7B, the best router reached 95% of GPT-4's MT Bench score while sending 13.4% of queries to GPT-4, against 49% for a random router: 3.66× fewer expensive calls. The same routers, without retraining, worked for Claude 3 Opus with Sonnet and for Llama 3.1 70B with 8B.
Research notes: the problem, approach and results
fewer GPT-4 calls than a random router at 95% of GPT-4's MT Bench score
of training data, as in-domain gold labels, was enough to fix out-of-domain routing on MMLU
added cost of the most expensive router, relative to GPT-4 generation
Strong models answer better but can cost 50× more than small ones, and most queries do not need them. Sending everything to the strong model wastes money; sending everything to the weak one loses quality.
Learn, from human pairwise preferences, a model that predicts whether the strong model would beat the weak one on a given query, then route to the strong model only when that probability exceeds a threshold.
On MT Bench, the best router matched 95% of GPT-4's score with 13.4% GPT-4 calls against 49% for random routing; on MMLU and GSM8K, gains needed small in-domain augmentation. Routers transferred to new model pairs without retraining.
Why it matters to an FDE
Routing is one of the most direct levers on a customer's AI bill. This paper shows it works, and also why a router trained on someone else's traffic can fail on yours with no visible error.
Most savings come from knowing your query mix. Routers trained on general chat routed math and exam questions no better than random. A router has to be trained or at least validated on the customer's queries. The fix was small: under 2% in-domain labeled data restored good routing on MMLU.
LLM judges make router training cheap. Labeling which model's answer is better can be automated with a strong model as judge, checked against a sample of human labels. The authors built 120,000 labels for about $700.
Define quality relative to the strong model. The paper's metric, the share of the quality gap between weak and strong models recovered, makes the trade-off concrete: "keep 95% of the strong model's quality at the lowest cost" is a target a customer can approve.
A router is cheap to run. The most expensive router added at most 0.4% to GPT-4 generation cost, and the fastest handled over 150 requests per second on one L4 GPU.
Routers outlive model upgrades, partly. Routers generalized to new strong/weak pairs without retraining, because they learn what makes a query hard. Still re-validate when either model changes.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 49 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦4 results tables
- ?5 interview questions with answers
- 03Key takeaways
How routers are trained and measured, what generalized, and the misreadings to avoid
Free account - 04How it works
The win-prediction framing, each router architecture, the augmentation data and the metrics
Premium - 05The numbers that matter
Results by benchmark and router, generalization, cost savings and overhead
Premium - 06Try it yourself
Train a small win-prediction router and watch it fail on a new domain until it sees a little of it
Premium - 07Where it breaks
What learned routing does not cover, and the limits of the evaluation
Premium - 08Using it on a deployment
Building and validating a router for a customer's traffic
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
