面向提示自适应成本感知LLM推理的集成路由
研究论文 · 2026/11/12
大型语言模型(LLM)日益支持需在异构请求间平衡响应质量与推理成本的Web服务。传统路由为每个提示选择一个模型,而固定集成无法根据个体请求调整其组成和成本。我们提出PISA,一种提示自适应、成本感知的单模型路由器,及其集成路由扩展PISA-E。两种方法的核心是PISA结合软聚类成员资格与模型特定预测器来估计单个模型能力。基于这些估计,PISA-E在显式的成本-质量偏好下联合选择集成组成和基数,该偏好可在推理时调整而无需重新训练。一个可处理的集成成功替代指标和高效候选选择使此扩展无需集成特定训练。在分布内(ID)和分布外(OOD)条件下的四个LLM路由基准上,PISA在两种设置下均在被评估的单模型路由器中实现了最高的宏平均成本-性能超体积。同时,PISA-E在优先考虑响应质量时,在被评估的集成方法中实现了最高的宏平均任务性能,在ID和OOD条件下分别超过最强竞争对手2.09和2.87个百分点。在选定的较低成本操作点,它还超过了最强集成竞争对手的宏平均任务性能,同时平均推理成本分别降低约36%和25%。这些结果证明了提示自适应能力估计在单模型路由和选择性集成中的有效性。
该研究提出了一种提示自适应且成本感知的路由方法,能够根据请求动态调整模型选择或集成组成,在保证响应质量的同时显著降低推理成本。实验证明其在多个基准上优于现有方法,对于构建高效、经济的LLM服务具有重要实践意义。
Large language models (LLMs) increasingly support Web-based services that must balance response quality and inference cost across heterogeneous requests. Conventional routing selects one model per prompt, while fixed ensembles cannot adapt their composition and cost to individual requests. We introduce PISA, a prompt-adaptive, cost-aware single-model router, and PISA-E, its extension to ensemble routing. At the core of both methods, PISA combines soft cluster memberships with model-specific predictors to estimate individual model capabilities. Building on these estimates, PISA-E jointly selects ensemble composition and cardinality under an explicit cost--quality preference that can be adjusted at inference time without retraining. A tractable ensemble-success surrogate and efficient candidate selection enable this extension without ensemble-specific training. Across four LLM routing benchmarks under in-distribution (ID) and out-of-distribution (OOD) conditions, PISA achieves the highest macro-average cost--performance hypervolume among the evaluated single-model routers in both settings. Meanwhile, PISA-E achieves the highest macro-average task performance among the evaluated ensemble approaches when prioritizing response quality, surpassing the strongest competitors by 2.09 and 2.87 percentage points under ID and OOD conditions, respectively. At selected lower-cost operating points, it also exceeds the strongest ensemble competitors' macro-average task performance while reducing average inference cost by approximately 36% and 25%, respectively. These results demonstrate the effectiveness of prompt-adaptive capability estimation for both single-model routing and selective ensembling.