用强化学习动态选大模型,省钱又准
LLM Bandit: Cost-Efficient LLM Generation via Preference-Conditioned Dynamic Routing
- 把选模型当成多臂赌博机问题,实时智能分配最合适模型
- 在多个平台测试中,准确率提升且成本显著降低
- 支持用户自定义偏好,新模型也能自动适配
大语言模型(LLMs)发展迅速,各类模型能力各异,但为用户查询选择最优模型常面临准确率与成本之间的权衡,尤其当查询需求多样时更为突出。本文提出一种新框架,将模型选择建模为多臂赌博机问题,实现查询到最适配模型的动态智能路由。该方法引入偏好条件下的动态路由机制,允许用户在推理时指定偏好,从而灵活平衡性能与成本。此外,选择策略可泛化至未见过的LLM,确保对新模型的适应性。实验表明,该方法在多个LLM平台均实现准确率与成本效益的显著提升,展现出在真实场景中自适应优化模型选择的潜力。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。