Saved in:
Bibliographic Details
Main Author: Li, Yang
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2502.02743
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910814738317312
author Li, Yang
author_facet Li, Yang
contents The rapid advancement in large language models (LLMs) has brought forth a diverse range of models with varying capabilities that excel in different tasks and domains. However, selecting the optimal LLM for user queries often involves a challenging trade-off between accuracy and cost, a problem exacerbated by the diverse demands of individual queries. In this work, we present a novel framework that formulates the LLM selection process as a multi-armed bandit problem, enabling dynamic and intelligent routing of queries to the most appropriate model. Our approach incorporates a preference-conditioned dynamic routing mechanism, allowing users to specify their preferences at inference time, thereby offering a customizable balance between performance and cost. Additionally, our selection policy is designed to generalize to unseen LLMs, ensuring adaptability to new models as they emerge. Experimental results demonstrate that our method achieves significant improvements in both accuracy and cost-effectiveness across various LLM platforms, showcasing the potential of our framework to adaptively optimize LLM selection in real-world scenarios.
format Preprint
id arxiv_https___arxiv_org_abs_2502_02743
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LLM Bandit: Cost-Efficient LLM Generation via Preference-Conditioned Dynamic Routing
Li, Yang
Machine Learning
The rapid advancement in large language models (LLMs) has brought forth a diverse range of models with varying capabilities that excel in different tasks and domains. However, selecting the optimal LLM for user queries often involves a challenging trade-off between accuracy and cost, a problem exacerbated by the diverse demands of individual queries. In this work, we present a novel framework that formulates the LLM selection process as a multi-armed bandit problem, enabling dynamic and intelligent routing of queries to the most appropriate model. Our approach incorporates a preference-conditioned dynamic routing mechanism, allowing users to specify their preferences at inference time, thereby offering a customizable balance between performance and cost. Additionally, our selection policy is designed to generalize to unseen LLMs, ensuring adaptability to new models as they emerge. Experimental results demonstrate that our method achieves significant improvements in both accuracy and cost-effectiveness across various LLM platforms, showcasing the potential of our framework to adaptively optimize LLM selection in real-world scenarios.
title LLM Bandit: Cost-Efficient LLM Generation via Preference-Conditioned Dynamic Routing
topic Machine Learning
url https://arxiv.org/abs/2502.02743