RouterBench: A Benchmark for Multi-LLM Routing System

Qitian Jason Hu, Jacob Bieker, Xiuyu Li, Nan Jiang, Benjamin Keigwin, Gaurav Ranganath, Kurt Keutzer, Shriyash Kaustubh Upadhyay · DOI

Abstract

As the landscape of Large Language Models (LLMs) expands, developers face a significant challenge in balancing performance and cost. "Routing"—dynamically selecting the optimal model for a specific query—offers a potential solution. However, the lack of standardized evaluation frameworks has hindered progress. This paper introduces RouterBench, the first comprehensive evaluation framework and dataset for LLM routers. With over 405,467 inference outcomes across 11 models, RouterBench demonstrates that intelligent routing can reduce costs by 2–5x while maintaining top-tier performance.

Introduction

The current AI ecosystem features a diverse array of LLMs, from massive proprietary systems like GPT-4 to efficient open-source models like Mistral-7B. Selecting the right model for a task is a "Goldilocks" problem: high-end models are often overkill for simple tasks, while smaller models may fail at complex reasoning. While routing systems have emerged to address this, their effectiveness remains difficult to quantify. RouterBench provides a rigorous mathematical framework and a massive dataset to standardize the evaluation of these routing mechanisms.

Methodology

RouterBench formalizes LLM routing through several key components:

  1. Mathematical Framework: Routing is modeled as a trade-off in the "cost-quality" (c-q) plane. A new metric, AIQ (Average Improvement in Quality), is introduced to calculate the area under a router's cost-performance curve, providing a unified score for comparison.
  2. Baselines and Predictive Routers: The framework defines a "Zero Router" baseline using a probabilistic mix of models on the convex hull. It also evaluates supervised learning approaches, such as k-nearest neighbors (KNN) and multi-layer perceptrons (MLP), which predict the best model for an input without prior inference.
  3. Cascading Routers: These systems attempt models sequentially, starting with the most cost-effective. A "judge" function determines if the output is sufficient; if not, the query is escalated to a more capable model.

The RouterBench Dataset

The dataset comprises 405,467 samples across 11 models and 64 tasks, derived from eight established benchmarks including MMLU, GSM8K, and MBPP. Additionally, the authors contributed a new Retrieval-Augmented Generation (RAG) dataset with 800 real-world queries to test routing for time-sensitive information. The 11 models evaluated include both proprietary leaders (GPT-4, Claude-v2) and open-source models (Llama-70B, Mixtral-8x7B, Yi-34B).

Key Insights and Results

Analysis using an "Oracle Router"—which always selects the cheapest successful model—reveals that GPT-4 is rarely the optimal choice, suggesting significant current overspending on intelligence.

Key results include:

  • Cost Efficiency: Routing strategies reduce costs by 2–5x while maintaining competitive performance.
  • Predictive and Cascading Success: Simple predictive routers match the performance of top individual LLMs at lower costs. Cascading routers excel when the internal "judge" has a low error rate (under 10%).
  • RAG Optimization: Routers effectively identify time-sensitive queries, directing them to models with search capabilities while using cheaper models for static queries.

Limitations and Future Work

Current evaluations focus on accuracy and cost. Future work should incorporate latency and throughput metrics. As the LLM landscape evolves, the benchmark will need to include newer models and more diverse tasks, such as long-context reasoning.

Summary updated

BibTeX
@inproceedings{hu2024routerbench,
  author = {Qitian Jason Hu and Jacob Bieker and Xiuyu Li and Nan Jiang and Benjamin Keigwin and Gaurav Ranganath and Kurt Keutzer and Shriyash Kaustubh Upadhyay},
  title = {{RouterBench: A Benchmark for Multi-LLM Routing System}},
  booktitle = {AGI @ ICLR},
  year = {2024},
  url = {https://openreview.net/forum?id=C0rs3wM0N8},
}
Figure