Large Language Model Routing with Benchmark Datasets

TL;DR

Proposes a benchmark-based model routing framework using binary classifiers to improve large language model selection, achieving significant performance gains across 29 datasets.

cs.CL 🔴 Advanced 2023-09-28 192 citations 39 views
Tal Shnitzer Anthony Ou Mírian Silva Kate Soule Yuekai Sun Justin Solomon Neil Thompson Mikhail Yurochkin
Large Language Models Model Selection Benchmark Datasets Binary Classification Meta-Learning

Key Findings

Methodology

This work formalizes the problem of selecting the best LLM for a new task as a collection of binary classification tasks, where each classifier predicts whether a candidate model will perform well on a given input. Using existing benchmark datasets, the authors extract per-sample performance metrics (such as correctness or scores) and embed input samples into a feature space via sentence transformers. Each model m is associated with a correctness predictor g_m, trained to estimate P(y(x,m)=1|x) using a simple kNN classifier. The correctness prediction is then used to design three scoring mechanisms (S1, S2, S3), with S3 incorporating Bayesian modeling of out-of-distribution (OOD) uncertainty through task descriptors u(d). During inference, the system predicts the likelihood of correctness for each model on new inputs, combining these with task-level estimates to select the optimal model, thus enabling efficient and robust model routing.

Key Results

  • On 29 HELM datasets, the S3 score achieved an average accuracy of 0.694, surpassing the mean performance of the best single model (llama-2-70b at 0.688), while selecting smaller models (average parameters 33.8B), demonstrating improved performance-cost trade-offs. Incorporating the true correctness probability (oracle) further increased accuracy to 0.735, validating the potential of correctness predictors. In the MixInstruct benchmark, the S1 score achieved 73% average per-instance accuracy, outperforming traditional log-likelihood scoring, and significantly reducing inference costs from 347B parameters to a few billion calls, confirming the method’s efficiency.
  • The experimental results highlight that leveraging benchmark data to learn model routing not only improves overall task performance but also enables cost-effective model deployment. The approach effectively balances accuracy and resource consumption, especially when combined with small amounts of in-distribution samples to enhance OOD generalization. These findings suggest that intelligent model selection based on learned correctness estimators can be a practical solution for real-world multi-task AI systems.

Significance

This research addresses a critical bottleneck in deploying large-scale language models across diverse tasks by providing a systematic, data-driven approach to model selection. Unlike traditional methods that rely on generating outputs from all candidate models, this framework leverages existing benchmark evaluations to train lightweight correctness predictors, enabling rapid and cost-efficient model routing. The integration of Bayesian modeling and task descriptors enhances robustness against distribution shifts, paving the way for more adaptive and scalable AI systems. Such advancements are vital for industrial applications like personalized assistants, automated customer support, and multi-task AI platforms, where efficiency and accuracy are paramount. Moreover, the theoretical insights connecting the approach to meta-learning deepen our understanding of model generalization and transferability, offering avenues for further research.

Technical Contribution

The paper introduces a novel formalization of the model selection problem as multiple binary classification tasks, where each predictor estimates the correctness probability of a candidate model on input samples. It proposes three scoring mechanisms—S1 (predictor probability), S2 (thresholded predictor), and S3 (Bayesian correction)—to robustly evaluate models under distributional shifts. The methodology combines sentence-transformer embeddings, kNN classifiers, and non-parametric regression for p(d′, m), enabling efficient inference. The work establishes a theoretical connection to meta-learning, demonstrating that adaptive shrinkage of the router improves approximation to the oracle model. Empirically, the approach achieves state-of-the-art routing performance with minimal computational overhead, outperforming baselines such as log-likelihood scoring and average model performance.

Novelty

This is the first work to formalize multi-model selection as a collection of binary classification problems trained on benchmark-derived sample performance data. Unlike prior approaches relying on output generation or ensemble agreement, this method leverages pre-existing evaluation metrics, significantly reducing inference costs. The introduction of a Bayesian correction mechanism (S3) that models OOD uncertainty based on task descriptors is a key innovation, providing robustness against distribution shifts. The approach’s simplicity—using sentence embeddings and kNN classifiers—demonstrates that even basic models can achieve competitive performance, opening new avenues for scalable, data-driven model routing in large-scale AI systems.

