Home > Technology peripherals > AI > Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

WBOY
Release: 2023-04-08 11:11:10
forward
939 people have browsed it

In natural language processing tasks, large language models have achieved impressive results in zero-shot and few-shot learning. However, all models have inherent limitations that can often only be partially addressed through further extensions. Specifically, the limitations of the model include the inability to access the latest information, the "information hallucination" of facts, the difficulty of understanding low-resource languages, the lack of mathematical skills for precise calculations, etc.

A simple way to solve these problems is to equip the model with external tools, such as a search engine, calculator, or calendar. However, existing methods often rely on extensive manual annotations or limit the use of tools to specific task settings, making the use of language models combined with external tools difficult to generalize.

In order to break this bottleneck, Meta AI recently proposed a new method called Toolformer, which allows the language model to learn to "use" various external tools.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

##Paper address: https://arxiv.org/pdf/2302.04761v1.pdf

Toolformer quickly attracted great attention. Some people believed that this paper solved many problems of current large language models and praised: "This is the most important article in recent weeks. paper".

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Some people pointed out that Toolformer uses self-supervised learning to allow large language models to learn to use some APIs and tools, which are very flexible and efficient:

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Some even think that Toolformer will take us away from general artificial intelligence (AGI) One step closer.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Toolformer gets such a high rating because it meets the following practical needs:

  • Large language models should learn the use of tools in a self-supervised manner without the need for extensive human annotation. This is critical because the cost of human annotation is high, but more importantly, what humans think is useful may be different from what the model thinks is useful.
  • Language models require more comprehensive use of tools that are not bound to a specific task.

This clearly breaks the bottleneck mentioned above. Let’s take a closer look at Toolformer’s methods and experimental results.

Method

Toolformer generates the dataset from scratch based on a large language model with in-context learning (ICL) (Schick and Schütze, 2021b; Honovich et al. , 2022; Wang et al., 2022)’s idea: just give a few samples of humans using the API, you can let LM annotate a huge language modeling data set with potential API calls; then use self-supervised loss function to determine which API calls actually help the model predict future tokens; and finally fine-tune based on API calls that are useful to the LM itself.

Since Toolformer is agnostic to the dataset used, it can be used on the exact same dataset as the model was pre-trained on, which ensures that the model does not lose any generality and language Modeling capabilities.

Specifically, the goal of this research is to equip the language model M with the ability to use various tools through API calls. This requires that the input and output of each API can be characterized as a sequence of text. This allows API calls to be seamlessly inserted into any given text, with special tokens used to mark the beginning and end of each such call.

The study represents each API call as a tuple

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

, where a_c is the name of the API and i_c is the corresponding input. Given an API call c with corresponding result r, this study represents the linearized sequence of API calls excluding and including its result as:

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Among them, , and "→" are special tokens. As shown in Figure 1 below, this approach allows LMs to learn to control various tools and choose for themselves which tool to use when and how.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Given data set

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

, the study first transformed this data set into a data set C* with added API calls. This is done in three steps, as shown in Figure 2 below: First, the study leverages M's in-context learning capabilities to sample a large number of potential API calls, then executes these API calls, and then checks whether the obtained responses help predictions Future token to be used as filtering criteria. After filtering, the study merges API calls to different tools, ultimately generating dataset C*, and fine-tunes M itself on this dataset.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Experiments and Results

The study was conducted on a variety of different downstream tasks Experimental results show that: Toolformer based on the 6.7B parameter pre-trained GPT-J model (learned to use various APIs and tools) significantly outperforms the larger GPT-3 model and several other baselines on various tasks.

This study evaluated several models on the SQuAD, GoogleRE and T-REx subsets of the LAMA benchmark. The experimental results are shown in Table 3 below:

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

To test the mathematical reasoning capabilities of Toolformer, the study conducted experiments on the ASDiv, SVAMP, and MAWPS benchmarks. Experiments show that Toolformer uses calculator tools in most cases, which is significantly better than OPT (66B) and GPT-3 (175B).

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

In terms of question answering, the study conducted experiments on three question answering data sets: Web Questions, Natural Questions and TriviaQA . Toolformer significantly outperforms baseline models of the same size, but is inferior to GPT-3 (175B).

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

In terms of cross-language tasks, this study compared all baseline models on Toolformer and MLQA, and the results are as follows As shown in Table 6:

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

##In order to study the effectiveness of the calendar API, the study was conducted on TEMPLAMA and a new API called DATESET Experiments were conducted on several models on the dataset. Toolformer outperforms all baselines but does not use the TEMPLAMA calendar tool.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

In addition to validating performance improvements on various downstream tasks, the study also hopes to ensure that Toolformer's language modeling performance is not degraded by fine-tuning of API calls. To this end, this study conducts experiments on two language modeling datasets to evaluate, and the perplexity of the model is shown in Table 8 below.

For language modeling without any API calls, there is no cost to add API calls.

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

Finally, the researchers analyzed how the ability to seek help from external tools affects the model as the size of the language model increases. The impact of performance, the analysis results are shown in Figure 4 below

Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer

##Interested readers can read the original text of the paper to learn more Study the details.

The above is the detailed content of Has the language model learned to use search engines on its own? Meta AI proposes API call self-supervised learning method Toolformer. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template