Skip to main content
QUICK REVIEW

[论文解读] RouteLLM: Learning to Route LLMs with Preference Data

Isaac Ong, Amjad Almahairi|arXiv (Cornell University)|Jun 26, 2024
Data Mining Algorithms and Applications被引用 4
一句话总结

RouteLLM 提出一种路由器模型,在推理时动态选择强模型或弱模型,以优化成本-性能权衡。该模型基于人类偏好数据进行训练,并通过数据增强技术提升性能,在 MT Bench 和 GSM8K 等基准测试中实现超过 2 倍的成本降低,同时保持高质量响应,且无需微调即可有效泛化至新的模型对。

ABSTRACT

Large language models (LLMs) exhibit impressive capabilities across a wide range of tasks, yet the choice of which model to use often involves a trade-off between performance and cost. More powerful models, though effective, come with higher expenses, while less capable models are more cost-effective. To address this dilemma, we propose several efficient router models that dynamically select between a stronger and a weaker LLM during inference, aiming to optimize the balance between cost and response quality. We develop a training framework for these routers leveraging human preference data and data augmentation techniques to enhance performance. Our evaluation on widely-recognized benchmarks shows that our approach significantly reduces costs-by over 2 times in certain cases-without compromising the quality of responses. Interestingly, our router models also demonstrate significant transfer learning capabilities, maintaining their performance even when the strong and weak models are changed at test time. This highlights the potential of these routers to provide a cost-effective yet high-performance solution for deploying LLMs.

研究动机与目标

  • 通过在推理时动态将查询路由至更强或更弱的模型,解决大语言模型部署中的成本-质量权衡问题。
  • 开发一种基于人类偏好数据和数据增强的路由器训练框架,以提升泛化能力。
  • 在多种基准测试中实现显著的成本节约,同时保持高质量响应。
  • 在分布外基准上评估路由器性能,并展示其在不同模型对之间的可迁移性。
  • 开源代码和偏好数据,以支持可复现性及社区使用。

提出的方法

  • 使用来自 Chatbot Arena 的人类偏好数据训练路由器模型,学习在每个输入查询下,更强或更弱的大语言模型中哪一个更受偏好。
  • 通过使用大语言模型裁判或领域内数据生成合成偏好比较,实施数据增强,以提升泛化能力。
  • 评估多种路由器架构,包括 BERT、因果语言模型、矩阵分解和相似性加权排序。
  • 基于输入嵌入和学习到的偏好模式,路由器为每个查询预测最优模型。
  • 采用 Call-Performance Threshold (CPT) 和 Average Performance Gain Recovered (APGR) 等指标评估性能。
  • 通过泛化至未在训练中见过的新强-弱模型对,实现零样本迁移。

实验结果

研究问题

  • RQ1在人类偏好数据上进行训练的路由器模型,能否有效实现强弱大语言模型之间的查询路由,在保持质量的同时降低成本?
  • RQ2数据增强在不同基准测试中对路由器性能有何影响?
  • RQ3路由器模型在未见的模型对上能实现多大程度的泛化?
  • RQ4在实际部署中,此类路由器的推理开销和成本效率如何?
  • RQ5不同路由器架构在性能和可扩展性方面有何差异?

主要发现

  • 表现最佳的路由器在 MT Bench 上实现 3.66 倍的成本降低,同时保持 GPT-4 95% 的响应质量。
  • 在 MMLU 上,路由器实现 1.41 倍的成本降低,同时达到 GPT-4 92% 的性能。
  • 在 GSM8K 上,路由器实现 1.49 倍的成本节省,同时保持 GPT-4 87% 的质量。
  • 路由器能有效泛化至新模型对,达到 80% CPT 所需的 GPT-4 调用次数比随机路由减少最多 30%。
  • 数据增强显著提升路由器性能,尤其在训练数据与评估数据分布相近时效果更明显。
  • 路由器推理开销极低,对 GPT-4 生成总成本的增加不足 0.4%,证明其具备实际可部署性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。