FireAct
https://github.com/anchen1011/FireAct
📊 Stats
⭐ Stars: 292
📝 Language: Python
📝 Description: FireAct: Toward Language Agent Fine-tuning
⭐ Star Growth (12 months)
🔬 Research Notes
Stats
Description
FireAct: Toward Language Agent Fine-tuning
Topics
agent, fine-tuning, large-language-models, llm, reasoning
Research Summary
Key Features
Architecture
Use Cases
Assessment
README Excerpt
```
# FireAct: Toward Language Agent Fine-tuning

This repository is based on our publication *FireAct: Toward Language Agent Fine-tuning* ([PDF](https://browse.arxiv.org/pdf/2310.05915.pdf)). It contains prompts, demo code and fine-tuning data we generated. It also includes the description and directory for the model family we fine-tuned. If you use this code or data in your work, please cite:
```
@misc{chen2023fireact,
title={FireAct: Toward Language Agent Fine-tuning},
author={Baian Chen and Chang Shu and Ehsan Shareghi and Nigel Collier and Karthik Narasimhan and Shunyu Yao},
year={2023},
eprint={2310.05915},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
```
Overview
tools/tasks/generation.py trajs/Data & Prompts
data/. We also include samples of training data for both Alpaca format and GPT format. See details [here](https://github.com/anchen1011/FireAct/tree/main/data).prompts/Setup
Set up OpenAI API key and store in environment variable (see [here](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety))
```
export OPENAI_API_KEY=
```
Set up SERP API key and store in environment variable (see [here](https://serpapi.com))
```
export SERPAPI_API_KEY=
```
Create virtual env, for example with conda
```
conda create -n fireact python=3.9
conda activate fireact
```
Clone this repo and install dependencies
```
git clone https://github.com/anchen1011/FireAct.git
pip install -r requirements.txt
```
Run Demo
Data Generation
Example:
```
python generation.py \
--task hotpotqa \
--backend gpt-4 \
--promptpath default \
--evaluate \
--random \
--task_split val \
--temperature 0 \
--task_end_index 5
```
See details with command python generation.py -h
You need to set a high number (thousands) of --task_end_index to get sufficient good data samples. [WARNING] This is costly with gpt-4 and serpapi.
You need to convert trajectories into [alpaca format](https://github.com/tatsu-lab/stanford_alpaca#data-release) or [gpt format](https://platform.openai.com/docs/guides/fine-tuning/preparing-your-dataset) for training. See our examples [here](https://github.com/anchen1011/FireAct/tree/main/data/finetune).
Supervised Fine-tuning
Example:
```
cd finetune/llama_lora
python finetune.py \
```
---
*Researched: 2026-03-27*