arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.03834cs.AI
收藏

GraphRouter:一种用于 LLM 选择的基于图的路由器

GraphRouter: A Graph-based Router for LLM Selections

University of Illinois Urbana Champaign(伊利诺伊大学厄巴纳-香槟分校)

Tao Feng, Yanzhen Shen, Jiaxuan You

AI总结:

本文提出 GraphRouter 归纳式异构图框架,通过边预测建模任务、查询与 LLM 的交互及效果成本,实现无需重训即可适配新 LLM 的自适应选择,性能提升至少 12.3%。

摘要:

大型语言模型(LLM)的数量和种类快速增长,给为给定查询高效选择合适 LLM 带来了重大挑战,尤其是在考虑性能与计算成本之间的权衡时。当前的 LLM 选择方法往往难以泛化到新的 LLM 和不同任务,原因在于它们利用任务、查询与 LLM 之间上下文交互的能力有限,并且依赖直推式学习框架。为解决这些不足,我们提出一种新颖的归纳式图框架,名为 GraphRouter,它充分利用任务、查询和 LLM 之间的上下文信息来增强 LLM 选择过程。GraphRouter 构建了一个由任务、查询和 LLM 节点组成的异构图,并将交互表示为边,从而高效捕捉查询需求与 LLM 能力之间的上下文信息。通过创新的边预测机制,GraphRouter 能够预测潜在边的属性(LLM 响应的效果和成本),从而给出经过优化的推荐,这些推荐能够适应现有及新引入的 LLM,而无需重新训练。在三种不同的效果—成本权重场景下进行的综合实验表明,GraphRouter 显著优于现有路由器,性能提升至少达到 12.3%。此外,它在新 LLM 设置下实现了更强的泛化,并支持多种任务,效果至少提升 9.5%,同时显著降低计算需求。本工作致力于将基于图的方法应用于 LLM 的上下文自适应选择,为现实世界应用提供洞见。GraphRouter 的代码已发布于 https://github.com/ulab-uiuc/GraphRouter。

英文摘要:

The rapidly growing number and variety of Large Language Models (LLMs) present significant challenges in efficiently selecting the appropriate LLM for a given query, especially considering the trade-offs between performance and computational cost. Current LLM selection methods often struggle to generalize across new LLMs and different tasks because of their limited ability to leverage contextual interactions among tasks, queries, and LLMs, as well as their dependence on a transductive learning framework. To address these shortcomings, we introduce a novel inductive graph framework, named as GraphRouter, which fully utilizes the contextual information among tasks, queries, and LLMs to enhance the LLM selection process. GraphRouter constructs a heterogeneous graph comprising task, query, and LLM nodes, with interactions represented as edges, which efficiently captures the contextual information between the query's requirements and the LLM's capabilities. Through an innovative edge prediction mechanism, GraphRouter is able to predict attributes (the effect and cost of LLM response) of potential edges, allowing for optimized recommendations that adapt to both existing and newly introduced LLMs without requiring retraining. Comprehensive experiments across three distinct effect-cost weight scenarios have shown that GraphRouter substantially surpasses existing routers, delivering a minimum performance improvement of 12.3%. In addition, it achieves enhanced generalization across new LLMs settings and supports diverse tasks with at least a 9.5% boost in effect and a significant reduction in computational demands. This work endeavors to apply a graph-based approach for the contextual and adaptive selection of LLMs, offering insights for real-world applications. Our codes for GraphRouter is released at https://github.com/ulab-uiuc/GraphRouter.

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

↑