用大模型生成假想工具描述,让检索器更懂用户需求
ToolDreamer: Instilling LLM Reasoning Into Tool Retrievers
- 用大模型生成用户可能需要的工具假想描述来辅助检索
- 在ToolRet数据集上提升稀疏与稠密检索器性能
- 适合需要高效调用大量工具的智能系统开发者
工具调用已成为大语言模型(LLM)的重要能力。然而,当工具数量庞大时,所有工具的描述会超出模型上下文窗口限制,无法全部纳入。因此需依赖外部检索器为查询提供最相关的工具。现有检索模型基于用户查询与工具描述(TD)之间的相似性进行排序,但用户请求常与工具描述的语言不匹配,导致检索效果不佳。为此,我们提出ToolDreamer框架,通过大模型生成假设性(合成)的工具描述——即模型认为对当前查询可能有用的工具描述,来指导检索器。该方法使查询与工具在描述语言空间中实现更自然的对齐。我们在ToolRet数据集上验证了该方法,结果表明其可有效提升无训练与有训练的稀疏及稠密检索器性能,展现良好灵活性。本框架旨在将部分推理负担转移至检索器,使大模型能高效处理海量工具而无需塞满上下文。
原文摘要 · Abstract (English)
Tool calling has become increasingly popular for Large Language Models (LLMs). However, for large tool sets, the resulting tokens would exceed the LLM's context window limit, making it impossible to include every tool. Hence, an external retriever is used to provide LLMs with the most relevant tools for a query. Existing retrieval models rank tools based on the similarity between a user query and a tool description (TD). This leads to suboptimal retrieval as user requests are often poorly aligned with the language of TD. To remedy the issue, we propose ToolDreamer, a framework to condition retriever models to fetch tools based on hypothetical (synthetic) TD generated using an LLM, i.e., description of tools that the LLM feels will be potentially useful for the query. The framework enables a more natural alignment between queries and tools within the language space of TD's. We apply ToolDreamer on the ToolRet dataset and show that our method improves the performance of sparse and dense retrievers with and without training, thus showcasing its flexibility. Through our proposed framework, our aim is to offload a portion of the reasoning burden to the retriever so that the LLM may effectively handle a large collection of tools without inundating its context window.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。