用神经上下文博弈算法,智能挑选多步骤任务中的最优LLM组合。
Neural Bandit Based Optimal LLM Selection for a Pipeline of Subtasks
- 基于神经上下文博弈,动态选择每一步的最优LLM。
- 在真实数据集上比现有方法成功率更高,且成本更低。
- 适合构建复杂AI代理任务的开发者使用。
随着大语言模型(LLMs)日益普及,如何在一组模型中预测哪个能在低成本下成功回答给定查询,成为关键问题。尤其当LLM代理需完成多样化“智能体”任务时,这些任务常被分解为多个子任务,每个子任务由一个擅长该任务的LLM执行。例如,从病历中提取诊断,可先选一个模型总结病历,再选另一个验证摘要,最后选第三个模型从摘要中提取诊断。与传统的单模型选择不同,此场景需连续选择多个模型,前一模型输出直接影响后一模型输入,导致性能依赖关系复杂。本文提出一种基于神经上下文博弈的序列选择算法(Sequential Bandits),无需历史性能数据即可训练神经网络指导各子任务的模型选择。理论上证明该算法在任务数上具有次线性遗憾,实验验证其在两个真实数据集上的表现优于其他主流选择算法。
原文摘要 · Abstract (English)
As large language models (LLMs) become increasingly popular, there is a growing need to predict which out of a set of LLMs will yield a successful answer to a given query at low cost. This problem promises to become even more relevant as LLM agents are asked to solve an increasing variety of "agentic'' AI tasks. Such tasks are often broken into smaller subtasks, each of which can then be executed by a LLM expected to perform well on that specific subtask. For example, to extract a diagnosis from medical records, one can first select an LLM to summarize the record, select another to validate the summary, and then select a possibly different LLM to extract the diagnosis from the summarized record. Unlike existing LLM selection or routing algorithms, this setting requires selecting a sequence of LLMs, with the output of each LLM feeding into the next and potentially influencing its success. Thus, unlike single LLM selection, the quality of each subtask's output directly affects the inputs, and hence the cost and success rate, of downstream LLMs, creating complex performance dependencies that must be learned during selection. We propose a neural contextual bandit-based algorithm that trains neural networks to guide LLM selections for the different subtasks, without requiring historical LLM performance data. We prove that our proposed Sequential Bandits algorithm achieves a sublinear regret in the number of tasks, and we experimentally validate its superior performance compared to other LLM selection algorithms on two real datasets.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。