Open large language models (LLMs) with great performance in various tasks have significantly advanced the development of LLMs. However, they are far inferior to commercial models such as ChatGPT and GPT-4 when acting as agents to tackle complex tasks in the real world. These agent tasks employ LLMs as the central controller responsible for planning, memorization, and tool utilization, necessitating both fine-grained prompting methods and robust LLMs to achieve satisfactory performance. Though many prompting methods have been proposed to complete particular agent tasks, there is lack of research focusing on improving the agent capabilities of LLMs themselves without compromising their general abilities. In this work, we present AgentTuning, a simple and general method to enhance the agent abilities of LLMs while maintaining their general LLM capabilities. We construct AgentInstruct, a lightweight instruction-tuning dataset containing high-quality interaction trajectories. We employ a hybrid instruction-tuning strategy by combining AgentInstruct with open-source instructions from general domains. AgentTuning is used to instruction-tune the Llama 2 series, resulting in AgentLM. Our evaluations show that AgentTuning enables LLMs' agent capabilities without compromising general abilities. The AgentLM-70B is comparable to GPT-3.5-turbo on unseen agent tasks, demonstrating generalized agent capabilities. We open source the AgentInstruct and AgentLM-7B, 13B, and 70B models at https://github.com/THUDM/AgentTuning , serving open and powerful alternatives to commercial LLMs for agent tasks.
翻译:开源大语言模型在各类任务中表现优异,极大推动了LLM的发展。然而,在实际世界中作为智能体处理复杂任务时,它们远逊于ChatGPT和GPT-4等商业模型。这类智能体任务将LLM作为负责规划、记忆和工具利用的中央控制器,需要精细的提示方法和强大的LLM才能达到满意性能。尽管已有许多针对特定智能体任务的提示方法被提出,但如何在保持LLM通用能力的同时提升其智能体能力,尚缺乏相关研究。本文提出AgentTuning——一种简单通用的方法,能在保持LLM通用能力的同时增强其智能体能力。我们构建了AgentInstruct,一个包含高质量交互轨迹的轻量级指令微调数据集。通过将AgentInstruct与开源通用领域指令结合,我们采用混合指令微调策略。使用AgentTuning对Llama 2系列进行指令微调,得到AgentLM。实验表明,AgentTuning能在不损害通用能力的前提下赋予LLM智能体能力。AgentLM-70B在未见过的智能体任务上表现与GPT-3.5-turbo相当,展现出通用智能体能力。我们在https://github.com/THUDM/AgentTuning开源了AgentInstruct及AgentLM-7B、13B、70B模型,为智能体任务提供开源且强大的商业LLM替代方案。