I Modelli Linguistici di Grandi Dimensioni come Creatori di Strumenti
Large Language Models as Tool Makers
May 26, 2023
Autori: Tianle Cai, Xuezhi Wang, Tengyu Ma, Xinyun Chen, Denny Zhou
cs.AI
Abstract
Ricerche recenti dimostrano il potenziale di migliorare la capacità di risoluzione dei problemi dei grandi modelli linguistici (LLM) attraverso l'uso di strumenti esterni. Tuttavia, i lavori precedenti in questo ambito dipendono dalla disponibilità di strumenti esistenti. In questo lavoro, compiamo un primo passo verso l'eliminazione di questa dipendenza proponendo un framework a ciclo chiuso, denominato LLMs As Tool Makers (LATM), in cui gli LLM creano i propri strumenti riutilizzabili per la risoluzione dei problemi. Il nostro approccio si compone di due fasi chiave: 1) creazione degli strumenti: un LLM agisce come creatore di strumenti che progetta strumenti per compiti specifici, dove uno strumento è implementato come una funzione di utilità in Python. 2) utilizzo degli strumenti: un LLM agisce come utilizzatore di strumenti, applicando lo strumento costruito dal creatore per risolvere i problemi. L'utilizzatore di strumenti può essere lo stesso LLM o un LLM diverso rispetto al creatore. La creazione di strumenti consente a un LLM di generare continuamente strumenti che possono essere applicati a diverse richieste, in modo che le richieste future possano chiamare le API corrispondenti quando ciò è vantaggioso per la risoluzione dei compiti. Inoltre, la divisione del lavoro tra LLM per le fasi di creazione e utilizzo degli strumenti introduce l'opportunità di ottenere un rapporto costo-efficacia senza compromettere la qualità degli strumenti generati e delle soluzioni ai problemi. Ad esempio, riconoscendo che la creazione di strumenti richiede capacità più sofisticate rispetto al loro utilizzo, possiamo applicare un modello potente ma ad alto consumo di risorse come creatore di strumenti, e un modello leggero e conveniente come utilizzatore. Validiamo l'efficacia del nostro approccio su una varietà di compiti di ragionamento complesso, inclusi i task di Big-Bench. Con GPT-4 come creatore di strumenti e GPT-3.5 come utilizzatore, LATM può ottenere prestazioni paragonabili all'uso di GPT-4 sia per la creazione che per l'utilizzo degli strumenti, mentre il costo di inferenza è significativamente ridotto.
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.