arXiv:2412.03573cs.IRcs.AI2024-12被引 12

用大模型生成查询词,提升工具检索准确率。

Improving Tool Retrieval by Leveraging Large Language Models for Query Generation

  • 让大模型生成更精准的检索词,替代传统匹配方法。
  • 在已见和未见工具场景下,检索准确率均显著提升。
  • 适合需要动态调用多种工具的应用开发者参考。

大语言模型(LLMs)使用工具是扩展其能力的重要途径,可访问感官信息、获取最新事实或在现实世界中执行操作,工具数量可达数千个。在此类场景中,通过在提示中提供少量相关工具列表进行上下文学习是一种可行方案。现有工具检索方法包括基于频率的匹配或基于密集嵌入的语义检索,但缺乏对复杂用户请求所需的上下文与常识理解。本文提出利用大模型自身理解能力生成检索查询词,再通过最近邻搜索匹配最相关工具。研究了三种查询生成方法:零样本提示、基于工具描述的监督微调,以及通过迭代优化检索性能奖励指标的对齐学习。在涵盖复杂多工具场景的数据集上实验表明,借助大模型生成查询能有效提升领域内(已见工具)和领域外(未见工具)的检索效果。

原文摘要 · Abstract (English)

Using tools by Large Language Models (LLMs) is a promising avenue to extend their reach beyond language or conversational settings. The number of tools can scale to thousands as they enable accessing sensory information, fetching updated factual knowledge, or taking actions in the real world. In such settings, in-context learning by providing a short list of relevant tools in the prompt is a viable approach. To retrieve relevant tools, various approaches have been suggested, ranging from simple frequency-based matching to dense embedding-based semantic retrieval. However, such approaches lack the contextual and common-sense understanding required to retrieve the right tools for complex user requests. Rather than increasing the complexity of the retrieval component itself, we propose leveraging LLM understanding to generate a retrieval query. Then, the generated query is embedded and used to find the most relevant tools via a nearest-neighbor search. We investigate three approaches for query generation: zero-shot prompting, supervised fine-tuning on tool descriptions, and alignment learning by iteratively optimizing a reward metric measuring retrieval performance. By conducting extensive experiments on a dataset covering complex and multi-tool scenarios, we show that leveraging LLMs for query generation improves the retrieval for in-domain (seen tools) and out-of-domain (unseen tools) settings.

工具检索大模型应用查询生成零样本学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。