济南网站建设工作室,西安网页设计培训费用,一个人可以做多少网站,wordpress 淘宝同步展示了LM可以通过简单的API教自己使用外部工具#xff0c;并实现两个世界的最佳效果。我们介绍了Toolformer#xff0c;这是一个经过训练的模型#xff0c;可以决定调用哪些API#xff0c;何时调用#xff0c;传递哪些参数#xff0c;以及如何将结果最好地纳入未来的标记…展示了LM可以通过简单的API教自己使用外部工具并实现两个世界的最佳效果。我们介绍了Toolformer这是一个经过训练的模型可以决定调用哪些API何时调用传递哪些参数以及如何将结果最好地纳入未来的标记预测中。这是以一种自我监督的方式完成的只需要对每个API进行少量的演示即可。我们纳入了一系列的工具包括一个计算器、一个问答系统、一个搜索引擎、一个翻译系统和一个日历。
1 摘要部分的主要信息
1) 大模型的不足或者本文的问题来源最新的事件信息、相关事实的倾向不能捕捉理解低资源语言的困难缺乏进行精确计算的数学技能Patel等人2021和对时间的进展没有意识Dhingra等人2022 2) 数据集的获取上Given just a handful of human-written examples of how an API can be used, we let a LM annotate a huge language modeling dataset with potential API calls 在标注小批量数据集的基础上使用API完成数据集标注 3) 训练方式上We then use a self-supervised loss to determine which of these API calls actually help the model in predicting future tokens. Finally, we finetune the LM itself on the API calls that it con siders useful. As illustrated in Figure 1, through this simple approach, LMs can learn to control a va riety of tools, and to choose for themselves which tool to use when and how. 自监督损失
2 方法部分的主要信息
目标是准备每个API需要的输入和输出信息表示为文本序列形式 **过程**第一步是使用大模型挖掘一部分可能的API calls的需求第二步是对挖掘出的这部分需求做过滤保留有用的删掉没有用的。第三步是将所有的API calls组合起来使用LM在这部分自己做的数据集上做微调。进而最终具备选择API解决问题 的能力。
2.1 sample API calls
写了一个prompt来促使PLM 能够完成API calls.
计算PLM在句子中的每个token位置续写的可能性如果高于一个值则选择在这个位置续写。为了保证续写位置的数量的上限设置了一个阈值当续写的概率高于这个阈值时会续写低于的情况下直接舍弃如果高于的数量超过了k个则按概率选择前k位置作为续写的地方
Your task is to add calls to a Question
Answering API to a piece of text.
The questions 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:
Input: Joe Biden was born in Scranton,
Pennsylvania.
Output: Joe Biden was born in [QA(Where
was Joe Biden born?)] Scranton,
[QA(In which state is Scranton?)]
Pennsylvania.
Input: Coca-Cola, or Coke, is a
carbonated soft drink manufactured by
the Coca-Cola Company.
Output: Coca-Cola, or [QA(What other
name is Coca-Cola known by?)] Coke, is
a carbonated soft drink manufactured by
[QA(Who manufactures Coca-Cola?)] the
Coca-Cola Company.2.2 executing API calls
这一步内部怎么执行的取决于API内部的模型自己。
2.3 filtering API calls
调用API calls产生result的过程中也会有cross_entropy loss相比于两种极端情况不适用API calls和使用API calls但不会产生response两种极端情况下的损失值的最小值和前者比较如果后者-前者阈值则保留API calls. 2.4 Model finetuning
将API产生的序列合并作为一份新的dataset。然后用来微调LM。
3 实验结果