在预算限制下动态选择最优大模型,提升效率与成本控制。
Adaptive LLM Routing under Budget Constraints
- 将模型路由建模为上下文动作问题,利用反馈在线优化选择策略。
- 通过共享嵌入空间对齐查询与模型,实现高效匹配与自适应调整。
- 支持多预算场景,结合背包问题设计资源感知的路由机制。
大语言模型(LLMs)虽推动了自然语言处理的发展,但其能力与成本差异带来实际应用挑战。传统路由方法依赖完整最优配对数据,难以应对真实场景中动态变化的用户需求。本文将模型路由视为上下文动作问题,通过在线反馈进行自适应决策,避免对所有查询-模型组合进行全量推理。为此,我们构建查询与模型的共享嵌入空间,基于离线人类偏好数据初始化,并通过在线带状反馈持续优化。提出名为PILOT的新方法,扩展自LinUCB,支持动态选择。针对多样化用户预算,引入多选背包模型设计在线成本策略,实现资源高效的路由决策。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have revolutionized natural language processing, but their varying capabilities and costs pose challenges in practical applications. LLM routing addresses this by dynamically selecting the most suitable LLM for each query/task. Previous approaches treat this as a supervised learning problem, assuming complete knowledge of optimal query-LLM pairings. However, real-world scenarios lack such comprehensive mappings and face evolving user queries. We thus propose to study LLM routing as a contextual bandit problem, enabling adaptive decision-making using bandit feedback without requiring exhaustive inference across all LLMs for all queries (in contrast to supervised routing). To address this problem, we develop a shared embedding space for queries and LLMs, where query and LLM embeddings are aligned to reflect their affinity. This space is initially learned from offline human preference data and refined through online bandit feedback. We instantiate this idea through Preference-prior Informed Linucb fOr adaptive rouTing (PILOT), a novel extension of LinUCB. To handle diverse user budgets for model routing, we introduce an online cost policy modeled as a multi-choice knapsack problem, ensuring resource-efficient routing.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。