Recently, integrating external tools with Large Language Models (LLMs) has gained significant attention as an effective strategy to mitigate the limitations inherent in their pre-training data. However, real-world systems often incorporate a wide array of tools, making it impractical to input all tools into LLMs due to length limitations and latency constraints. Therefore, to fully exploit the potential of tool-augmented LLMs, it is crucial to develop an effective tool retrieval system. Existing tool retrieval methods primarily focus on semantic matching between user queries and tool descriptions, frequently leading to the retrieval of redundant, similar tools. Consequently, these methods fail to provide a complete set of diverse tools necessary for addressing the multifaceted problems encountered by LLMs. In this paper, we propose a novel modelagnostic COllaborative Learning-based Tool Retrieval approach, COLT, which captures not only the semantic similarities between user queries and tool descriptions but also takes into account the collaborative information of tools. Specifically, we first fine-tune the PLM-based retrieval models to capture the semantic relationships between queries and tools in the semantic learning stage. Subsequently, we construct three bipartite graphs among queries, scenes, and tools and introduce a dual-view graph collaborative learning framework to capture the intricate collaborative relationships among tools during the collaborative learning stage. Extensive experiments on both the open benchmark and the newly introduced ToolLens dataset show that COLT achieves superior performance. Notably, the performance of BERT-mini (11M) with our proposed model framework outperforms BERT-large (340M), which has 30 times more parameters. Furthermore, we will release ToolLens publicly to facilitate future research on tool retrieval.
翻译:近年来,将外部工具与大语言模型(LLMs)相结合已成为一种缓解其预训练数据固有局限性的有效策略,并获得了广泛关注。然而,现实世界的系统通常集成了大量工具,由于输入长度限制和延迟约束,将所有工具输入LLMs是不切实际的。因此,为了充分发挥工具增强型LLMs的潜力,开发一个有效的工具检索系统至关重要。现有的工具检索方法主要关注用户查询与工具描述之间的语义匹配,这常常导致检索到冗余的、相似的工具。因此,这些方法无法为LLMs处理所遇到的多方面问题提供一套完整且多样化的必要工具集。本文提出了一种新颖的、与模型无关的基于协作学习的工具检索方法——COLT,该方法不仅捕捉用户查询与工具描述之间的语义相似性,还考虑了工具的协作信息。具体而言,我们首先在语义学习阶段微调基于预训练语言模型(PLM)的检索模型,以捕捉查询与工具之间的语义关系。随后,我们在查询、场景和工具之间构建了三个二分图,并在协作学习阶段引入了一个双视图图协作学习框架,以捕捉工具之间复杂的协作关系。在开放基准和新引入的ToolLens数据集上进行的大量实验表明,COLT取得了卓越的性能。值得注意的是,采用我们提出的模型框架的BERT-mini(1100万参数)的性能甚至超过了参数量为其30倍的BERT-large(3.4亿参数)。此外,我们将公开ToolLens数据集,以促进未来关于工具检索的研究。