arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.09719cs.LGcs.AI
收藏

ICL-Router:用于大语言模型路由的上下文学习模型表示

ICL-Router: In-Context Learned Model Representations for LLM Routing

Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Chenxu Wang, Hao Li, Yiqun Zhang, Linyao Chen, Jianhao Chen, Ping Jian, Peng Ye, Qiaosheng Zhang, Shuyue Hu

AI总结:

针对现有大语言模型路由依赖精准模型表示、新增模型需重训的问题,提出ICL-Router方法,用上下文向量表征模型能力,两阶段训练实现最优路由性能且支持无缝接入新模型。

摘要:

大语言模型(LLM)往往具备互补的能力优势,模型路由技术可在给定候选模型池的情况下,将每个查询动态分配给最合适的模型,从而利用这些优势。但路由性能依赖精准的模型表示,且新增模型通常需要重新训练,限制了可扩展性。为解决这些挑战,我们提出一种使用上下文向量表示模型能力的新型路由方法,该方法分为两个阶段:首先对查询进行嵌入并投影为向量,训练投影器与基于LLM的路由模块重构原始查询,使向量表示与路由的语义空间对齐;其次在查询集上对每个候选模型进行能力画像,路由模块基于查询的上下文向量与模型性能,学习预测各模型能否正确回答新查询。大量实验表明,该方法在分布内与分布外任务上均取得了当前最优的路由性能,且无需重新训练路由模块即可无缝接入新模型,代码可在https://github.com/lalalamdbf/ICL-Router获取。

英文摘要:

Large language models (LLMs) often exhibit complementary strengths. Model routing harnesses these strengths by dynamically directing each query to the most suitable model, given a candidate model pool. However, routing performance relies on accurate model representations, and adding new models typically requires retraining, limiting scalability. To address these challenges, we propose a novel routing method using in-context vectors to represent model capabilities. The method proceeds in two stages. First, queries are embedded and projected into vectors, with a projector and LLM-based router trained to reconstruct the original queries, aligning vector representations with the router's semantic space. Second, each candidate model is profiled on a query set, and the router learns -- based on in-context vectors of query and model performance -- to predict whether each model can correctly answer new queries. Extensive experiments demonstrate that our method achieves state-of-the-art routing performance in both in-distribution and out-of-distribution tasks. Moreover, our method allows for seamless integration of new models without retraining the router. The code is available at https://github.com/lalalamdbf/ICL-Router.

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

↑