MARS: A Benchmark for Multi-LLM Algorithmic Routing System

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

TL;DR

Deploying Large Language Models (LLMs) requires balancing performance against cost, yet existing router mechanisms lack a standardized way to evaluate how well they balance this trade-off. MARS introduces an offline evaluation benchmark containing over 405k inference outputs across 11 major LLMs and 8 benchmark tasks, paired with a theoretical framework based on non-decreasing convex hulls and an Average Improvement in Quality (AIQ) metric. The findings demonstrate that while an ideal oracle router can achieve near-perfect performance at low cost, simple predictive routers often struggle to beat a naive probabilistic baseline—though cascading and task-specific routing (like RAG) show substantial promise.

What Problem Does This Paper Address?

Different LLMs excel at different tasks: proprietary models like GPT-4 achieve top-tier accuracy at high API costs, while smaller open-source models like Mistral-7B are orders of magnitude cheaper but less reliable. Model routing—automatically directing a prompt to the most cost-effective model that can handle it—offers a way to maximize output quality under a budget.

However, developing and evaluating LLM routers is challenging:

  1. Running live LLM inference to test every new routing algorithm is prohibitively expensive and slow.
  2. Comparing routers is messy because they produce varying trade-offs between cost and accuracy rather than a single metric.

Methods

The authors introduce both an offline evaluation platform and a mathematical formulation for measuring router efficiency:

  • Evaluation via Non-Decreasing Convex Hulls (NDCH): A router can be tuned with parameters (such as willingness to pay) to produce various cost-performance points on a 2D plane. By taking the non-decreasing convex hull of these points, the system represents the Pareto-optimal frontier of the router.
  • Average Improvement in Quality (AIQ): To quantify overall routing efficiency in a single scalar, AIQ computes the normalized area under the router's NDCH curve across a defined cost domain $[c_{\min}, c_{\max}]$: $$\text{AIQ}(R_\theta) = \frac{1}{c_{\max} - c_{\min}} \int_{c_{\min}}^{c_{\max}} R_\theta^f \, dc$$
  • The "Zero Router" Baseline ($R_{\text{zero}}$): A mathematical baseline that randomly mixes the candidate LLMs along their collective convex hull without looking at prompt contents. Any smart router must beat $R_{\text{zero}}$ to demonstrate genuine routing capability.
  • Evaluated Router Architectures:
  • Predictive Routers: Predict each model’s quality on an unseen input $x_i$ using supervised regressors—either $k$-Nearest Neighbors (KNN) or Multi-Layer Perceptrons (MLP)—and select the model maximizing $\lambda \cdot \text{Predicted Quality} - \text{Cost}$, where $\lambda$ is a user-defined willingness to pay (WTP).
  • Cascading Routers (Non-Predictive): Query models sequentially from cheapest to most expensive, accepting an output if a scoring function (judge) exceeds a threshold, with simulated judge error rates $\epsilon \in [0, 0.4]$.

Datasets

The authors compiled MARS, a dataset of 405,467 inference samples spanning 11 LLMs and 8 datasets covering 64 tasks:

  • Reasoning & Understanding: MMLU (knowledge), HellaSwag, Winogrande, and ARC Challenge (commonsense reasoning).
  • Math & Code: GSM8K (multi-step math word problems) and MBPP (Python code generation).
  • Multi-turn Dialogue: MT-Bench.
  • Retrieval-Augmented Generation (RAG): 4,000 newly generated questions from recent (2020, 2023) and specific news sources evaluated against web-connected systems (You.com API, Perplexity-7B, Perplexity-70B).
  • Candidate LLMs Evaluated: Proprietary models (GPT-4-turbo, GPT-3.5-turbo, Claude-v1, Claude-v2, Claude-instant-v1) and open-source models (Llama-2-70B-chat, Mixtral-8x7B-chat, Yi-Chat-34B, Mistral-7B-chat, Code Llama 34B, WizardLM 13B).

