K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

METAL MEDIA

LLMRouter: Unified Infrastructure for Developing, Evaluating, and Deploying LLM Routers

arXiv:2608.068672026-08-06

一套让研究者能公平比较各种大模型调度系统的统一平台

根据不同问题把请求分配给最合适、最省钱的大语言模型的系统各自为政,难以公平比较。这篇论文把这类调度统一成一个由五个组件构成的通用框架,并据此建立了开放基准xRouteBench和开源基础设施LLMRouter,在同一标准下评测了16种以上的调度器。结果显示,学习式调度器相比最强的单一固定模型平均相对提升14.6%,在成本预算收紧时轻量调度器更具竞争力。

METAL MEDIA 解读图

LLMRouter从问题到答案的统一流程

证据状态已报告实测结果

  1. 输入调度状态问题本身、可选的用户上下文,以及目前为止的对话历史共同构成调度器看到的状态。
  2. 五个组件定义任意调度器上下文编码器、模型编码器、打分函数、决策规则和学习信号,这五个可替换的部件描述了每一种调度器类型。
  3. 自动化数据流水线收集问题后发送给全部18个候选模型,同时记录回答质量和token成本,生成用于训练与测试的问题-模型矩阵。
  4. xRouteBench五赛道评测在通用大模型任务、长期记忆、视觉、时间序列、个性化五个赛道上,用同一候选池和指标比较16种以上调度器的性能与成本表现。
  5. 真实场景部署验证通过Slack收集真实用户偏好数据,并在五种多智能体协作结构中测试,检验基准评测结果是否能在真实环境中站得住脚。
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 现有的大模型调度系统各自采用不同的设计和代码实现,难以公平比较;本文把调度统一为一个由五个组件构成的序列决策过程:上下文编码器、模型编码器、打分函数、决策规则和学习信号。
  2. 基于这一统一框架,作者搭建了自动化数据流水线,让每个候选模型都在每个基准问题上运行,同时记录回答质量和推理成本,由此构建了xRouteBench基准(共4767条测试样本,覆盖通用任务、长期记忆、视觉、时间序列和个性化五个赛道)。
  3. 他们发布了开源基础设施LLMRouter,在统一接口下实现了16种以上代表性调度器,支持部署为兼容OpenAI接口的服务接入Slack等即时通讯平台,也提供无需写代码的ComfyUI可视化界面。
  4. 在18个候选大模型(参数量从7B到671B、来自两家API提供商)和xRouteBench五个赛道上的实验显示,学习式调度器相比最强的固定模型基线平均相对提升14.6%,成本预算越紧,轻量级调度器越有竞争力,基于用户信息的个性化调度也持续带来更好的个性化匹配效果。
  5. 研究团队还在Slack上收集了15名用户共234条真实成对偏好数据,并在五种多智能体协作结构中测试了调度器,发现离线基准的排名并不总能直接转移到真实用户场景。
