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.
翻译:本文旨在高效地使大型语言模型(LLMs)能够使用多模态工具。先进的专有LLMs,如ChatGPT和GPT-4,通过复杂的提示工程展现了巨大的工具使用潜力。然而,这些模型通常依赖于高昂的计算成本和无法公开获取的数据。为了解决这些挑战,我们提出了基于自我指导的GPT4Tools,使开源LLMs(如LLaMA和OPT)能够使用工具。该方法通过向高级教师模型提供多种多模态上下文提示,生成一个指令遵循数据集。利用低秩适配(LoRA)优化,我们的方法使开源LLMs能够解决一系列视觉问题,包括视觉理解与图像生成。此外,我们提供了一个基准测试,用于评估LLMs使用工具的能力,该测试以零样本和微调两种方式进行。大量实验证明了我们的方法在各种语言模型上的有效性,不仅显著提高了调用已见工具的准确性,还使模型具备了对未见工具的零样本能力。代码和演示可在https://github.com/StevenGrove/GPT4Tools获取。