# Toolformer: AI learns to use APIs

## Метаданные

- **Канал:** AssemblyAI
- **YouTube:** https://www.youtube.com/watch?v=LxZ3gYvbV7I
- **Дата:** 10.04.2023
- **Длительность:** 4:37
- **Просмотры:** 4,307

## Описание

A group of researchers at Meta AI research has finetuned a large language model (GPT-J which is based on GPT-3) to be able to select tools.

Large Language Models has limitation such as mathematical reasoning or being unaware of current events. One way to solve this is to use APIs to gather the required information. The problem is, this solution can get very manual-heavy — making it unscalable.

Toolformer, the new model from Meta AI research is trained on a special dataset which is generated by itself to choose the necessary API automatically. 

Let's see how it is trained in this video.

▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬

🖥️ Website: https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_mis_37
🐦 Twitter: https://twitter.com/AssemblyAI
🦾 Discord: https://discord.gg/Cd8MyVJAXd
▶️  Subscribe: https://www.youtube.com/c/AssemblyAI?sub_confirmation=1
🔥 We're hiring! Check our open roles: https://www.assemblyai.com/careers

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

#MachineLearning #DeepLearning

## Содержание

### [0:00](https://www.youtube.com/watch?v=LxZ3gYvbV7I) Segment 1 (00:00 - 04:00)

can AI learn to use tools well maybe not physical ones but based on This research now ai can learn to use digital tools like apis large language models show impressive capabilities even in few or zero shot settings when it comes to natural language processing tasks and they've also been observed to have emerging capabilities but one of the struggles with using nlms is their limitations that hinder their use day to day for example mathematical reasoning inability to access latest information and understanding the progression of time one of the solutions that was offered to overcome this problem has been to use external tools for example apis to cover these limitations but so far this solution has been implemented manually and through human annotation which makes the solution basically unscalable tool former which is a model that is developed at meta AI research is a model that has trained to understand which API to use when for Tool former researchers made a question answering API the Wikipedia API AI a calculator and a machine translation API available tool former was trained on the specially made data set this data set consisted of sentences that was annotated with API calls here are some examples the name derives from La Tortuga the Spanish word for turtle as you see here before the word Turtle the machine translation API is called empty pointing to the input is Tortuga and the result turtle is also annotated this data set was made using in context learning capabilities of language models to generate data sets from scratch to make this data set given each sentence the researchers made the language model determine where in this text and API call can be made or a question can be asked for example in the example sentence out of 1400 participants 400 or 29 passed the test an API call can be made before 29 for account calculator to come up with the percentage this annotation is done by instructing the model to find places in the text where a question can be placed to train the model to do that the instruction that is given to the model is like this your task is to add calls to a question answering API to a piece of text the question should help you get information required to complete the text you can call the API by writing QA question where question is the question you want to ask here are some examples of API calls and giving it a couple of examples of how that is done once all the locations where a question can be asked is determined all of these API calls are actually done and once we have the results of the API calls we filter these API calls to see which ones were useful at the end useful here means that it helps us determine or predict what the next token in the sentence should be if it doesn't help us as in if it's not useful we remove this API call from this data set the language model that helped us create this data set is then fine-tuned on this newly created data set using a standard language modeling objective so basically the model that created the data set is being fine-tuned on its own feedback during inference time the model runs the performance decoding until the special Arrow token is produced then the necessary API is called to get the result tool former is a gptj model fine-tuned on this newly created API annotated data set over many Downstream tasks such as question answering mathematical reasoning and mask language modeling tool former performs better than gptj which itself is based on gpt3 so it basically shows us that being able to call external tools like apis helps this model perform better one interesting takeaway from this paper is that even though larger models are able to use the apis effectively to improve the model performance smaller models that are trained on this newly created API data set are not able to use the API eyes effectively and even though as the model size gets bigger the model performance gets much better without even the help of apis the ability to choose and use apis definitely gives models a clear Advantage it's very interesting to see how AI is progressing in a couple of different branches over the last year we've seen big leaves achieved by human feedback assisted Ai and now we are seeing AI feedback assisted AI but what do you think of tool former do you think it can Elevate the capabilities of large language models to use them in everyday life leave a comment and let us know and I'll see you in the next video

---
*Источник: https://ekstraktznaniy.ru/video/12653*