AgentBank: Towards Generalized LLM Agents via Fine-Tuning on 50000+ Interaction Trajectories

Yifan Song, Weimin Xiong, Xiutian Zhao, Dawei Zhu, Wenhao Wu, Ke Wang, Cheng Li, Wei Peng, Sujian Li

TL;DR

Open-source large language models (LLMs) often struggle to act as autonomous agents due to a lack of large-scale, unbiased interaction data. This paper introduces AgentBank, a massive dataset of over 50,000 high-quality agent trajectories across 16 diverse tasks, and uses it to train Samoyed, a suite of open-source models that significantly outperform existing baselines and demonstrate true generalization to completely unseen agent environments.

What Problem Does This Paper Address?

Building LLM-based autonomous agents that can perceive an environment, reason, and take sequential actions (e.g., browsing the web, writing code, or navigating virtual rooms) is a major frontier in AI. While proprietary models like GPT-4 excel at these tasks, open-source alternatives lag far behind.

To bridge this gap, researchers use "trajectory tuning"—fine-tuning open-source models on step-by-step interaction histories generated by a stronger "teacher" model. However, existing trajectory datasets suffer from two major flaws:

  1. Scale: They are small, typically containing fewer than 2,000 trajectories.
  2. Difficulty Bias: To ensure data quality, previous pipelines discarded trajectories where the teacher model failed. This filters out hard problems, creating a skewed training distribution of overly simplistic tasks. When the fine-tuned model encounters realistic, complex scenarios, its performance collapses.

Methods

The authors developed a highly scalable annotation pipeline that decouples action generation from rationale generation, effectively eliminating difficulty bias.

Figure 1: Overview of the construction process of AGENTBANK and the training procedure of SAMOYED
  • Answer Forcing: For tasks with continuous action spaces (like generating SQL queries or code), if GPT-4 fails to solve a task, the authors don't throw the data away. Instead, they prompt GPT-4 with the failed trajectory plus the ground-truth final answer to force it to find a valid path. The resulting trajectory is then verified in a live environment.
  • Heuristic Action Search: For discrete environments (like embodied AI frameworks), they bypass LLMs entirely for action generation, using depth-first search (DFS) on the environment's code to find mathematically optimal action sequences.
  • Rationale Annotation: Once the "gold" action paths are secured, they use the more affordable GPT-3.5-Turbo to generate step-by-step Chain-of-Thought (CoT) rationales explaining why each action was taken.
  • Hybrid Mixture Training: To prevent the models from forgetting general language and coding skills (catastrophic forgetting), they train their Samoyed models on a blend of 80% AgentBank trajectory data, 10% general instruction data (ShareGPT), and 10% code data (Evol-CodeAlpaca).

Datasets

The authors curated AgentBank, compiling 51,287 trajectories across 16 tasks spanning 5 core skill dimensions:

  • Reasoning: HotpotQA, StrategyQA, TriviaQA
  • Math: GSM8K, MathQA, MATH
  • Programming: IC-SQL, APPS, HumanEval, MBPP
  • Web Navigation: Mind2Web, WebArena, WebShop
  • Embodied AI: ALFWorld, RoomR, IQA

To rigorously test generalization, they evaluated the models on 5 completely unseen held-out tasks: Bamboogle (Reasoning), TheoremQA (Math), IC-Bash (Programming), MiniWoB++ (Web), and ScienceWorld (Embodied AI).

Key Insights and Ideas

  • The Critical Role of CoT for Generalization: An ablation study revealed that training an agent without Chain-of-Thought rationales barely impacts its performance on tasks it has already seen (held-in). However, on completely new tasks (held-out), performance drops drastically. CoT teaches the model underlying planning principles rather than surface-level formatting.
  • The SFT Scaling Law Plateau: Performance scales robustly with both the number of tasks and the volume of trajectories. However, the authors observed a clear plateauing effect around 30k–50k trajectories, implying that simple supervised fine-tuning (SFT) has an upper limit, and future breakthroughs will require reinforcement learning.
Figure 3: Scaling trends of the number of tasks and interaction trajectories.
  • Cross-Skill Transferability: Fine-tuning on programming and web tasks significantly boosts performance in other domains. Conversely, Embodied AI tasks are highly isolated; training on other skills does not help them, and training on Embodied AI can actually hurt performance in other dimensions.

Key Results

  • Outperforming GPT-3.5: On held-in tasks, Samoyed-13B achieved an average score of 50.1, comfortably beating GPT-3.5-Turbo (40.2).
  • Massive Generalization Gains: On completely unseen held-out tasks, base Llama-2-7B-Chat scored a meager 5.5. After tuning on AgentBank, Samoyed-7B surged to 29.5, outperforming specialized agent models like AgentLM-7B (21.9) and Agent-FLAN-7B (23.7). Samoyed-13B reached an average score of 35.5 on these unseen tasks.

Limitations and Future Work

  • Model Scale Constraints: Due to compute limitations, the authors only experimented with 7B and 13B parameter models. The impact of AgentBank on 70B+ models remains untested.
  • Lack of Advanced Agent Frameworks: The trajectories are strictly single-agent, ReAct-style paths. The authors did not explore integrating advanced cognitive architectures like Reflexion (self-reflection loops) or ReWOO (decoupled planning).
  • SFT vs. RL: The study focuses entirely on imitation learning via SFT. Combining this dataset with exploration-based reinforcement learning (RL) is left for future work.

Summary updated

Abstract

Fine-tuning on agent-environment interaction trajectory data holds significant promise for surfacing generalized agent capabilities in open-source large language models (LLMs). In this work, we introduce AgentBank, by far the largest trajectory tuning data collection featuring more than 50k diverse high-quality interaction trajectories which comprises 16 tasks covering five distinct agent skill dimensions. Leveraging a novel annotation pipeline, we are able to scale the annotated trajectories and generate a trajectory dataset with minimized difficulty bias. Furthermore, we fine-tune LLMs on AgentBank to get a series of agent models, Samoyed. Our comparative experiments demonstrate the effectiveness of scaling the interaction trajectory data to acquire generalized agent capabilities. Additional studies also reveal some key observations regarding trajectory tuning and agent skill generalization.
BibTeX
@inproceedings{song2024agentbank,
  author = {Yifan Song and Weimin Xiong and Xiutian Zhao and Dawei Zhu and Wenhao Wu and Ke Wang and Cheng Li and Wei Peng and Sujian Li},
  title = {{AgentBank: Towards Generalized LLM Agents via Fine-Tuning on 50000+ Interaction Trajectories}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.116},
}
Figure