Limitations

  • The correctness predictors achieve an average accuracy of around 59%, which may be insufficient for highly diverse or out-of-distribution tasks, limiting the robustness of the routing system.
  • The reliance on simple embedding methods and kNN classifiers may not capture complex task-model interactions, especially in high-dimensional feature spaces, potentially restricting scalability.
  • The approach assumes availability of benchmark data with per-sample performance metrics, which may not always be accessible or representative of real-world deployment scenarios, especially for emerging tasks or domains.

Future Work

Future research will focus on improving correctness prediction accuracy by integrating deep neural network classifiers and richer feature representations. Exploring active learning strategies to select informative samples for training correctness predictors can enhance OOD robustness. Extending the framework to multi-modal data, such as vision-language tasks, will broaden its applicability. Additionally, developing adaptive, online learning mechanisms for continual model routing in dynamic environments remains an open challenge. Theoretical work on formal guarantees and bounds for OOD generalization will further strengthen the foundation of this approach, facilitating deployment in large-scale industrial systems.

AI Executive Summary

The rapid proliferation of large language models (LLMs) has revolutionized natural language processing, enabling unprecedented capabilities across a multitude of tasks. From question answering and summarization to dialogue systems, these models have demonstrated remarkable versatility. However, the sheer number of available models, each with different strengths and weaknesses, poses a significant challenge for practical deployment. Traditional model selection methods—such as evaluating average performance across benchmarks—are insufficient for real-world applications where efficiency, cost, and task-specific performance matter more.

This paper introduces a novel approach to model routing, leveraging existing benchmark datasets to train lightweight correctness predictors. Instead of generating outputs from all candidate models, the system predicts the likelihood that each model will perform well on a new input, based on features extracted from sample embeddings. These correctness predictors are trained as binary classifiers (e.g., kNN) on per-sample performance data, enabling rapid, cost-effective model selection.

The core innovation lies in the design of three scoring mechanisms: S1, which directly uses the predictor’s probability estimates; S2, which thresholds these probabilities for binary decision-making; and S3, which incorporates Bayesian modeling of OOD uncertainty through task descriptors. By estimating the probability that a model will be correct on unseen tasks, the framework achieves robust performance even under distribution shifts.

Extensive experiments on 29 datasets from the HELM benchmark and instruction-following tasks from MixInstruct demonstrate the effectiveness of this approach. Results show that the S3 score surpasses traditional baselines, achieving an average accuracy of 69.4% in model selection, outperforming the mean model performance (68.8%) and approaching the oracle upper bound (73.5%). Moreover, the method reduces inference costs significantly by enabling the use of smaller models where appropriate, without sacrificing overall performance.

The significance of this work extends beyond mere performance gains. It provides a scalable, data-driven solution for model deployment in multi-task environments, addressing key industry needs for efficiency, robustness, and adaptability. By formalizing the problem as a collection of binary classification tasks and connecting it to meta-learning principles, the authors lay a solid theoretical foundation for future advancements.

Looking ahead, future research will aim to enhance correctness prediction accuracy, incorporate richer features and deep models, and extend the framework to multi-modal data. The integration of active learning strategies and online adaptation mechanisms promises to further improve robustness and scalability. Overall, this work marks a substantial step toward intelligent, resource-efficient AI systems capable of dynamically selecting optimal models for diverse real-world tasks.

Deep Analysis

Background

The evolution of NLP has been driven by the development of large-scale pre-trained models such as BERT, GPT, and LLaMA, which have demonstrated remarkable capabilities across diverse tasks. Early benchmarks like UCI and ImageNet focused on single-task performance, but the advent of foundation models shifted evaluation towards multi-task benchmarks such as HELM, MMLU, and Open LLM Leaderboard. These benchmarks aggregate performance across multiple datasets, providing a comprehensive view of model capabilities. Despite these advances, the evaluation primarily relies on average scores, which do not reflect the nuanced needs of real-world applications, where task-specific model selection is critical. Researchers have explored transfer learning, few-shot learning, and model ensemble techniques to improve performance, but the challenge remains in efficiently selecting the best model for a new, unseen task, especially when deploying large models incurs high computational costs. Existing methods like model ensembling, output ranking, and confidence-based selection have limitations in scalability and robustness, particularly under distribution shifts. Consequently, there is a pressing need for methods that can leverage benchmark data to predict model performance on new tasks, enabling smarter, resource-efficient deployment.

