Enhancing Tool Retrieval with Iterative Feedback from Large Language Models
Qiancheng Xu, Yongqi Li†, Heming Xia, Wenjie Li Department of Computing, The Hong Kong Polytechnic University, China {qiancheng.xu,
Abstract
Tool learning aims to enhance and expand large language models’ (LLMs) capabilities with external tools, which has gained significant attention recently. Current methods have shown that LLMs can effectively handle a certain amount of tools through in-context learning or fine-tuning. However, in real-world scenarios, the number of tools is typically extensive and irregularly updated, emphasizing the necessity for a dedicated tool retrieval component. Tool retrieval is nontrivial due to the following challenges: 1) complex user instructions and tool descriptions; 2) misalignment between tool retrieval and tool usage models. To address the above issues, we propose to enhance tool retrieval with iterative feedback from the large language model. Specifically, we prompt the tool usage model, i.e., the LLM, to provide feedback for the tool retriever model in multi-round, which could progressively improve the tool retriever’s understanding of instructions and tools and reduce the gap between the two standalone components. We build a unified and comprehensive benchmark to evaluate tool retrieval models. The extensive experiments indicate that our proposed approach achieves advanced performa
中文速览
大规模工具集场景下,如何让大语言模型(LLM)准确找到真正有用的工具,是工具学习落地的关键难题——用户指令往往模糊复杂,工具描述与指令之间语义重叠少,而且负责检索的小模型和负责使用工具的LLM各自为政,两者认知不对齐。为此,本文提出一个迭代反馈框架(TR-Feedback):每轮检索结束后,让LLM对当前检索结果进行"理解—评估—精炼"三步反馈,自动改写用户指令,再把改写后的指令送回检索器做下一轮检索,如此循环,逐步把LLM对工具功能和用户意图的深层理解注入到检索模型中。同时,训练时引入迭代轮次感知标记和难负样本采样,让检索器学会区分相似但不相关的工具。作者还构建了涵盖域内与域外设置的综合工具检索基准TR-bench,实验结果显示该方法在两种设置下均优于现有基线。这项工作填补了工具检索研究的空白,为真实场景中工具频繁更新、规模庞大的LLM工具调用系统提供了切实可行的解决思路。
原文 arXiv:2406.17465;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2406.17465v2