Figure 1: Overview of LLM routing. Routing is driven by three needs (left), namely cost efficiency, capability matching, and user preference. Our unified formulation (right) casts all of them as one decision process: a context encoder Eq represents the routing state of query, persona, and interaction history, a model encoder Em represents each candidate, and the router dispatches the query or its sub-queries to selected models and aggregates their responses into the answer. The single-turn, multi-turn, and personalized families differ only in which part of the state they observe.
Figure 1: Overview of LLM routing. Routing is driven by three needs (left), namely cost efficiency, capability matching, and user preference. Our unified formulation (right) casts all of them as one decision process: a context encoder Eq represents the routing state of query, persona, and interaction history, a model encoder Em represents each candidate, and the router dispatches the query or its sub-queries to selected models and aggregates their responses into the answer. The single-turn, multi-turn, and personalized families differ only in which part of the state they observe.
Table 1: Instantiation of the unified routing formulation for the three router families. For each family, the table specifies the routing state s, the context and model encoders Eq and Em, the routing action defined by the scoring function g and decision rule d, and the learning signal ℒ used to optimize response quality and inference cost.
FamilyState sEncoders Eq,EmRouting action (scoring g, decision d)Learning signal ℒ (surrogate of Eq. 1)
Single-turn(q)Eq​(q),Em​(m)a=arg⁡maxm∈ℳ⁡g⁡(Eq​(q),Em​(m))fit g to per-candidate reward perf⁡(ym∣q)−λ​cm
Multi-turn(q,ht)Eq​(q,ht),Em​(m)at∼d⁡({g⁡(Eq​(q,ht),Em​(m))}m)maximize episode return 𝔼τ​[perf⁡(y∣q)−λ​c​(τ)]
Personalized(q,u,ht)Eq​(q,u,ht),Em​(m)a=arg⁡maxm∈ℳ⁡g⁡(Eq​(q,u,ht),Em​(m))fit g to comparisons m+≻um− observing perfu
Figure 2: Task composition of xRouteBench. The benchmark covers generic LLM tasks, memory, vision, time-series, and personalized routing, with percentages indicating the proportion of test queries contributed by each dataset.
Figure 2: Task composition of xRouteBench. The benchmark covers generic LLM tasks, memory, vision, time-series, and personalized routing, with percentages indicating the proportion of test queries contributed by each dataset.
Table 2: Results on xRouteBench under the performance-first setting (α,β)=(1.0,0.0). Scores are reported across the Generic LLM Tasks, memory, vision, and time-series tracks, together with their average. Following the original implementations where applicable, all multi-turn routers use Qwen2.5-3B-Instruct as the base model. Top two results are highlighted in bold and underline.
RouterGeneric LLM TasksMemoryVisionTimeSeriesAvg
LoCoMoLongMemEvalGeometry3KMathVistaVideo
Rule-based baselines
Smallest-LLM57.5525.4436.7727.8735.0033.3349.6137.94
Largest-LLM70.2926.5935.5737.7033.0022.2245.6738.72
Single-turn routers
kNNRouter71.3725.2438.7431.1541.0029.6351.9741.30
SVMRouter74.2127.6438.6842.6247.0029.6355.9145.10
MLPRouter68.1226.7832.2727.8734.0029.6356.6939.34
MFRouter67.2324.4934.9140.9829.0022.2251.9738.69
EloRouter64.1525.7037.2745.9050.0025.9363.7844.68
Hybrid LLM64.6825.8936.5632.7937.0033.3351.1840.20
RouterDC80.5624.9336.7716.3924.0025.9345.6736.32
GraphRouter80.5425.9433.9342.6250.0022.2262.9945.46
CausalLM66.9025.4037.6024.6034.0033.3345.7038.22
Multi-turn routers
Router-R135.6424.6017.2814.7518.0022.2223.6222.30
kNN-MultiRound13.9924.7018.3216.3930.0025.9333.0723.20
LLM-MultiRound12.9824.6017.4414.2931.0325.9330.3322.37
Figure 3: Architecture of LLMRouter. The system consists of six modules that support routing data construction, router implementation and training, inference, evaluation, and deployment.
Figure 3: Architecture of LLMRouter. The system consists of six modules that support routing data construction, router implementation and training, inference, evaluation, and deployment.
Table 3: Performance comparison on the personalized track. Top two results are highlighted in bold and underline.
RouterAcc.RouterAcc.
GMTRouter68.78RouterDC56.44
PersonalizedRouter67.86MFRouter54.39
EloRouter66.40MLPRouter52.93
GraphRouter65.23kNNRouter51.76
SVMRouter65.08CausalLM46.78
Largest-LLM58.05Router-R145.46
Hybrid LLM57.91Smallest-LLM42.53
Figure 5: Router rankings across the Generic LLM Tasks, memory, vision, and time-series tracks as the cost weight β increases. Each cell gives a router’s rank under the weighted performance–cost objective, with smaller rank values indicating better performance.
Figure 5: Router rankings across the Generic LLM Tasks, memory, vision, and time-series tracks as the cost weight β increases. Each cell gives a router’s rank under the weighted performance–cost objective, with smaller rank values indicating better performance.
Table 4: Router performance on held-out real-user sessions collected through the Slack deployment. Accuracy measures how often each router’s model selection agrees with the users’ pairwise preferences.
RouterAcc.RouterAcc.
PersonalizedRouter83.05RouterDC65.25
EloRouter82.20kNNRouter60.17
MLPRouter78.81kNN-MultiRound60.17
SVMRouter77.12Smallest-LLM55.08
Hybrid LLM73.73MFRouter51.69
GMTRouter70.70Largest-LLM41.53
GraphRouter67.17CausalLM27.97
Figure 6: Performance–cost trade-offs of routers averaged across the xRouteBench tracks. Each point represents an operating setting with a different cost weight β, where higher performance and lower per-query inference cost are preferred.
Figure 6: Performance–cost trade-offs of routers averaged across the xRouteBench tracks. Each point represents an operating setting with a different cost weight β, where higher performance and lower per-query inference cost are preferred.
Table 5: Router performance on the Generic LLM Tasks test split when each node in a multi-agent system is routed independently. Results are reported across five coordination topologies, with the final column showing the average performance.
RouterStarTreeGraphChainPlan-Exec-SumAvg
Largest-LLM69.0067.0077.2069.0075.2071.48
kNNRouter74.8078.6078.6076.6071.8076.08
SVMRouter76.2075.6080.0074.4075.2076.28
MLPRouter75.4076.6076.8078.0071.4075.64
MFRouter75.4074.2081.0078.6073.2076.48
EloRouter73.8072.4078.6076.6075.2075.32
GraphRouter68.2070.8066.2072.0069.0069.24
RouterDC77.6079.6074.2072.0076.2075.92
Figure 7: Representative multi-agent system architectures and coordination topologies: (a) star-based centralized coordination, (b) hierarchical tree-based delegation, (c) graph-based peer interaction, (d) sequential chain collaboration, and (e) planner–executor–summarizer workflow.
Figure 7: Representative multi-agent system architectures and coordination topologies: (a) star-based centralized coordination, (b) hierarchical tree-based delegation, (c) graph-based peer interaction, (d) sequential chain collaboration, and (e) planner–executor–summarizer workflow.
Table 6: The eight test sets of xRouteBench. Sizes are the number of test queries; metrics are exact match (EM), multiple-choice accuracy (MC), token-level F1, execution-based code pass rate, math answer matching, and a persona-conditioned LLM judge.
CategoryTest setContent#TestMetric
Generic LLM TasksGeneric mix13 subtasks3,729EM/MC/F1/GSM8K/MATH/code
MemoryLoCoMolong-conversation QA314F1
LongMemEvallong-term memory QA101F1
TimeSeriesTimeSeries7 reasoning skills127MC
VisionGeometry3Kgeometry math (image)61EM
MathVistavisual math reasoning100EM/MC
Charades-Egoegocentric video27EM
PersonalizedChatbot Arena / MT-Benchpreference prompts308LLM judge
Total4,767
Figure 8: One example from each dataset in the Visual Reasoning track, shown with the description that Gemma-3-27B-IT produces for its image. Geometry3K (a) provides a geometry diagram, and MathVista (b) provides a scientific figure. Each description is appended to the problem text to form the query the router sees.
Figure 8: One example from each dataset in the Visual Reasoning track, shown with the description that Gemma-3-27B-IT produces for its image. Geometry3K (a) provides a geometry diagram, and MathVista (b) provides a scientific figure. Each description is appended to the problem text to form the query the router sees.
Table 7: Composition of the Generic LLM Tasks track. The table lists the 13 subtasks, their target skills, and the number of test queries, totaling 3,729 examples.
SubtaskSkill#Test
MBPPcode generation500
MATHmathematical reasoning500
GSM8Kmathematical reasoning500
MMLU-Proknowledge QA500
OpenBookQAknowledge QA500
ARC-Challengeknowledge QA500
MMLUknowledge QA500
CommonsenseQAcommonsense QA50
BoolQcommonsense QA50
SQuADreading comprehension50
HellaSwagcommonsense QA50
HumanEvalcode generation16
AIME (2020–2024)competition math13
Figure 11: Slack interface for collecting pairwise user preferences. Two anonymized model responses are shown as Answer A and Answer B in randomized order, and users select A, B, or a tie for each interaction turn.
Figure 11: Slack interface for collecting pairwise user preferences. Two anonymized model responses are shown as Answer A and Answer B in randomized order, and users select A, B, or a tie for each interaction turn.
Table 8: Built-in routers in LLMRouter, grouped by routing family. For each method, the table summarizes the information available to the routing decision (State) and the rule used to select or aggregate candidate models (Selection).
RouterStateSelection
Rule-based baselines
Smallest-LLMcandidate parameter countsalways selects the smallest candidate
Largest-LLMcandidate parameter countsalways selects the largest candidate
Single-turn routers
kNNRouterquery embedding and nearby logged queriesvotes over the models preferred by nearest neighbors
SVMRouterquery embeddingkernel classifier predicts a candidate
MLPRouterquery embeddingMLP classifier predicts a candidate
MFRouterquery and model latent factorsranks candidates by their interaction score
EloRouterlogged pairwise model outcomesalways selects the highest-rated candidate
RouterDCquery and candidate representationscontrastive query–model matching score
Hybrid LLMquery embedding and a small/large model pairpredicts whether the small model is sufficient
AutoMixsmall-model draft and verification signalaccepts the draft or escalates to the large model
GraphRouterquery–model interaction graphpredicts performance on query–model edges
CausalLM Routertextual query and candidate listgenerates the selected model name
Multi-turn routers
Router-R1query and accumulated search resultsiteratively searches specialists or terminates and aggregates
kNN-MultiRoundsub-queries and their embeddingsroutes each sub-query with kNN and aggregates the answers
LLM-MultiRoundtextual query, decomposition, and candidate listan LLM chooses routes for sub-queries and aggregates
Personalized routers
GMTRouteruser, session, query, model, and response interactionspredicts user-conditioned model preference
PersonalizedRouteruser features, task description, query, and modelpredicts preference for a user–query pair
Figure 12: The ComfyUI interface of LLMRouter. The source benchmarks and the candidate pool enter at the left, the data-engine node produces the query–model matrix, and each router node consumes the matrix and reports its evaluation, so the graph traces the routing pipeline from data construction to evaluation. Each router node exposes the hyperparameters of its library configuration as typed widgets.
Figure 12: The ComfyUI interface of LLMRouter. The source benchmarks and the candidate pool enter at the left, the data-engine node produces the query–model matrix, and each router node consumes the matrix and reports its evaluation, so the graph traces the routing pipeline from data construction to evaluation. Each router node exposes the hyperparameters of its library configuration as typed widgets.
Table 9: The 18 candidate LLMs, sorted by blended average price. Prices in USD per 1M tokens.
#ModelParamsInputOutputService
1gemma-2-9b-it9B0.100.10NVIDIA
2llama-3-8b-instruct-lite8B0.100.10Together
3gpt-oss-20b20B0.050.20Together
4rnj-1-instruct15B0.150.15Together
5mistral-7b-instruct-v0.37B0.200.20NVIDIA
6mistral-small-3-24b-instruct24B0.100.30Together
7qwen2.5-7b-instruct7B0.200.20NVIDIA
8qwen2.5-7b-instruct-turbo7B0.300.30Together
9gpt-oss-120b120B0.150.60Together
10llama-4-maverick402B0.270.85Together
11mixtral-8x7b-instruct-v0.146.7B0.600.60NVIDIA
12qwen3-next-80b-a3b-instruct80B0.151.50Together
13qwen3-coder-next200B0.501.20Together
14llama-3.3-70b-instruct-turbo70B0.880.88Together
15llama3-70b-instruct70B0.900.90NVIDIA
16deepseek-v3.1671B0.601.70Together
17mixtral-8x22b-instruct-v0.1140.6B1.201.20NVIDIA
18cogito-v2-1-671b671B1.251.25Together
Table 10: The five multi-agent topologies, their structures, and the number of LLM calls per query.
TopologyStructureLLM calls
Starplanner decomposes → 3 actors in parallel → planner consolidates6
Treeroot planner → 2 sub-planners refine → 2 actors → root consolidates7
Graph3 actors answer independently → one full-communication revision round7
Chain3 agents relay sequentially, each verifying and improving the previous answer4
Plan-Exec-Sumplanner emits 3 atomic sub-queries → 3 executors → summarizer merges6