Core Problem

The core problem addressed in this work is how to efficiently and accurately select the most suitable large language model for a new task in a multi-model environment. Traditional approaches involve generating outputs from all candidate models and then selecting the best based on evaluation metrics, which is computationally prohibitive at scale. Moreover, models often encounter distributional shifts when applied to new tasks, leading to unpredictable performance. The challenge is to develop a method that can predict model performance without exhaustive inference, using only lightweight features derived from benchmark data. This requires overcoming difficulties such as limited labeled data for new tasks, the heterogeneity of task domains, and the need for robustness against out-of-distribution data. Addressing these issues is crucial for deploying AI systems that are both cost-effective and adaptable to dynamic environments.

Innovation

The main innovation of this paper is the formulation of multi-model selection as a set of binary classification problems trained on benchmark-derived data. Instead of generating model outputs for each input, the authors train correctness predictors (g_m) using sample features and performance labels, enabling rapid prediction of model correctness probabilities. The introduction of three scoring mechanisms—S1, S2, and S3—allows for flexible, robust model ranking, with S3 explicitly modeling OOD uncertainty via Bayesian inference and task descriptors. This approach bridges the gap between traditional evaluation metrics and real-time model selection, reducing inference costs and improving robustness. The work also establishes a theoretical connection to meta-learning, demonstrating that adaptive routing strategies can outperform static baselines, especially in the presence of distribution shifts. The simplicity of using sentence embeddings and kNN classifiers underscores the practicality and scalability of the approach.

Methodology

  • �� Data collection: Extract per-sample performance metrics (correctness, scores) from benchmark datasets (HELM, MixInstruct) for multiple models.
  • �� Feature extraction: Use sentence-transformer embeddings to convert input samples into fixed-length feature vectors.
  • �� Correctness predictor training: For each model m, train a binary classifier g_m (kNN with k=5) to predict whether the model will perform well on a sample, using the extracted features.
  • �� Score design: Develop three scoring functions—S1 (predictor probability), S2 (thresholded correctness), S3 (Bayesian correction incorporating task descriptors)—to evaluate models during inference.
  • �� Task modeling: Represent each task d by a descriptor u(d), measuring its distance to other tasks; fit a non-parametric regression model (Gaussian kernel smoothing) to estimate p(d′, m), the probability of correctness on new tasks.
  • �� Model routing: For a new task d′, compute sample features, estimate p(d′, m), and calculate scores S1, S2, S3; select the model with the highest score, balancing performance and cost.

Experiments

  • �� Dataset: 29 diverse datasets from HELM and MixInstruct, covering question answering, text classification, reasoning, and instruction-following scenarios.
  • �� Models: 18 open-source models, including Llama 2 variants (3B to 70B parameters), evaluated across multiple tasks.
  • �� Evaluation metrics: Accuracy, Pearson, and Spearman correlations for model performance; inference cost measured by parameter count and number of model calls.
  • �� Training details: Correctness predictors trained as kNN classifiers on sentence embeddings; hyperparameters set to k=5; training data derived from benchmark samples.
  • �� Baselines: Mean model performance (BMA), log-likelihood scoring, and oracle scores based on true correctness probabilities.
  • �� Procedure: For each experiment, 28 datasets serve as training benchmarks, with the remaining dataset as the test task; repeated multiple times for statistical robustness.

Results

  • �� The S3 scoring mechanism achieved an average accuracy of 69.4%, outperforming the mean model (68.8%) and closely approaching the oracle upper bound (73.5%) across 29 datasets.
  • �� Incorporating the true correctness probability (oracle) boosted accuracy to 73.5%, confirming the importance of accurate correctness estimation.
  • �� In instruction-following benchmarks, the S1 score achieved 73% per-instance accuracy, surpassing traditional log-likelihood methods, while significantly reducing inference costs from 347B parameters to a few billion calls.
  • �� The results demonstrate that leveraging benchmark data to train correctness predictors enables effective, resource-efficient model selection, adaptable to diverse tasks and distribution shifts.

