arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.03573cs.IRcs.AIcs.CL
收藏

利用大语言模型生成查询以改进工具检索

Improving Tool Retrieval by Leveraging Large Language Models for Query Generation

Amazon Alexa AI(亚马逊Alexa人工智能部门)

Mohammad Kachuee, Sarthak Ahuja, Vaibhav Kumar, Puyang Xu, Xiaohu Liu

AI总结:

本文提出利用 LLM 生成工具检索查询,结合嵌入最近邻搜索,并通过零样本提示、监督微调和奖励驱动对齐学习提升复杂多工具场景中的域内与域外检索性能。

摘要:

大语言模型(LLM)使用工具是扩展其能力、使其超越语言或对话场景的一条有前景的途径。由于工具能够访问感官信息、获取更新的事实性知识,或在现实世界中采取行动,工具数量可能扩展至数千个。在这种场景下,通过在提示中提供一小列相关工具来进行上下文学习是一种可行方法。为了检索相关工具,研究者已经提出多种方法,从简单的基于频率的匹配,到基于稠密嵌入的语义检索。然而,这些方法缺乏为复杂用户请求检索正确工具所需的上下文理解和常识理解。我们没有提高检索组件本身的复杂性,而是提出利用 LLM 的理解能力来生成检索查询。随后,生成的查询会被嵌入,并通过最近邻搜索用于查找最相关的工具。我们研究了三种查询生成方法:零样本提示、基于工具描述的监督微调,以及通过迭代优化衡量检索性能的奖励指标进行的对齐学习。通过在一个涵盖复杂和多工具场景的数据集上开展大量实验,我们表明,利用 LLM 生成查询能够改进域内(已见工具)和域外(未见工具)设置下的检索效果。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