ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddings

05/19/2023
by   Shibo Hao, et al.
0

Augmenting large language models (LLMs) with external tools has emerged as a promising approach to solving complex problems. However, traditional methods, which finetune LLMs with tool demonstration data, can be both costly and restricted to a predefined set of tools. Recent in-context learning paradigm alleviates these issues, but the limited context length only allows for a few shots of demonstrations, leading to suboptimal understandings of the tools. Moreover, when there are numerous tools to choose from, in-context learning could completely fail to work. In this paper, we propose an alternative approach, ToolkenGPT, which combines the benefits of both sides. Our approach represents each tool as a token (toolken) and learns an embedding for it, enabling tool calls in the same way as generating a regular word token. Once a toolken is triggered, the LLM is prompted to complete arguments for the tool to execute. ToolkenGPT offers the flexibility to plug in an arbitrary number of tools by expanding the set of toolkens on the fly. In addition, it improves tool use by allowing extensive demonstration data for learning the toolken embeddings. In diverse domains, including numerical reasoning, knowledge-based question answering, and embodied plan generation, our approach effectively augments LLMs with tools and substantially outperforms various latest baselines. ToolkenGPT demonstrates the promising ability to use relevant tools from a large tool set in complex scenarios.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/17/2023

GEAR: Augmenting Language Models with Generalizable and Efficient Tool Resolution

Augmenting large language models (LLM) to use external tools enhances th...
research
08/27/2023

Confucius: Iterative Tool Learning from Introspection Feedback by Easy-to-Difficult Curriculum

Augmenting large language models (LLMs) with external tools has emerged ...
research
04/16/2023

Solving Math Word Problems by Combining Language Models With Symbolic Solvers

Automatically generating high-quality step-by-step solutions to math wor...
research
09/16/2023

Multimodal Multi-Hop Question Answering Through a Conversation Between Tools and Efficiently Finetuned Large Language Models

We employ a tool-interacting divide-and-conquer strategy enabling large ...
research
02/15/2023

Augmented Language Models: a Survey

This survey reviews works in which language models (LMs) are augmented w...
research
05/23/2023

CREATOR: Disentangling Abstract and Concrete Reasonings of Large Language Models through Tool Creation

Large Language Models (LLMs) have demonstrated significant progress in u...
research
08/01/2023

Structural Embeddings of Tools for Large Language Models

It is evident that the current state of Large Language Models (LLMs) nec...

Please sign up or login with your details

Forgot password? Click here to reset