Applications

  • �� Multi-task AI deployment: Enables dynamic, cost-effective selection of models in real-time systems such as chatbots, virtual assistants, and customer support platforms.
  • �� Cloud-based AI services: Facilitates automated model scheduling, reducing computational costs and improving response quality.
  • �� Research and development: Provides a scalable framework for evaluating and deploying new models across multiple domains, accelerating innovation.
  • �� Future integration with active learning and multi-modal data can further enhance robustness and applicability in complex real-world scenarios.

Limitations & Outlook

  • �� The correctness predictors achieve moderate accuracy (~59%), which may limit effectiveness in highly diverse or novel tasks, especially under severe distribution shifts.
  • �� The reliance on simple embeddings and kNN classifiers may not scale well with increasing feature complexity or high-dimensional data.
  • �� Dependence on benchmark data with detailed per-sample performance metrics restricts applicability in scenarios lacking such annotations, particularly for emerging tasks or domains.

Plain Language Accessible to non-experts

Imagine you’re managing a big library with hundreds of different books (models). Each book is good at telling certain kinds of stories (tasks). When someone asks for a story about science, you want to quickly pick the best book without reading all of them. Traditionally, you might try each book and see which one gives the best story, but that takes a lot of time and effort. Instead, you decide to learn from past experiences—by remembering which books did well on similar stories before. You create a simple system that looks at the question and predicts which book is most likely to give a good answer, based on what it learned from previous stories. This way, when a new question comes in, your system quickly points to the best book, saving time and energy. Over time, this system gets better at choosing the right book, even for questions it has never seen before, making your library much more efficient and smarter. That’s what this paper does—teaching a smart assistant to pick the best model for each new task, based on past performance data, so it can work faster and better.

ELI14 Explained like you're 14

Imagine you’re in a school cafeteria with lots of different food stations (models). Each station specializes in certain dishes—pizza, salads, sandwiches, etc. When you’re hungry for something new, you could try all the stations and see which one tastes best, but that’s slow and wastes food. Instead, you have a clever friend (the router) who remembers what each station is good at from previous days. When you tell your friend what you’re craving today, they quickly recommend the station that’s most likely to satisfy you. Your friend isn’t guessing randomly—they’ve learned from past meals which stations did well with similar cravings. Sometimes, if you’re trying something very new or different (out-of-distribution), your friend considers how confident they are about their recommendation, maybe asking a few questions first. This way, you get your favorite meal faster and with less waste. This paper is about teaching a computer to do the same thing—using past data to learn which model (or station) is best for each new task, saving time and resources while still getting good results.

Abstract

There is a rapidly growing number of open-source Large Language Models (LLMs) and benchmark datasets to compare them. While some models dominate these benchmarks, no single model typically achieves the best accuracy in all tasks and use cases. In this work, we address the challenge of selecting the best LLM out of a collection of models for new tasks. We propose a new formulation for the problem, in which benchmark datasets are repurposed to learn a "router" model for this LLM selection, and we show that this problem can be reduced to a collection of binary classification tasks. We demonstrate the utility and limitations of learning model routers from various benchmark datasets, where we consistently improve performance upon using any single model for all tasks.

cs.CL cs.LG

References (20)

Masked Language Model Scoring

Julian Salazar, Davis Liang, Toan Q. Nguyen et al.

2019 628 citations ⭐ Influential

Measuring Massive Multitask Language Understanding

Dan Hendrycks, Collin Burns, Steven Basart et al.

2020 9427 citations ⭐ Influential View Analysis →

SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization

Yixin Liu, Peng Liu

2021 299 citations ⭐ Influential View Analysis →

SummaReranker: A Multi-Task Mixture-of-Experts Re-ranking Framework for Abstractive Summarization

Mathieu Ravaut, Shafiq R. Joty, Nancy F. Chen

2022 122 citations ⭐ Influential View Analysis →

LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusion

Dongfu Jiang, Xiang Ren, Bill Yuchen Lin

2023 689 citations ⭐ Influential View Analysis →

Holistic Evaluation of Language Models

