arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.28268cs.DB
收藏

面向成本效益的批量提示大语言模型路由

Towards Cost-effective LLMs Routing with Batch Prompting

Beijing Institute of Technology(北京理工大学);The Chinese University of Hong Kong(香港中文大学)

Haotian Xu, Kangfei Zhao, Jiadong Xie

AI总结:

提出RoBatch框架,联合优化模型分配和查询聚合两个维度,在成本预算下实现更优的成本-性能帕累托前沿。

摘要:

大语言模型(LLM)服务系统必须在任务性能与货币成本之间取得平衡。两种突出的优化技术已独立出现:LLM路由(将每个查询导向模型池中最具成本效益的模型)和批量提示(将多个查询打包到一次调用中以分摊共享系统提示的固定成本)。这两种技术在逻辑上是互补的;即,路由优化模型分配维度,而批处理优化查询聚合维度,共同重塑模型效用和货币成本的格局。然而,现有方法仅探索了这一决策空间的一个方面。基于对其影响的实证研究,本文旨在联合优化这两个维度。我们定义了带批处理的路由问题,该问题在总成本预算下为每个查询联合确定目标模型和批量大小,并证明其为NP难问题。为解决这一挑战性问题,我们提出了RoBatch,一个统一的两阶段框架。在建模阶段,RoBatch构建了一个批量感知的代理效用模型,将组合效用估计分解为无批处理的效用估计和通过批处理重新校准特定模型的效用退化。在路由阶段,RoBatch采用一种贪心调度算法,沿着成本-效用帕累托前沿逐步升级查询的目标模型和批量大小分配,直到预算耗尽。在两个LLM系列(Qwen3和Gemma3)的六个基准测试上的大量实验表明,与LLM路由和批量提示基线相比,RoBatch始终实现了更优的成本-性能帕累托前沿。

英文摘要:

Large Language Model (LLM) serving systems must balance task performance against monetary cost. Two prominent optimization techniques have emerged independently: LLM routing, which directs each query to the most cost-effective model in a model pool, and batch prompting, which packs multiple queries into a single invocation to amortize the fixed cost of the shared system prompt. These two techniques are logically complementary; i.e., routing optimizes the model assignment dimension while batching optimizes the query aggregation dimension, jointly reshaping the landscape of model utility and monetary cost. However, existing approaches explore only one side of this decision space. On the basis of empirical studies on their impacts, we are motivated to jointly optimize these two dimensions in this paper. We formulate the Route with Batching Problem, which jointly determines the target model and batch size for each query under a total cost budget, and prove it NP-hard. To solve this challenging problem, we propose RoBatch, a unified two-stage framework. In the modeling stage, RoBatch constructs a batch-aware proxy utility model that decomposes combinatorial utility estimation into utility estimation without batching and recalibration of model-specific utility degradation with batching. In the routing stage, RoBatch employs a greedy scheduling algorithm that progressively upgrades the assignment of the target model and batch size for queries along the cost-utility Pareto frontier until the budget is exhausted. Extensive experiments on six benchmarks across two LLM families (Qwen3 and Gemma3) demonstrate that RoBatch consistently achieves a superior cost-performance Pareto frontier compared with LLM routing and batch prompting baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