ChatPaper.aiChatPaper

Крупные языковые модели как создатели инструментов

Large Language Models as Tool Makers

May 26, 2023
Авторы: Tianle Cai, Xuezhi Wang, Tengyu Ma, Xinyun Chen, Denny Zhou
cs.AI

Аннотация

Последние исследования демонстрируют потенциал улучшения способности крупных языковых моделей (LLM) решать задачи за счет использования внешних инструментов. Однако предыдущие работы в этом направлении зависят от наличия существующих инструментов. В данной работе мы делаем первый шаг к устранению этой зависимости, предлагая замкнутую структуру, называемую LLM как создатели инструментов (LATM), где LLM самостоятельно создают повторно используемые инструменты для решения задач. Наш подход состоит из двух ключевых этапов: 1) создание инструментов: LLM выступает в роли создателя инструментов, разрабатывая их для конкретных задач, где инструмент реализуется как утилитарная функция на Python. 2) использование инструментов: LLM выступает в роли пользователя инструментов, применяя инструмент, созданный разработчиком, для решения задач. Пользователь инструментов может быть как той же самой, так и другой LLM по сравнению с создателем инструментов. Создание инструментов позволяет LLM непрерывно генерировать инструменты, которые могут применяться к различным запросам, так что будущие запросы могут вызывать соответствующие API, когда это полезно для решения задач. Кроме того, разделение труда между LLM на этапах создания и использования инструментов открывает возможность достижения экономической эффективности без ухудшения качества создаваемых инструментов и решений задач. Например, учитывая, что создание инструментов требует более сложных возможностей, чем их использование, мы можем применять мощную, но ресурсоемкую модель в качестве создателя инструментов и легковесную, но экономически эффективную модель в качестве пользователя инструментов. Мы подтверждаем эффективность нашего подхода на множестве сложных задач на рассуждение, включая задачи из Big-Bench. С использованием GPT-4 в качестве создателя инструментов и GPT-3.5 в качестве пользователя инструментов, LATM может достичь производительности, сопоставимой с использованием GPT-4 для обоих этапов, при этом значительно снижая затраты на вывод.
English
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.
PDF31December 15, 2024