研究结果

  • 在18个候选大模型和xRouteBench五个赛道上,学习式调度器相比最强的固定模型基线,性能平均相对提升了14.6%。
  • 没有任何一种调度器在所有任务上都占优:RouterDC在通用大模型任务上表现最好,SVMRouter在LoCoMo任务上最好,而GraphRouter平均表现最佳但并非每个具体任务的第一名。
  • 多轮调度并没有持续优于单轮调度,其表现对用于分解与汇总的基础模型(Qwen2.5-3B-Instruct)的能力较为敏感。
  • 在个性化赛道上,GMTRouter的人设评审准确率达到68.78,领先于PersonalizedRouter(67.86)以及不使用用户信息的最佳调度器EloRouter(66.40)。
  • 随着成本权重增大(图5、图6),调度器排名发生显著变化;始终选用最大模型的方案成本最高但性能仅属中等,不敌学习式调度器。在234条真实Slack偏好数据上,PersonalizedRouter以83.05的准确率领先,而在模拟评测中排名第一的GMTRouter降至第六;在五种多智能体协作结构实验中,MFRouter取得76.48的平均成绩,优于始终使用最大模型的71.48。

可应用场景

  • 为同时运营多个大语言模型、需要在成本与质量间权衡的服务设计和调优调度系统
  • 在开发新的调度算法时,通过修改配置文件复用LLMRouter现成的数据流水线和评测工具,而无需重建整套基础设施
  • 在长对话历史、图像/视频、时间序列等多种输入类型上比较不同调度方案的表现
  • 构建能够根据用户个人偏好调整模型选择的个性化聊天助手
  • 在多智能体系统中为不同角色节点(规划者、执行者、总结者等)分别选择最合适的模型

