GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
arXiv preprint

BEST-Route: Adaptive LLM Routing with Test-Time Optimal Compute

Routers overuse the big model because one small-model answer rarely matches it. BEST-Route also picks how many small-model answers to sample: 60% cheaper than GPT-4o, under 1% quality loss.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2025
AUTHORS
Ding, Mallick, Zhang, Wang, et al.
FROM
University of British Columbia, Microsoft, Pennsylvania State University, Google DeepMind, AG2AI
PUBLISHED
Jun 2025 · arXiv preprint
CITED BY
84Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 20% of this breakdown.

01

The paper in one minute

Query routing sends each request to one of several models: easy ones to cheap models, hard ones to an expensive reference model. In practice the savings are small. When the reference is GPT-4o and the alternatives are 7-8B or small mixture models, one answer from a small model is seldom as good, so a router that wants to protect quality sends nearly everything to GPT-4o. In the paper's tests, two prior routers achieved essentially 0% cost reduction.

Best-of-n sampling changes the comparison. Generate several answers from a cheap model and keep the best; the chosen answer is often as good as the big model's, and with the paper's prices five answers from Phi-3-mini still cost far less than one from GPT-4o (input tokens are charged once when several outputs are requested together). The catch is picking the best answer: an LLM judge is too slow and expensive per request.

BEST-Route (Best-of-n Enhanced Sampling and Test-time Route Optimization) has two parts. A proxy reward model, a 300M DeBERTa-large, is trained with a pairwise ranking loss to order answers the way an 8B judge (armoRM) does, using the worst, median and best of 20 sampled answers per training query. A multi-head router on a 44M DeBERTa-small backbone has one head per (small model, n) pair, each predicting the probability that the best of n answers is at least as good as GPT-4o's single answer. At serving time a user-chosen threshold sets the trade-off: among (model, n) options whose predicted probability clears it, BEST-Route takes the cheapest (using token prices and the model's average output length); if none does, it calls GPT-4o once.

On a new 10,000-query dataset of instructions, coding and safety prompts with eight models, BEST-Route reduced cost by 60% with a 0.80% quality drop measured by armoRM, where the best baseline lost 5.08%. Adding a coding specialist let it be 20% cheaper than GPT-4o on coding while scoring slightly higher.

THE IDEA, VISUALLY
ONE ROUTING DECISION (ALGORITHM 1) query multi-head router (DeBERTa-small) P(best-of-n ≥ GPT-4o) per model, n n = 1 2 3 4 5 (illustrative) phi-3-mini 0.31 0.52 0.64 0.71 0.75 llama-3.1-8b 0.38 0.58 0.69 0.76 0.80 mistral-8x7b 0.33 0.50 0.60 0.66 0.70 threshold 0.6: pick the cheapest green cell if no cell clears the threshold: one GPT-4o call cost = n x avg output length x output price + prompt length x input price (prompt paid once) BEST-OF-N WITH A CHEAP JUDGE (SECTION 4.1) generate n answers from the chosen model, score them with a 300M DeBERTa-large reward model trained to rank like an 8B judge (armoRM); return the top-scoring answer Why it beats plain routing: one small-model answer rarely matches GPT-4o, so routers send most traffic to GPT-4o; best-of-n from a small model often matches it for less. overhead at n = 20: router 0.04 s + reward model 0.58 s QUALITY DROP VS ALWAYS GPT-4O (TABLE 1) armoRM score, % below GPT-4o, at each cost cut 10% cheaper 0.63% N-label 0.19% BEST-Route 20% cheaper 1.17% N-label 0.21% BEST-Route 40% cheaper 3.26% N-label 0.47% BEST-Route 60% cheaper 5.08% N-label 0.80% BEST-Route N-class and clustering routers: ~0% cost cut WHY SMALL MODELS FIT THE BUDGET (TABLE 6) $ per 1K queries, 500 tokens in, 300 out (our arithmetic) GPT-4o, 1 answer $7.00 Phi-3-mini, best of 5 $1.50 Llama-3.1-8b, best of 5 $1.06 GPT-3.5-turbo, best of 5 $10.50 ALSO (SECTIONS 5.3-5.5) adding Codestral-22b on coding: 20% cheaper AND 0.5% better than GPT-4o; MT-Bench (out of distribution): 60% cut with 1.59% drop vs 5.89% for N-label
BEST-Route treats 'which model' and 'how many samples' as one decision: for each query it picks the cheapest small model and sample count likely to match the big model, and keeps the best sample by a cheap judge.
Research notes: the problem, approach and results
60%

lower cost than always using GPT-4o, with a 0.80% drop in reward-model quality score

4.28 points

smaller quality drop than the best prior router (N-label) at the same 60% cost cut

4.7x

cheaper per query: best-of-5 from Phi-3-mini vs one GPT-4o answer at the paper's prices (500 tokens in, 300 out; our arithmetic)

THE PROBLEM

Query routers save money by sending easy queries to small models, but a single small-model answer rarely matches a frontier model's, so in practice routers send most traffic to the expensive model and save little. Best-of-n sampling can lift a small model's quality, but judging samples with a large LLM is too slow and costly for serving.

THE IDEA

Train a small proxy reward model (300M) to rank answers the way an 8B judge does, so best-of-n is cheap. Train a multi-head router (44M) to predict, for each small model and each sample count n, the probability that the best of n matches one answer from the reference model. At serving time, choose the cheapest (model, n) whose predicted match probability clears a threshold; otherwise call the reference model once.

THE RESULT

On a 10,000-query mix of QA, coding and safety prompts with GPT-4o as reference and six cheaper models, BEST-Route cut cost 60% with a 0.80% quality drop, against 5.08% for the best prior router. Routing overhead was 0.04 s plus 0.58 s for the reward model at n = 20.

02

Why it matters to an FDE

Many customer workloads use a frontier model for every request because a single cheaper answer isn't good enough. BEST-Route's lesson is that "cheaper model" and "more test-time compute" combine: several samples from a small model, filtered by a small judge, can match the big model for a large share of traffic.

The judge sets the ceiling. Best-of-n only helps if the scorer picks the truly better answer. A small, fast reward model trained to agree with a trusted judge on the customer's data is the enabling piece.

Price structure matters. The method depends on paying for the prompt once while sampling several outputs, which self-hosted engines and many APIs allow. Long prompts with short answers favor it most.

Quality is measured by a model. The paper's "under 1% loss" is in reward-model score, not human ratings or task accuracy; validate on the customer's own success measure before switching traffic.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 149 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

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The router and judge design, cost estimation, what drives savings, limits and three misreadings

    Free account
  2. 04How it works

    The proxy reward model, the multi-head router, the cost estimate and the serving algorithm

    Premium
  3. 05The numbers that matter

    Main results, coding with a specialist, out-of-distribution, metrics and overhead

    Premium
  4. 06Try it yourself

    Price best-of-n against GPT-4o, recheck Table 1, and simulate routing with and without sampling

    Premium
  5. 07Where it breaks

    Judge-based metrics, price assumptions, latency, data needs and slips

    Premium
  6. 08Using it on a deployment

    Building the judge, collecting router labels, choosing thresholds and validating on real outcomes

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →