arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.19198cs.AIcs.LGstat.ML
收藏

嵌入几何塑造大语言模型路由:追踪失效模式并提升泛化能力

Embedding Geometry Shapes LLM Routing: Tracing Failure Modes and Improving Generalization

Massachusetts Institute of Technology(麻省理工学院);Texas A&M University(德克萨斯农工大学)

Leonardo Torti, Emanuele Rimoldi, Tomer Galanti, Tomaso Poggio, Pierfrancesco Beneventano

AI总结:

本研究针对LLM路由的泛化失效问题,提出用Qwen2.5-7B-Instruct的深层最后token隐藏状态替代语义嵌入,相关方法在RouterBench上优于基线及最优路由器。

摘要:

随着可用大语言模型(LLM)数量的增长,为一个提示选择使用哪款LLM已成为关键问题。大部分路由文献依赖将提示语义嵌入向量空间,再对嵌入表示应用轻量级分类器。这些方法在分布内表现稳健,但难以泛化到未见任务。通过研究语义嵌入的几何特性,我们追踪到明确的失效模式:决定未见提示邻居的特征是LLM选择的不可靠代理。因此,我们用以下映射替代语义嵌入:对提示运行Qwen2.5-7B-Instruct的部分前向传播,取其深层最后一个token的隐藏状态作为表示。当对该新表示应用kNN及其他简单分类器时,我们在泛化上获得明确结果:在成本惩罚的平均情况下,其性能有所提升。此外,kNN及我们提出的另一简单分类器,优于所有被评估的语义嵌入基线。我们的两种简单方法在RouterBench上也击败了近期基于隐藏状态的最优(SoTA)路由器。

英文摘要:

With the growing number of LLMs available, selecting which one to use for a prompt has become a key question. A large part of the routing literature relies on semantically embedding prompts into a vector space and then applying a lightweight classifier to the embedded representations. These methods perform robustly in-distribution but they struggle to generalize to unseen tasks. By studying the geometry of semantic embeddings, we trace a clear failure mode: features that determine the neighbors of unseen prompts are an unreliable proxy for LLM selection. We therefore replace the semantic embedding with the following map: we run a partial forward pass of Qwen2.5-7B-Instruct on the prompt and use the hidden state of its last token at a deep layer as the representation. When applying kNN and other simple classifiers to this new representation, we obtain a clear result in generalization: on average across cost penalties, their performance improves. Moreover, kNN and another simple classifier that we propose outperform every evaluated semantic-embedding baseline. Our two simple methods also beat a recent SoTA hidden-states based router on RouterBench.

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

↑