On this page
AgentTuning is work I co-authored on teaching language models to act as agents through instruction tuning. The training examples record an interaction: receiving an instruction, taking an action, observing the result, and choosing the next step.
The work has two main parts: the AgentInstruct dataset and mixed instruction tuning. AgentInstruct supplies filtered interaction trajectories. Training combines them with general conversation data to produce the AgentLM model family.
Paper · Code · AgentInstruct dataset · 中文版
AgentInstruct data
AgentInstruct contains 1,866 interaction trajectories across six task families: operating systems, databases, knowledge graphs, ALFWorld, WebShop, and Mind2Web. They involve actions such as running commands, querying information, interacting with an environment, and navigating web pages.
A trajectory records one attempt at a task. The model chooses an action from the information available, receives feedback from the environment, and continues. This exposes the relationship between an action, its observed result, and the next decision.
Data construction has three stages: prepare an instruction, let GPT-4 interact with the task environment, and filter the resulting trajectory according to its reward. The records also include reasoning for the actions. The dataset and construction process are described in Section 2 of the paper.
Mixed instruction tuning
Agent trajectories concentrate on a particular kind of behavior. When training on them, we also want to preserve the model's general language capabilities.
AgentTuning mixes AgentInstruct with ShareGPT conversation data and instruction-tunes Llama 2 Chat models to produce AgentLM. The model learns from demonstrations through supervised training. Task rewards are used to filter the collected trajectories; the instruction-tuning stage itself is supervised.
To understand or reproduce the setup, read the agent data, general conversation data, sampling ratios, and conversation format together. Training on only part of these inputs is a different experiment.
Evaluation on new tasks
Evaluation covers three groups: tasks represented in the training data, tasks held out from training, and general language tasks. There are six held-in and six held-out task families. The environments and their implementation entry points are listed in the repository's evaluation guide.
Held-out tasks matter because the aim is to learn how to handle interactions and feedback beyond the demonstrations. General language evaluations check how the trained model performs on other kinds of questions.
The repository notes that AgentBench continues to evolve. Its
supplied AgentBench.old version is the relevant starting
point for reproducing the paper's held-in evaluations. Model
checkpoints, prompt formats, and environment versions should be checked
against the experiment being reproduced.
Models, data, and code
- AgentInstruct: task instructions and interaction trajectories.
- AgentLM checkpoints: 7B, 13B, and 70B. Use the conversation format and system prompt documented in the repository.
- Code and evaluation guide: model serving, task environments, and general language evaluations.
I am Rui Lu (鲁睿), a co-first author of AgentTuning and a Ph.D. student at Tsinghua University's KEG Lab. For related work, see DeepDive on multi-turn reinforcement learning for search, TreeRL on tree search during training, and my research page.