Recent research shows the potential of enhancing the problem-solving ability of large language models (LLMs) through the use of external tools. However, prior work along this line depends on the availability of existing tools. In this work, we take an initial step towards removing this dependency by proposing a closed-loop framework, referred to as LLMs As Tool Makers (LATM), where LLMs create their own reusable tools for problem-solving. Our approach consists of two key phases: 1) tool making: an LLM acts as the tool maker that crafts tools for given tasks, where a tool is implemented as a Python utility function. 2) tool using: an LLM acts as the tool user, which applies the tool built by the tool maker for problem-solving. The tool user can be either the same or a different LLM from the tool maker. Tool-making enables an LLM to continually generate tools that can be applied to different requests so that future requests can call the corresponding APIs when beneficial for solving the tasks. Furthermore, the division of labor among LLMs for tool-making and tool-using phases introduces the opportunity to achieve cost effectiveness without degrading the quality of generated tools and problem solutions. For example, recognizing that tool-making demands more sophisticated capabilities than tool-using, we can apply a powerful yet resource-intensive model as the tool maker, and a lightweight while cost-effective model as the tool user. We validate the effectiveness of our approach across a variety of complex reasoning tasks, including Big-Bench tasks. With GPT-4 as the tool maker and GPT-3.5 as the tool user, LATM can achieve performance that is on par with using GPT-4 for both tool making and tool using, while the inference cost is significantly reduced.
翻译:近期研究表明,通过使用外部工具可以增强大型语言模型(LLMs)的问题解决能力。然而,现有相关工作依赖于已有工具的可用性。本研究通过提出一种闭环框架——即"大型语言模型作为工具制造者"(LATM),迈出了消除这一依赖性的初步探索。该方法包含两个关键阶段:1)工具制造:LLM作为工具制造者,为给定任务定制工具(以Python工具函数形式实现);2)工具使用:LLM作为工具使用者,应用制造者构建的工具解决问题。工具使用者可与工具制造者采用相同或不同模型。工具制造使LLM能够持续生成可应用于不同请求的工具,使未来请求在有益于任务解决时可直接调用对应API。此外,将工具制造与工具使用的阶段进行模型分工,可在不降低生成工具质量和问题解决方案效果的前提下实现成本效益。例如,考虑到工具制造比工具使用需要更强的能力,我们可以应用功能强大但资源消耗大的模型作为工具制造者,而采用轻量级且成本效益高的模型作为工具使用者。我们在包括Big-Bench任务在内的多种复杂推理任务中验证了该方法的有效性。当使用GPT-4作为工具制造者、GPT-3.5作为工具使用者时,LATM的性能可与两者均使用GPT-4的方案相当,而推理成本显著降低。