Agent-FLAN

Agent-FLAN redesigns fine-tuning data so that open models can learn agentic skills without sacrificing general capability, hitting new open-source SoTA for Llama2-7B-based agents.
Ask this paper
Format vs reasoning split: The training corpus separates "format following" (producing valid tool/JSON syntax) from "agent reasoning" so each skill can be learned at its own rate and against pre-training distribution.
Negative sampling: Carefully constructed negative examples teach the model when *not* to call a tool, directly targeting hallucinated or spurious actions.
Llama2-7B gains: Agent-FLAN beats prior best open agent fine-tunes by 3.5% averaged across agent evaluation datasets, while preserving general LLM capability.
Scales cleanly: The recipe's improvements hold up as the base model grows, making it a reusable template for future open-source agent fine-tunes.
Abstract
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.