Skip to main content
QUICK REVIEW

[Paper Review] FireAct: Toward Language Agent Fine-tuning

Baian Chen, Chang Shu|arXiv (Cornell University)|Oct 9, 2023
Topic ModelingComputer Science6 citations
TL;DR

FireAct proposes a novel framework for fine-tuning language models (LMs) to improve their performance as language agents by leveraging diverse agent trajectories from multiple tasks and prompting methods. By fine-tuning LLaMA2-7B with 500 GPT-4-generated ReAct trajectories on HotpotQA, the method achieves a 77% relative increase in exact match performance, demonstrating that fine-tuning significantly enhances agent reasoning, robustness, and efficiency over few-shot prompting.

ABSTRACT

Recent efforts have augmented language models (LMs) with external tools or environments, leading to the development of language agents that can reason and act. However, most of these agents rely on few-shot prompting techniques with off-the-shelf LMs. In this paper, we investigate and argue for the overlooked direction of fine-tuning LMs to obtain language agents. Using a setup of question answering (QA) with a Google search API, we explore a variety of base LMs, prompting methods, fine-tuning data, and QA tasks, and find language agents are consistently improved after fine-tuning their backbone LMs. For example, fine-tuning Llama2-7B with 500 agent trajectories generated by GPT-4 leads to a 77% HotpotQA performance increase. Furthermore, we propose FireAct, a novel approach to fine-tuning LMs with trajectories from multiple tasks and prompting methods, and show having more diverse fine-tuning data can further improve agents. Along with other findings regarding scaling effects, robustness, generalization, efficiency and cost, our work establishes comprehensive benefits of fine-tuning LMs for agents, and provides an initial set of experimental designs, insights, as well as open questions toward language agent fine-tuning.

Motivation & Objective

  • To investigate the overlooked potential of fine-tuning language models for agentic reasoning, moving beyond few-shot prompting.
  • To evaluate the impact of diverse fine-tuning data—spanning multiple tasks and prompting methods—on agent performance and robustness.
  • To provide empirical evidence that fine-tuned smaller LMs can outperform few-shot prompted larger models in agent tasks.
  • To explore scaling effects, generalization, and cost-efficiency in language agent fine-tuning.
  • To release code, data, and models to catalyze future research in fine-tuned language agents.

Proposed method

  • FireAct collects agent trajectories using GPT-4 to solve open-domain question-answering tasks with a Google search API, using the ReAct prompting format (Thought, Action, Observation).
  • Trajectories are unified into a single format and used to fine-tune base LMs, including LLaMA2-7B and GPT-3.5, across multiple tasks and prompting strategies.
  • Fine-tuning is applied end-to-end on the language model backbone, enabling it to generate reasoning traces and actions directly without prompting.
  • The method supports multi-task and multi-prompting data mixtures to improve generalization and robustness.
  • Experiments compare few-shot prompting vs. fine-tuned inference across various base models, prompting techniques, and data scales.
  • Evaluation uses standard metrics like exact match (EM) on HotpotQA and robustness under noisy tool outputs.
Figure 1: While language agents and language model fine-tuning are both popular topics, their intersection is understudied. This work takes an initial step to show multiple advantages of fine-tuning LMs for agentic uses, and opens up various new questions toward language agent fine-tuning.
Figure 1: While language agents and language model fine-tuning are both popular topics, their intersection is understudied. This work takes an initial step to show multiple advantages of fine-tuning LMs for agentic uses, and opens up various new questions toward language agent fine-tuning.

Experimental results

Research questions

  • RQ1Does fine-tuning language models with agent trajectories lead to consistent performance gains over few-shot prompting in agentic QA tasks?
  • RQ2How does the diversity of fine-tuning data—across tasks and prompting methods—affect agent generalization and robustness?
  • RQ3Can smaller open-source LMs outperform few-shot prompted larger models like GPT-3.5 after fine-tuning?
  • RQ4What is the impact of fine-tuning data scale and model size on agent performance and inference efficiency?
  • RQ5To what extent can multi-task fine-tuning create a single versatile agent backbone for diverse applications?

Key findings

  • Fine-tuning LLaMA2-7B with 500 ReAct trajectories from GPT-4 improved HotpotQA exact match by 77% compared to few-shot prompting.
  • Fine-tuning GPT-3.5 with 500 ReAct trajectories increased HotpotQA EM from 31.4 to 39.2, a 25% relative improvement.
  • Using a mix of ReAct and Chain-of-Thought trajectories further increased EM to 41.0, a 31% relative improvement over few-shot prompting.
  • Fine-tuned models reduced inference time by 4x and showed 64% higher performance under noisy tool outputs.
  • Smaller open-source LMs like LLaMA2-7B showed greater relative gains from fine-tuning, indicating strong potential for cost-effective agent deployment.
  • Adding diverse tasks during fine-tuning did not degrade performance on downstream tasks and may support broader generalization, suggesting promise for massive multi-task fine-tuning.
Figure 2: Illustration of FireAct . (a) During fine-tuning , a large LM (e.g., GPT-4) generates task-solving trajectories based on questions from different datasets and prompts from different methods. The successful trajectories are then converted into the ReAct format to fine-tune a smaller LM. (b)
Figure 2: Illustration of FireAct . (a) During fine-tuning , a large LM (e.g., GPT-4) generates task-solving trajectories based on questions from different datasets and prompts from different methods. The successful trajectories are then converted into the ReAct format to fine-tune a smaller LM. (b)

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.