AvaTaR:通过对比推理优化大语言模型智能体的工具使用能力
AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning
AI总结:
针对大语言模型智能体工具使用的提示优化依赖人工启发式的问题,提出自动化框架AvaTaR,通过对比正负例的比较器模块迭代生成优质提示,在7项任务上均优于SOTA,泛化性强。
摘要:
大语言模型(LLM)智能体在利用外部工具与知识提升准确率、减少幻觉方面已展现出出色能力。然而,开发能让LLM智能体有效使用这些工具与知识的提示工程技术,目前仍是一项依赖启发式方法且耗费人力的任务。本文提出AvaTaR,这是一种新颖的自动化框架,可优化LLM智能体以有效利用给定工具,提升其在指定任务上的表现。在优化过程中,我们设计了一个比较器模块,通过对训练数据中采样的正例与负例进行对比推理,迭代式地向LLM智能体提供具有启发性且全面的提示。我们在4个包含文本、视觉与关系信息的复杂多模态检索数据集,以及3个通用问答(QA)数据集上验证了AvaTaR的效果。结果显示,AvaTaR在全部7项任务中始终优于现有最优方法,在应用于新场景时展现出强泛化能力;在检索数据集的Hit@1指标上实现了14%的平均相对提升,在QA数据集上则达到13%的平均相对提升。代码与数据集可在https://github.com/zou-group/avatar获取。
英文摘要:
Large language model (LLM) agents have demonstrated impressive capabilities in utilizing external tools and knowledge to boost accuracy and reduce hallucinations. However, developing prompting techniques that enable LLM agents to effectively use these tools and knowledge remains a heuristic and labor-intensive task. Here, we introduce AvaTaR, a novel and automated framework that optimizes an LLM agent to effectively leverage provided tools, improving performance on a given task. During optimization, we design a comparator module to iteratively deliver insightful and comprehensive prompts to the LLM agent by contrastively reasoning between positive and negative examples sampled from training data. We demonstrate AvaTaR on four complex multimodal retrieval datasets featuring textual, visual, and relational information, and three general question-answering (QA) datasets. We find AvaTaR consistently outperforms state-of-the-art approaches across all seven tasks, exhibiting strong generalization ability when applied to novel cases and achieving an average relative improvement of 14% on the Hit@1 metric for the retrieval datasets and 13% for the QA datasets. Code and dataset are available at https://github.com/zou-group/avatar.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。