让检索器更懂大模型,精准选工具
PORTS: Preference-Optimized Retrievers for Tool Selection with Large Language Models

- 用偏好优化方法训练检索器,提升工具选择相关性
- 在6个数据集上准确率显著提升,兼容多种模型
- 低计算成本,适合动态更新的工具库使用
将外部工具与大语言模型(LLMs)结合已成为完成复杂任务的有前景范式。由于LLMs难以有效管理大规模工具集,研究者开始采用基于检索的方法预先筛选最相关的工具,以应对输入长度和延迟限制。然而,现有检索器常因独立训练而与工具调用的LLM存在对齐偏差。本文提出PORTS,一种基于奇偶比偏好优化的检索器训练方法,用于工具选择。通过冻结的LLM提供的困惑度启发式偏好信号,我们的方法微调检索器,使其在优化选择概率与下游性能相关性的同时,联合施加文档字符串间的对比语义损失。通过在六个数据集、两种编码器模型和三种具有不同先验知识的LLM上的广泛实验,验证了PORTS的通用性和显著提升工具选择准确率的能力。该对齐过程计算开销低,有助于泛化到新查询和新工具,对动态演进的工具集具有实际应用价值。
原文摘要 · Abstract (English)
Integrating external tools with Large Language Models (LLMs) has emerged as a promising paradigm for accomplishing complex tasks. Since LLMs still struggle to effectively manage large tool collections, researchers have begun exploring retrieval-based methods to pre-select the most relevant options, addressing input length and latency constraints. However, existing retrievers are often misaligned with tool-calling LLMs due to their separate training processes. This paper presents PORTS, a novel odds ratio preference optimization method for training retrievers aimed at tool selection. Using a perplexity-inspired preference signal from a frozen LLM, our approach fine-tunes a retriever to find helpful tools by optimizing the correlation between the selection probabilities and the downstream performances while jointly enforcing a contrastive semantic loss between documentation strings. The versatility of PORTS and its ability to significantly improve tool selection accuracy are demonstrated through extensive experiments on six datasets, two encoder models, and three LLMs with diverse prior knowledge. With low computational demands, our alignment process facilitates generalization to new queries and tools, proving valuable for practical applications with evolving toolsets.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。