Skip to main content
QUICK REVIEW

[论文解读] Large Language Models as Tool Makers

Tianle Cai, Xuezhi Wang|arXiv (Cornell University)|May 26, 2023
Topic ModelingComputer Science被引用 19
一句话总结

LATM 使大型语言模型(LLMs)先在强大模型的支持下创建可重用的 Python 工具(工具制作),再用更便宜的模型来使用这些工具解决任务,取得与较高成本模型相近的性能,同时降低成本。它还引入一个用于流式任务处理的调度器(分发器)。

ABSTRACT

Recent research has highlighted the potential of large language models (LLMs) to improve their problem-solving capabilities with the aid of suitable external tools. In our work, we further advance this concept by introducing a closed-loop framework, referred to as LLMs A s Tool Makers (LATM), where LLMs create their own reusable tools for problem-solving. Our approach consists of two phases: 1) tool making: an LLM acts as the tool maker that crafts tools for a set of tasks. 2) tool using: another LLM acts as the tool user, which applies the tool built by the tool maker for problem-solving. On the problem-solving server side, tool-making enables continual tool generation and caching as new requests emerge. This framework enables subsequent requests to access cached tools via their corresponding APIs, enhancing the efficiency of task resolution. Recognizing that tool-making requires more sophisticated capabilities, we assign this task to a powerful, albeit resource-intensive, model. Conversely, the simpler tool-using phase is delegated to a lightweight model. This strategic division of labor allows the once-off cost of tool-making to be spread over multiple instances of tool-using, significantly reducing average costs while maintaining strong performance. Furthermore, our method offers a functional cache through the caching and reuse of tools, which stores the functionality of a class of requests instead of the natural language responses from LLMs, thus extending the applicability of the conventional cache mechanism. We evaluate our approach across various complex reasoning tasks, including Big-Bench tasks. With GPT-4 as the tool maker and GPT-3.5 as the tool user, LATM demonstrates performance equivalent to using GPT-4 for both roles, but with a significantly reduced inference cost.

研究动机与目标

  • 通过使 LLM 能够生成自己的一套可重用工具来实现多样化任务,推动减少对现有工具的依赖。
  • 提出一个闭环的 LATM 架构,包括工具制作器(tool-maker)和工具使用者(tool-user),以及用于流式数据的调度器。
  • 证明通过工具制作得到的功能可以跨实例重复使用,从而提高效率和成本效益。
  • 证明高容量的工具制作器(如 GPT-4)能够生成工具,使轻量级的工具使用者(如 GPT-3.5 Turbo)在成本更低的情况下达到甚至超过性能。

提出的方法

  • 两阶段 LATM 流水线:工具制作(生成 Python 函数工具)和工具使用(将工具应用于任务)。
  • 工具制作使用强大模型从示例(通过实例编程)提出、验证并封装通用的 Python 工具。
  • 工具验证创建单元测试以验证工具;失败时触发重试与纠正。
  • 工具使用采用更轻量的模型,通过上下文中的函数调用和可选的后处理来应用封装好的工具。
  • 调度器通过将流数据路由到现有工具或为未见任务触发新工具的创建来处理流式数据。
Figure 1: The closed-loop framework of LATM . In situations with numerous problem-solving requests, directly utilizing a powerful LLM to solve all the instances can result in high costs. On the other hand, lightweight models are cost-effective but usually struggle with complex tasks. LATM leverages
Figure 1: The closed-loop framework of LATM . In situations with numerous problem-solving requests, directly utilizing a powerful LLM to solve all the instances can result in high costs. On the other hand, lightweight models are cost-effective but usually struggle with complex tasks. LATM leverages

实验结果

研究问题

  • RQ1LLMs 是否能够生成通用、可重用的工具函数来解决超出它们在训练中所示例的新的任务?
  • RQ2将工具制作(高容量)与工具使用(低成本)分离是否在降低运行成本的同时维持或改善性能?
  • RQ3调度器是否能够通过重用工具或为未见任务启动工具制作来有效管理流式任务到达?
  • RQ4工具在多大程度上提高轻量级模型在复杂推理任务上的性能?
  • RQ5在不同任务中,工具制作模型与工具使用模型的容量需求和成本影响是多少?

主要发现

  • 一个高容量的工具制作器(GPT-4)可以为各种任务生成可重用的 Python 工具,供较轻量的工具使用者(GPT-3.5 Turbo 或 GPT-4)应用。
  • LATM 使用 GPT-4 制作并由 GPT-3.5 Turbo 使用的方案,在性能上与两阶段都使用 GPT-4 相当,同时降低推理成本。
  • LatM 相较于链式思维提示,在若干 Big-Bench 风格任务上显著提升,尤其是在使用轻量工具使用者以实现成本效率时。
  • 调度器在流式设置中实现随时创建与使用工具,且在工具识别和新任务触发方面具有高准确性。
  • 容量分析表明:对更难任务,工具制作受益于更强的模型,而使用 GPT-3.5 Turbo 的工具使用在成本与性能之间提供更有利的权衡。
Figure 2: The pipeline of LATM . LATM can be divided into two stages: 1) tool making: a powerful yet more expensive model serves as the tool maker to generate generic and reusable tools from a few demonstrations; 2) tool using: a lightweight and cheaper model serves as the tool user to use the tool
Figure 2: The pipeline of LATM . LATM can be divided into two stages: 1) tool making: a powerful yet more expensive model serves as the tool maker to generate generic and reusable tools from a few demonstrations; 2) tool using: a lightweight and cheaper model serves as the tool user to use the tool

阅读本论文

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

在 Nubint 中阅读本论文

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