Skip to main content
QUICK REVIEW

[Paper Review] GPT4Tools: Teaching Large Language Model to Use Tools via Self-instruction

Rui Yang, Song Lin|arXiv (Cornell University)|May 30, 2023
Topic ModelingComputer Science33 citations
TL;DR

GPT4Tools enables open-source LLMs to use multimodal tools through self-instruction by leveraging a teacher model to create instruction data and LoRA-based fine-tuning, boosting tool usage and enabling generalization to unseen tools.

ABSTRACT

This paper aims to efficiently enable Large Language Models (LLMs) to use multimodal tools. Advanced proprietary LLMs, such as ChatGPT and GPT-4, have shown great potential for tool usage through sophisticated prompt engineering. Nevertheless, these models typically rely on prohibitive computational costs and publicly inaccessible data. To address these challenges, we propose the GPT4Tools based on self-instruct to enable open-source LLMs, such as LLaMA and OPT, to use tools. It generates an instruction-following dataset by prompting an advanced teacher with various multi-modal contexts. By using the Low-Rank Adaptation (LoRA) optimization, our approach facilitates the open-source LLMs to solve a range of visual problems, including visual comprehension and image generation. Moreover, we provide a benchmark to evaluate the ability of LLMs to use tools, which is performed in both zero-shot and fine-tuning ways. Extensive experiments demonstrate the effectiveness of our method on various language models, which not only significantly improves the accuracy of invoking seen tools, but also enables the zero-shot capacity for unseen tools. The code and demo are available at https://github.com/StevenGrove/GPT4Tools.

Motivation & Objective

  • Motivate making open-source LLMs capable of using multimodal tools without relying on proprietary models.
  • Create a diversified, image-conditioned instruction dataset from a powerful teacher to teach tool usage.
  • Fine-tune lightweight LLMs with LoRA to enable tool invocation across visual tasks.
  • Introduce an evaluation benchmark to assess tool-usage accuracy, including unseen tools.
  • Demonstrate substantial improvements over baselines in tool invocation success and generalization.

Proposed method

  • Generate tool-related instruction data by prompting an advanced teacher (e.g., ChatGPT) conditioned on visual content and tool descriptions.
  • Construct an instruction-output dataset with image-conditioned and image-unconditioned prompts to diversify data.
  • Augment data with negative and contextual samples to teach when not to use tools and to support multi-turn reasoning.
  • Fine-tune open-source LLMs (e.g., Vicuna-13B, LLaMA-13B, OPT-13B) using Low-Rank Adaptation (LoRA) to enable tool usage.
  • Evaluate tool-usage with a human-annotated benchmark measuring Thought, Tool, and Argument accuracy (SR_t, SR_act, SR_args, SR).
  • Compare performance across models with and without GPT4Tools to assess zero-shot and unseen-tool generalization.

Experimental results

Research questions

  • RQ1Can instruction data generated from an advanced teacher enable open-source LLMs to reliably use multimodal tools?
  • RQ2How does image-conditioned data affect the diversity and quality of tool-use instructions for LLMs?
  • RQ3To what extent can LoRA-tuned open-source LLMs invoke seen and unseen tools after GPT4Tools training?
  • RQ4Does including negative and contextual samples improve tool-use discernment and multi-turn reasoning?
  • RQ5What is the comparative performance of various open-source LLMs (Vicuna, LLaMA, OPT) on tool invocation tasks after GPT4Tools fine-tuning?

Key findings

  • GPT4Tools substantially improves tool invocation; e.g., OPT-13B rises from SR 0.0 to 93.2% SR on validation after fine-tuning.
  • Vicuna-13B improves to SR 94.1% on validation and 90.6% SR on unseen tools, approaching GPT-3.5 performance on unseen tools.
  • LLaMA-13B improves from 3.2% to 66.4% SR on validation and shows notable gains on unseen tools.
  • Fine-tuned models demonstrate strong zero-shot capacity for unseen tools, with Vicuna-13B reaching 90.6% SR on unseen tools and LLaMA-13B showing 67.9% margin over the base model.
  • Inclusion of image-conditioned prompts, context samples, and negative samples yields higher SRt, SRact, SRargs, and SR (e.g., 94.1% overall).
  • A 7B Vicuna model can achieve high tool-invocation accuracy after GPT4Tools, demonstrating data efficiency and scalability.

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.