RACER: Risk-Aware Calibrated Efficient Routing for Large Language Models
Organizations: Southern University of Science and Technology, China · The Chinese University of Hong Kong, Shenzhen, China · Shenzhen Loop Area Institute, China
Abstract
Efficiently routing queries to the optimal large language model (LLM) is crucial for optimizing the cost-performance trade-off in multi-model systems. However, most existing routers rely on single-model selection, making them susceptible to misrouting. In this work, we formulate LLM routing as the -VOR problem to minimize expected set size while controlling the misrouting risk, and propose a novel method -- RACER, extending base routers to output model sets that can be subsequently aggregated for improved output. In particular, RACER constructs nested model sets via augmented scoring and utilizes finite-sample concentration bounds to calibrate a threshold that allows for both variable set sizes and abstention. We theoretically prove that RACER achieves rigorous distribution-free risk control on unseen test data in a post-hoc and model-agnostic manner. Extensive experiments verify our theoretical guarantees and demonstrate that RACER consistently enhances downstream accuracy across a wide range of benchmarks.
Figures & tables
| Method | GSM8K | MMLU | C-MMLU | ARC-C | Average |
|---|---|---|---|---|---|
| Candidate Models | |||||
| Chinese-Mistral-7B-v0.1 | 42.7 1.4 | 57.5 0.8 | 49.1 1.0 | 45.3 2.4 | 48.7 |
| Dolphin-2.6-Mistral-7b | 54.7 1.5 | 60.7 0.8 | 44.2 0.9 | 53.7 2.1 | 53.3 |
| Dolphin-2.9-Llama3-8b | 75.0 1.2 | 59.6 0.8 | 43.9 0.9 | 49.8 2.2 | 57.1 |
| Meta-Llama-3-8B | 47.1 1.5 | 64.6 0.8 | 51.2 0.9 | 50.5 2.2 | 53.4 |
| MetaMath-Mistral-7B | 75.1 1.2 | 59.9 0.8 | 44.4 1.0 | 48.7 2.3 | 57.0 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Method | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| 0.01 | 0.05 | 0.10 | 0.15 | 0.20 | 0.30 | 0.40 | 0.50 | ||
| GSM8K | KNNR+RACER-G | 0.010 | 0.048 | 0.098 | 0.147 | 0.197 | 0.297 | 0.394 | 0.495 |
| KNNR+RACER-P | 0.009 | 0.048 | 0.098 | 0.147 | 0.196 | 0.296 | 0.395 | 0.495 | |
| MLPR+RACER-G | 0.010 | 0.048 | 0.096 | 0.145 | 0.195 | 0.297 | 0.396 | 0.497 | |
| MLPR+RACER-P | 0.010 | 0.048 | 0.096 | 0.145 | 0.195 | 0.296 | 0.396 | 0.497 | |
| RouterDC+RACER-G | 0.009 | 0.048 | 0.099 | 0.146 | 0.195 | 0.296 | 0.394 | 0.493 | |