局限与待验证事项

  • 所有多轮调度器都使用同一个基础模型(Qwen2.5-3B-Instruct)进行问题分解与结果汇总,尚未验证结论是否适用于其他基础模型。
  • 基于人设评审的模拟评测排名与真实用户偏好数据的排名并不一致(GMTRouter从模拟第一降至真实场景第六),说明离线基准结果未必能直接迁移到实际部署环境。
  • 候选模型池仅限于18个开源权重模型(7B到671B,来自两家特定API提供商),尚未在闭源商用模型或其他定价结构下验证结果。
  • 真实用户实验规模较小,仅有15名用户、40个会话、234条成对偏好记录,统计代表性有限。
  • Plan-Exec-Sum多智能体拓扑结构沿用了GraphPlanner的设计但未重新训练其规划器,是实验设计上的一处简化。

为什么重要

随着AI产品越来越多地混合使用多个大语言模型来平衡成本与质量,决定每个问题该交给哪个模型处理成为核心工程问题,这项工作为从业者提供了一套统一的评测标准和工具,便于比较和构建适合自身场景的调度方案,而不必每次都重新搭建评测体系。

本文术语

  • 大模型调度(LLM routing) · 针对每个输入问题,决定由候选的多个大语言模型中的哪一个来回答
  • 上下文编码器 / 模型编码器 · 分别用来表示问题及对话状态(上下文编码器)和表示每个候选模型特点(模型编码器)的组件
  • 决策规则 · 把打分结果转化为实际选择哪个模型、或何时停止调度的规则
  • xRouteBench · 本文构建的调度评测基准,涵盖通用问答、长期记忆、视觉、时间序列和个性化任务
  • 性能-成本权衡 · 回答质量越高往往消耗的token或费用越多,需要在两者之间找到平衡点

论文原文摘要(英文)

No single large language model (LLM) is optimal across all queries and budget constraints, making model routing essential for cost-effective deployment. Existing routers adopt diverse formulations and implementations, making fair comparison and extension difficult. We present a unified formulation of LLM routing as a sequential decision process characterized by five components: context encoders, model encoders, scoring functions, decision rules, and learning signals, covering single-turn, multi-turn, and personalized routing. Based on this formulation, we develop an automated pipeline for constructing routing supervision and evaluating routers jointly on response quality and inference cost. The resulting benchmark, xRouteBench, spans generic LLM, memory-augmented, vision, time-series, and personalized routing tasks. We further introduce LLMRouter, an open-source modular infrastructure with more than 16 representative routers. Our empirical study shows that learned routers outperform the strongest fixed-model baseline by 14.6% relatively, lightweight routers become more competitive under tight cost constraints, and user-conditioned routing consistently improves personalization.

作者 · Tao Feng

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道

图片来源: Tao Feng et al., arXiv:2608.06867, CC BY 4.0