ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Cases

Qiaoyu Tang, Ziliang Deng, Hongyu Lin, Xianpei Han, Qiao Liang +2 more
6/8/2023
cs.CL

No official code found. Best implementation: tangqiaoyu/ToolAlpaca (881 stars, Apache-2.0, last commit 2024-10-26).

Abstract

Enabling large language models to utilize real-world tools effectively is crucial for achieving embodied intelligence. Existing approaches to tool learning have either primarily relied on extremely large language models, such as GPT-4, to attain generalized tool-use abilities in a zero-shot manner, or utilized supervised learning to train limited scopes of tools on compact models. However, it remains uncertain whether smaller language models can achieve generalized tool-use abilities without tool-specific training. To address this question, this paper introduces ToolAlpaca, a novel framework designed to automatically generate a diverse tool-use corpus and learn generalized tool-use abilities on compact language models with minimal human intervention. Specifically, ToolAlpaca first automatically creates a highly diversified tool-use corpus by building a multi-agent simulation environment. The corpus contains 3938 tool-use instances from more than 400 real-world tool APIs spanning 50 distinct categories. Subsequently, the constructed corpus is employed to fine-tune compact language models, resulting in two models, namely ToolAlpaca-7B and ToolAlpaca-13B, respectively. Finally, we evaluate the ability of these models to utilize previously unseen tools without specific training. Experimental results demonstrate that ToolAlpaca achieves effective generalized tool-use capabilities comparable to those of extremely large language models like GPT-3.5, demonstrating that learning generalized tool-use ability is feasible for compact language models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

the official code for "ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Cases"

88137PythonJun 14, 20231 years agoApache-2.0

Cite this paper

@article{tang2023toolalpaca,
  title  = {ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Cases},
  author = {Qiaoyu Tang and Ziliang Deng and Hongyu Lin and Xianpei Han and Qiao Liang and Boxi Cao and Le Sun},
  year   = {2023},
  eprint = {2306.05301},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.05301v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.05301.svg)](https://codeofpaper.com/paper/2306.05301)

Discussion