SeLMRoute:面向大语言模型路由的概率语义证据

·

研究论文 · 2026/10/02

大语言模型(LLM)路由旨在为每个查询选择最合适的模型。现有路由器大多直接从查询嵌入、模型表示、偏好数据或相似示例聚类中学习决策,但用于路由的表示很少说明查询实际需要什么。我们提出 SeLMRoute,一个将候选无关语义证据的提取与候选性能学习及部署目标应用分离的路由框架。决策模型首先评估一组关于查询的可解释问题(如推理需求和外部知识使用),每个判断保留为概率分布。由此产生的概率语义状态被轻量级监督路由器用于估计候选模型性能。路由目标在性能估计之后应用,使同一语义状态能支持面向性能和成本感知的决策。在 LLMRouterBench(15 个数据集、20 个候选模型、11,481 个查询)上,SeLMRoute 平均准确率为 72.08% ± 0.45,分组五折折外评估达到 72.64%,而最强固定候选为 69.23%。该表示在评估的语义、稠密、词汇和领域级表示中取得最高平均性能。在另一个 13 模型性能-成本设置中,SeLMRoute 在所有五个分组划分中提升性能,平均 PerfGain 为 2.66%。代码见 https://github.com/Indigma-Innovations/SeLMRoute。

该工作提出了一种可解释且与候选模型无关的语义证据表示,将路由决策与部署目标解耦,在标准基准和成本感知场景中均取得稳定提升,为 LLM 路由提供了新思路和可复现的开源实现。

Large language model (LLM) routing aims to select the most suitable model for each incoming query. Most existing routers learn this decision directly from query embeddings, model representations, preference data, or clusters of similar examples. Such approaches can be effective, yet the representation used for routing rarely states what a query actually requires. We introduce SeLMRoute, a routing framework that separates the extraction of candidate-independent semantic evidence from the learning of candidate performance and the application of deployment objectives. A decision model first evaluates a set of interpretable questions about the query, such as its reasoning requirements and use of external knowledge, with each judgment retained as a probability distribution. The resulting probabilistic semantic state is used by a lightweight supervised router to estimate candidate model performance. Routing objectives are applied after performance estimation, which allows the same semantic state to support performance-oriented and cost-aware decisions. On the LLMRouterBench (15 datasets, 20 candidate models, 11,481 queries), SeLMRoute achieves an average accuracy of 72.08% pm 0.45, while grouped five-fold out-of-fold evaluation reaches 72.64%, compared with 69.23% for the strongest fixed candidate. The representation achieves the highest mean performance among the evaluated semantic, dense, lexical, and domain-level representations. In a separate 13-model performance-cost setting, SeLMRoute improves performance in all five grouped splits, with a mean PerfGain of 2.66%. Our code is available at https://github.com/Indigma-Innovations/SeLMRoute.

阅读原文

参与讨论