Because all LLM completions and evaluations are pre-recorded in MARS, new routers can be trained and evaluated instantaneously without paying for inference APIs.

Key Insights and Ideas

  • Huge Ceiling, Elusive Routing: An "Oracle" router (which routes to the cheapest model that correctly answers the prompt) achieves near-perfect accuracy at low cost, showing costs could routinely decrease by $2\times\text{--}5\times$ for the same performance.
  • Simple Feature-Based Predictive Routers Rarely Beat the Baseline: On general benchmarks (MMLU, GSM8K, MBPP), KNN and MLP routers matched top individual models, but rarely outperformed the naive Zero Router baseline. Predicting exact question difficulty per model remains difficult from text embeddings alone.
  • Judges Dictate Cascade Success: Cascading routers shine if the verification judge is accurate (error rate $\le 0.1$), easily surpassing individual LLMs. However, if judge error rates exceed $0.2$, performance degrades rapidly.
  • Clear Wins in RAG: In specialized settings like retrieval-augmented generation, both predictive (KNN AIQ: 0.770, MLP AIQ: 0.743) and cascading (AIQ: 0.762) routers beat the Zero Router (0.668) and single LLMs by clear margins.

Key Results

  • Pilot Oracle Performance: Highlights that optimal routing achieves $\sim 100\%$ accuracy at a fraction of GPT-4's individual cost.
  • Predictive Routing (Figure 4):
  • MMLU: Zero Router AIQ = 0.763; KNN = 0.773; MLP = 0.769.
  • MBPP: Zero Router AIQ = 0.660; KNN = 0.644; MLP = 0.642.
  • GSM8K: Zero Router AIQ = 0.632; KNN = 0.632; MLP = 0.623.
  • Cascading Routing (Figure 5): With zero error in the judge, cascading achieved an AIQ of 0.901 on MMLU (vs. 0.763 for Zero Router) and 0.862 on MBPP (vs. 0.660 for Zero Router).
  • RAG Routing (Figure 9): KNN (0.770), Cascading with $\epsilon=0.2$ (0.762), and MLP (0.743) all surpassed the baseline Zero Router (0.668).

Limitations and Future Work

  • Metrics Scope: Current evaluations consider only dollar cost and accuracy, leaving out real-world system constraints like generation latency, time-to-first-token, and throughput.
  • Alignment Refusals: Models tuned for high safety (notably Claude 2) occasionally refused ambiguous prompts, lowering overall performance scores due to excessive caution rather than inability.
  • Router Complexity: The tested predictive routers (KNN, MLP) were relatively basic. The authors highlight the need for more expressive meta-models and learned verifiers to narrow the substantial gap between practical routers and the theoretical oracle.

Summary updated

Abstract

As the range of applications for Large Language Models (LLMs) continues to grow, the demand for effective serving solutions becomes increasingly critical. Despite the versatility of LLMs, no single model can optimally address all tasks and applications, particularly when balancing performance with cost. This limitation has led to the development of LLM routing systems, which combine the strengths of various models to overcome the constraints of individual LLMs. Yet, the absence of a standardized benchmark for evaluating the performance of LLM routers hinders progress in this area. To bridge this gap, we present MARS, a novel evaluation framework designed to systematically assess the efficacy of LLM routing systems, along with a comprehensive dataset comprising over 405k inference outcomes from representative LLMs to support the development of routing strategies. We further propose a theoretical framework for LLM routing, and deliver a comparative analysis of various routing approaches through MARS, highlighting their potentials and limitations within our evaluation framework. This work not only formalizes and advances the development of LLM routing systems but also sets a standard for their assessment, paving the way for more accessible and economically viable LLM deployments.
BibTeX
@inproceedings{hu2024mars,
  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 = {{MARS: A Benchmark for Multi-LLM Algorithmic Routing System}},
  booktitle = {AGI @ ICLR},
  year = {2024},
  url = {https://openreview.net/forum?id=C0rs3wM0N8},
}
Figure