Percy Liang, Rishi Bommasani, Tony Lee et al.

2023 2008 citations ⭐ Influential

Language Models are Unsupervised Multitask Learners

Alec Radford, Jeff Wu, R. Child et al.

2019 30058 citations

BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

Jacob Devlin, Ming-Wei Chang, Kenton Lee et al.

2019 120504 citations View Analysis →

Active Learning Literature Survey

Burr Settles

2009 6767 citations

GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding

Alex Wang, Amanpreet Singh, Julian Michael et al.

2018 8922 citations View Analysis →

Model Evaluation, Model Selection, and Algorithm Selection in Machine Learning

S. Raschka

2018 1096 citations View Analysis →

BERTScore: Evaluating Text Generation with BERT

Tianyi Zhang, Varsha Kishore, Felix Wu et al.

2019 9526 citations View Analysis →

SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems

Alex Wang, Yada Pruksachatkun, Nikita Nangia et al.

2019 2910 citations View Analysis →

Scaling and Benchmarking Self-Supervised Visual Representation Learning

Priya Goyal, D. Mahajan, A. Gupta et al.

2019 431 citations View Analysis →

Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift

Yaniv Ovadia, Emily Fertig, Jie Jessie Ren et al.

2019 2413 citations View Analysis →

Invariant Risk Minimization

Martín Arjovsky, L. Bottou, Ishaan Gulrajani et al.

2019 2963 citations View Analysis →

Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

Nils Reimers, Iryna Gurevych

2019 20251 citations View Analysis →

Mixtral of Experts

Albert Q. Jiang, Alexandre Sablayrolles, Antoine Roux et al.

2024 2111 citations View Analysis →

BLEURT: Learning Robust Metrics for Text Generation

T. Sellam, Dipanjan Das, Ankur P. Parikh

2020 1995 citations View Analysis →

On Calibration of Modern Neural Networks

Chuan Guo, Geoff Pleiss, Yu Sun et al.

2017 9577 citations View Analysis →

Cited By (20)

LLMRouter: Unified Infrastructure for Developing, Evaluating, and Deploying LLM Routers

2026 ⭐ Influential View Analysis →

Harnessing the Wisdom of LLM Crowds through Complementarity-Driven Iterative Collaboration

2026 ⭐ Influential View Analysis →

Computational Arbitrage in AI Model Markets

RouteNLP: Closed-Loop LLM Routing with Conformal Cascading and Distillation Co-Optimization

2026 1 citations View Analysis →

ReLope: KL-Regularized LoRA Probes for Multimodal LLM Routing

2026 1 citations View Analysis →

Task-Aware LLM Routing with Multi-Level Task-Profile-Guided Data Synthesis for Cold-Start Scenarios

2026 6 citations View Analysis →

MonoRouter: Enforcing Monotonicity in Item Response Theory for LLM Routing

2026

Select-then-Solve: Paradigm Routing as Inference-Time Optimization for LLM Agents

2026 2 citations View Analysis →

Evaluating Small Language Models for Front-Door Routing: A Harmonized Benchmark and Synthetic-Traffic Experiment

RouteProfile: Graph-Based Profiling for Cold-Start LLM Routing

2026 1 citations View Analysis →

EAFAL: An Edge-Based Agentic Framework for Adaptive Selection Between SLMs and LLMs

2026

Learning Agent Routing From Early Experience

2026 2 citations View Analysis →

Switchcraft: AI Model Router for Agentic Tool Calling

2026 3 citations View Analysis →

SOMA: Efficient Multi-turn LLM Serving via Small Language Model

2026 1 citations View Analysis →

Capturing LLM Capabilities via Evidence-Calibrated Query Clustering

When Efficiency Backfires: Cascading LLMs Trigger Cascade Failure under Adversarial Attack

FlyRoute: Self-Evolving Agent Profiling via Data Flywheel for Adaptive Task Routing

RouterHGC: Optimized Router for LLM-based Multi-Agent Systems via Heterogeneous Graph Contrastive Learning

2026

Beyond Query Memorization: Large Language Model Routing with Query Decomposition and Historical Matching

Codifying the Judge: Scalable Evaluation via Program Distillation