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

从失败中学习:在微调作为智能体的大型语言模型时整合负例

Learning From Failure: Integrating Negative Examples when Fine-tuning Large Language Models as Agents

LibrAI;MBZUAI(穆罕默德·本·扎耶德人工智能大学);The University of Melbourne(墨尔本大学)

Renxi Wang, Haonan Li, Xudong Han, Yixuan Zhang, Timothy Baldwin

AI总结:

本文提出在智能体微调中利用失败交互轨迹,通过前缀或后缀标识轨迹成败并配合质量控制,使 LLM 从负例学习,在多类任务上显著提升性能。

摘要:

大型语言模型(LLM)在充当智能体方面已经取得成功,这些智能体通过搜索引擎等工具与环境交互。然而,LLM 在训练或对齐期间是针对语言生成而非工具使用进行优化的,这限制了它们作为智能体的有效性。为了解决这一问题,先前工作首先收集 LLM 与环境之间的交互轨迹,仅使用成功完成任务的轨迹来微调较小模型,导致微调数据稀缺,且获取这些数据既困难又昂贵。丢弃失败轨迹还会造成数据和资源的严重浪费,并限制微调期间可能的优化路径。本文认为,不成功的轨迹提供了有价值的洞见,通过适当的质量控制和微调策略,LLM 可以从这些轨迹中学习。通过简单地添加一个前缀或后缀,以告知模型在训练期间是否生成成功轨迹,我们在数学推理、多跳问答和策略性问答任务上大幅提升了模型性能。我们进一步分析推理结果,发现我们的方法在不成功轨迹中的有价值信息与错误之间提供了更好的权衡。据我们所知,我们是首个证明负轨迹价值及其在智能体微调场景中应用的研究。我们的发现为开发更好的智能体微调方法和低资源数据使用技术提供了指导。

英文摘要:

Large language models (LLMs) have achieved success in acting as agents, which interact with environments through tools such as search engines. However, LLMs are optimized for language generation instead of tool use during training or alignment, limiting their effectiveness as agents. To resolve this problem, previous work has first collected interaction trajectories between LLMs and environments, using only trajectories that successfully finished the task to fine-tune smaller models, making fine-tuning data scarce and acquiring it both difficult and costly. Discarding failed trajectories also leads to significant wastage of data and resources and limits the possible optimization paths during fine-tuning. In this paper, we argue that unsuccessful trajectories offer valuable insights, and LLMs can learn from these trajectories through appropriate quality control and fine-tuning strategies. By simply adding a prefix or suffix that tells the model whether to generate a successful trajectory during training, we improve model performance by a large margin on mathematical reasoning, multi-hop question answering, and strategic question answering tasks. We further analyze the inference results and find that our method provides a better trade-off between valuable information and errors in unsuccessful trajectories. To our knowledge, we are the first to demonstrate the value of negative trajectories and their application in agent-tunning scenarios. Our findings offer guidance for developing better agent-tuning methods and low-resource data usage techniques.

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

↑