Skip to main content
QUICK REVIEW

[论文解读] GPT4Tools: Teaching Large Language Model to Use Tools via Self-instruction

Rui Yang, Song Lin|arXiv (Cornell University)|May 30, 2023
Topic ModelingComputer Science被引用 33
一句话总结

GPT4Tools 通过自我指令,使开源大模型能够使用多模态工具,借助教师模型创建指令数据和 LoRA 基于微调,提升工具使用并实现对未见工具的泛化。

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.

研究动机与目标

  • 促成开源大语言模型在不依赖专有模型的情况下使用多模态工具的能力。
  • 从强大教师处创建多样化、以图像为条件的指令数据集来教授工具使用。
  • 使用 LoRA 对轻量级 LLM 进行微调,使其能够在视觉任务中调用工具。
  • 引入一个评估基准,以评估工具使用的准确性,包括未见工具。
  • 展示在工具调用成功率和泛化方面显著优于基线的改进。

提出的方法

  • 通过一个高级教师(如 ChatGPT)在视觉内容和工具描述条件下,生成与工具相关的指令数据。
  • 构建一个带有图像条件与非条件提示的指令输出数据集,以多样化数据。
  • 用负样本和上下文样本扩增数据,教会模型何时不使用工具并支持多轮推理。
  • 使用低秩适配(LoRA)对开源 LLM(如 Vicuna-13B、LLaMA-13B、OPT-13B)进行微调,以实现工具使用。
  • 使用人为标注的基准进行工具使用评估,测量思想、工具和论证的准确性(SR_t、SR_act、SR_args、SR)。
  • 比较有无 GPT4Tools 的模型在零样本和未见工具泛化方面的表现。

实验结果

研究问题

  • RQ1来自高级教师生成的指令数据是否能让开源 LLMs 可靠地使用多模态工具?
  • RQ2图像条件数据如何影响 LLMs 的工具使用指令的多样性与质量?
  • RQ3在 GPT4Tools 训练后,经过 LoRA 微调的开源 LLM 到何种程度可以调用已知和未见的工具?
  • RQ4包含负样本和上下文样本是否能改善工具使用的辨识与多轮推理?
  • RQ5在 GPT4Tools 微调后,不同开源 LLM(Vicuna、LLaMA、OPT)在工具调用任务上的相对性能如何?

主要发现

  • GPT4Tools 显著提升工具调用能力;例如 OPT-13B 在微调后验证集的 SR 从 0.0 提升到 93.2%。
  • Vicuna-13B 在验证集达到 94.1% 的 SR,在未见工具上达到 90.6% 的 SR,接近 GPT-3.5 在未见工具上的表现。
  • LLaMA-13B 从 3.2% 提升至 66.4% 的验证集 SR,在未见工具上也显示显著提升。
  • 微调模型对未见工具具有强大的零样本能力,Vicuna-13B 在未见工具达到 90.6% 的 SR,LLaMA-13B 比基线模型高出 67.9 个百分点。
  • 包含图像条件提示、上下文样本和负样本可获得更高的 SR_t、SR_act、SR_args 与 SR(如总体 94.1%)。
  • 7B 的 Vicuna 模型在 GPT4Tools 之后也能实现较高的工具调用准确性,显示出数据效率与可扩展性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。