SelectLLM: Query-Aware Efficient Selection Algorithm for Large Language Models

Kaushal Kumar Maurya, Kv Aditya Srivatsa, Ekaterina KochmarACL 2025

TL;DR

SELECTLLM is a novel algorithm that intelligently routes input queries to a small, specialized subset of Large Language Models (LLMs) instead of querying an entire ensemble. By using a lightweight classifier to predict which models are best suited for a specific task, it achieves superior accuracy while slashing inference latency by up to 70% compared to traditional ensemble methods.

The Challenge of LLM Ensembling

While Large Language Models (LLMs) are powerful, no single model is a "silver bullet." Different models possess unique strengths and biases based on their size, training data, and architecture. To maximize performance, researchers often employ ensembles—querying multiple models and aggregating their answers (e.g., via majority voting).

However, traditional ensembling is a "brute force" approach. Querying a pool of 10 models for every single request is computationally expensive, slow, and often redundant. Many queries could be solved by just one or two specialized models. The core challenge addressed by this research is: How can we benefit from the diversity of an LLM pool without paying the massive "latency tax" of running them all?

Methods: The SELECTLLM Framework

The authors introduce SELECTLLM, a query-aware selection framework that acts as an intelligent manager for a team of LLMs. The system consists of two primary components:

  1. Multi-label Classifier (MLC): A lightweight model (such as RoBERTa) fine-tuned on a custom dataset called SLDATA. This classifier analyzes incoming queries to predict which LLMs in the pool are most likely to provide a correct answer. Because this classifier is significantly smaller than the LLMs it manages, it adds negligible overhead.
  2. Selection Policies: Based on the classifier's confidence scores, SELECTLLM employs a policy to select the final subset of models. The most effective policy, WeightedMaxConf, selects the top-$s$ models and weights their votes according to the classifier's confidence. This prevents high-performing but overconfident models from dominating specialized experts.
The SelectLLM workflow: from data collection and fine-tuning to query-aware inference.

The operational workflow is streamlined: an incoming query is processed by the lightweight classifier, which selects the best 2-4 models. Only these models are queried, and their answers are aggregated for the final output.

Datasets and Evaluation

SELECTLLM was evaluated on two rigorous benchmarks:

  • GSM8K: 8,792 grade-school math word problems requiring multi-step reasoning.
  • MMLU (Massive Multitask Language Understanding): 14,572 multiple-choice questions across 57 subjects in STEM, humanities, and more.

The model pool comprised seven diverse open-source LLMs, including variants of Llama-2, Mistral, Gemma, and MetaMath.

Key Insights

  • Diminishing Returns of Scale: Simply adding more models to an ensemble does not guarantee better results. Performance often plateaus or drops after a certain point, suggesting that a smaller, curated team is more effective than an unmanaged crowd.
  • Linguistic Specialization: Using SHAP (Shapley Additive Explanations), the authors found that models have distinct "blind spots." For instance, while many models struggle with frequency terms like "twice," specialized models like MetaMath are more resilient. SELECTLLM learns these nuances to route queries effectively.
  • Complexity Matching: The system identifies "easy" queries and routes them to single, fast models, reserving computationally expensive "heavy hitters" for complex reasoning tasks.

Experimental Results

SELECTLLM demonstrates that intelligent routing can provide both higher accuracy and lower costs.

Performance comparison of SELECTLLM against Oracle and baseline methods on GSM8K and MMLU.
  • Accuracy Gains: SELECTLLM outperformed strong baselines like LLM-Blender, improving accuracy by 1.90 points on GSM8K and 4.89 points on MMLU.
  • Significant Latency Reduction: Compared to the top-performing ensemble baseline (Top-s LLMs), SELECTLLM reduced inference latency by 13% on GSM8K and a staggering 70% on MMLU.
  • Efficiency: By selecting only a subset (e.g., $s=2$ for MMLU), the system achieved better results than using all 7 models in the pool simultaneously.

Limitations and Future Work

Currently, the system is optimized for tasks with discrete outputs (e.g., math or multiple-choice). Future work will explore extending this to open-ended creative writing where "correctness" is harder to quantify. Additionally, the authors aim to close the gap with the theoretical "Oracle" baseline by expanding the diversity of the training data (SLDATA) and improving the classifier's ability to handle entirely new subjects.

Summary updated

BibTeX
@inproceedings{maurya2025selectllm,
  author = {Kaushal Kumar Maurya and KV Aditya Srivatsa and Ekaterina Kochmar},
  title = {{SelectLLM: Query-Aware Efficient Selection Algorithm for Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure