Agent-FLAN:为大型语言模型设计数据和方法以有效调整代理器
Agent-FLAN: Designing Data and Methods of Effective Agent Tuning for Large Language Models
March 19, 2024
作者: Zehui Chen, Kuikun Liu, Qiuchen Wang, Wenwei Zhang, Jiangning Liu, Dahua Lin, Kai Chen, Feng Zhao
cs.AI
摘要
开源的大型语言模型(LLMs)在各种自然语言处理任务中取得了巨大成功,然而,当充当代理时,它们仍远不及基于API的模型。如何将代理能力整合到通用LLMs中成为一个关键且紧迫的问题。本文首先提出了三个关键观察结果:(1)当前的代理训练语料库既包含遵循格式又包含代理推理,这与其预训练数据的分布显著不同;(2)LLMs在代理任务所需能力上表现出不同的学习速度;以及(3)目前的方法在通过引入幻觉来提高代理能力时存在副作用。基于上述发现,我们提出了Agent-FLAN,以有效地为代理Fine-tune语言模型。通过对训练语料库进行仔细的分解和重新设计,Agent-FLAN使得Llama2-7B在各种代理评估数据集上比之前的最佳成果提高了3.5\%。通过全面构建负样本,Agent-FLAN极大地减轻了基于我们建立的评估基准的幻觉问题。此外,它在扩展模型规模时始终提高了LLMs的代理能力,同时略微增强了LLMs的通用能力。代码将在https://github.com/InternLM/Agent-FLAN上提供。
English
Open-sourced Large Language Models (LLMs) have achieved great success in
various NLP tasks, however, they are still far inferior to API-based models
when acting as agents. How to integrate agent ability into general LLMs becomes
a crucial and urgent problem. This paper first delivers three key observations:
(1) the current agent training corpus is entangled with both formats following
and agent reasoning, which significantly shifts from the distribution of its
pre-training data; (2) LLMs exhibit different learning speeds on the
capabilities required by agent tasks; and (3) current approaches have
side-effects when improving agent abilities by introducing hallucinations.
Based on the above findings, we propose Agent-FLAN to effectively Fine-tune
LANguage models for Agents. Through careful decomposition and redesign of the
training corpus, Agent-FLAN enables Llama2-7B to outperform prior best works by
3.5\% across various agent evaluation datasets. With comprehensively
constructed negative samples, Agent-FLAN greatly alleviates the hallucination
issues based on our established evaluation benchmark. Besides, it consistently
improves the agent capability of LLMs when scaling model sizes while slightly
enhancing the general capability of LLMs. The code will be available at
https://github.com/InternLM/Agent-FLAN.