清华大学大模型工具学习_第1页
清华大学大模型工具学习_第2页
清华大学大模型工具学习_第3页
清华大学大模型工具学习_第4页
清华大学大模型工具学习_第5页
已阅读5页,还剩91页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

工具学习秦禹嘉THUNLP0背景THUNLP1工具和情报•

工具是人类能力的延伸

,

旨在提高生产力、效率和解决问题的能力•

纵观历史

,

人类一直是发明和操纵工具的主要媒介•

问题

:

人工智能在工具使用方面能像人类一样有能力吗

?2工具和情报•

基础模型的答案是肯定的•

较强的语义理解•

广泛的世界知识•

强大的推理和计划能力...3工具和情报•

工具学习

[1]:

基础模型可以遵循人类指令和操纵工具来解决任务[1]秦

,

于佳

,

等。

“基础模型的工具学习

”。

arXiv预印本

arXiv:

2304.08354(

2023)

。4工具学习的分类•

工具增强学习•

具有来自工具的执行结果的扩充基础模型•

工具被视为有助于产生高质量产出的补充资源5工具学习的分类•

面向工具的学习•

利用模型来管理工具并代替人类做出顺序决策•

利用基础模型的广阔世界知识和推理能力进行复杂的推理和规划6框架THUNLP7框架控制器提供可行的计划来满足用户请求工具集

:

具有不同功能的工具的集合环境提供了工具运行的平台感知者汇总反馈给控制器8意图理解•

理解指令的基本目的•

学习从指令空间到模型认知空间的映射•

指令调整•

用不同的指令包装任务•

监督微调•

非凡的泛化能力[1]精细语言模型是零分学习者[2]多任务提示训练可实现零镜头任务概括[3]OPT-IML:

通过镜头扩展语言模型指令元学习泛化9userdoc日期:2024-05-19,意图理解•

扩大模型大小和指令调整数据集的多样性•

泛化能力的增强•

挑战•

理解模糊指令

:

用户查询中的模糊和歧义•

理论上的无限指令空间

:

无限表达和个性化指令10工具理解•

通过提示激发工具理解•

零拍提示:•

描述

API功能

,

其输入

/输出格式

,

可能的参数等。•

允了解每个

API可以处理的任务•

少量提示

:•

向模型提供具体的工具使用演示•

通过从这些演示中模仿人类行为

,

模型可以学习如何利用这些工具11工具理解•

通过提示激发工具理解12规划与推理某省市推理•

在不与环境交互的情况下生成静态计划•

外向推理•

生成考虑环境变化和反馈的动态计划13规划与推理某省市推理•

如果提示适当

,

PLM可以有效地将高级任务分解为中级计划

,而无需任何进一步的培训14作为零镜头策划者的语言模型

:

为具体化提取可操作的知识代理商规划与推理•

外向推理•

挑战

:

基础模型没有体现或扎根于物理世界•

解决方案

:

约束模型提出既可行又符合上下文的自然语言动作尽我所能

,

不要像我说的那样

!Ahn,Michael,etal."DoasIcan,notasIsay:Groundinglanguageinrobotaffiliences."arXivpreprintarXiv:2204.01691(2022).15规划与推理•

外向推理•

内心独白

[1]:

将各种反馈来源的信息注入模型规划[1]

黄文龙等。

“内心独白

:

通过语言模型进行规划的具身推理。

”arXiv预印本

arXiv:

2207.05608(2022).16规划与推理•

多步骤多工具方案•

人类不会坚持一个场景和一个工具•

了解不同工具之间的相互作用•

模型不仅要了解单个工具

,

还要了解它们的组合用法并对工具进行逻辑排序•

从顺序执行到并行执行•

工具不必顺序执行

,

并行执行导致叠加效果•

从单代理问题解决到多代理协作•

复杂的任务通常需要多个代理之间的协作

,

每个代理都有其独特的专业知识17培训策略•

从演示中学习:

通常涉及

(

人类

)

注释•

从反馈中学习:

通常涉及强化学习18WebGPT•

监督学习•

克隆人类行为以使用搜索引擎•

监督微调

+强化学习•

只需要

6,000个注释数据Nakano,Reiichiro,etal."WebGPT:Browser-assistedquestion-answeringwithhumanfeedback."arXivpreprintarXiv:2112.09332(2021).19WebCPM•

动机•

WebGPT不是公开的

,

其运作仍然不透明•

我们的努力

(

WebCPM)•

开源交互式网络搜索界面•

第一个涉及交互式网络搜索的公共

QA数据集

,

也是第一个中国LFQA数据集•

框架和模型实现20WebCPM•

接口

(

搜索模式

)

和预定义的操作21WebCPM22WebCPM•

我们的框架由两个模型组成

:•

1.搜索模型

,

包括

:•

行动预测模块•

搜索查询生成模块•

支持事实提取模块•

2.信息综合模型23WebCPM对于

T个步骤的动作序列,搜索模型执行动作以收集支持事实,这些支持事实被发送到合成模型以用于答案生成。24WebCPM整体管道评价(

基于人类偏好

)

模型生成的答案

v.s.人类注释支持事实的三个来源被发送到综合模型(1)

管道收集

,

(2)人工收集

,

(3)非交互式搜索

(TF-IDF)25Webshop•

学习进行网上购物26Toolformer•

自监督工具学习•

预定义的工具

API•

鼓励模型调用和执行工具

API•

设计自监督损失

,

看看工具执行是否可以帮助语言建模如果工具执行减少了

LM损失

,

请将实例保存为训练数据27工具创建•

从工具用户到工具创建者•

人类是从石器时代到

21世纪创造和使用工具的主要媒介•

大多数工具是为人类创造的

,

而不是

AI•

为模型制作的工具•

模块化

:

将工具组成较小的单元•

新的输入和输出格式

:

更可计算且适用于

AI28工具创建29工具创建•

现有工程的限制•

大多数现有工作往往集中在有限数量的工具上•

用于确定工具最佳利用率的模型所采用的推理过程本质上是复杂的•

当前管道在检索执行结果后缺乏错误处理机制•

我们不是让

LLM充当工具的用户

,

而是让他们成为创造者

[1]30钱

,

程

,

等。

“CREATOR:

通过工具创造解开大型语言模型的抽象和具体推理。

”工具创建•

四个程序•

创建•

Decision•

Execution•

整改31工具创建•

实验•

数据:

数学、

TabMWP•

对

PoT和纯

CoT的重大改进32应用程序THUNLP33ChatGPT插件•

OpenAI官方工具库•

为

ChatGPT提供更广泛的应用程序•

通过简单地提供带有描述的

API,

ChatGPT能够调用应用程序并完成更复杂的任务34开源解决方案•

BMTools•

一个开源存储库

,

可扩展语言模型以使用工具

,

并作为社区构建和共享工具的平台35开源解决方案•

特点:•

用户可以通过编写

python函数并使用外部

ChatGPT-Plugins轻松构建新插件•

用户可以托管其本地模型

(

例如

LLaMA、

CPM)

以使用工具https:/

/

github./

OpenBMB/

BMTools/

tree/

main36开源解决方案•

特点:•

支持

30+工具工具

,

欢迎投稿

!数据库天气APIPPTHuggingface模型谷歌学者图像生成https:/

/

github./

OpenBMB/

BMTools/

tree/

main37开源解决方案•

特点:•

支持

BabyAGI和

AutoGPT•

100k+工具

-使用

SFT数据的方式!https:/

/

github./

OpenBMB/

BMTools/

tree/

main38开源解决方案39开源解决方案•

ToolBench•

一种开源

,

大规模

,

高质量的指令调整

SFT数据

,

以促进一般的工具使用能力•

我们提供数据集

,

相应的训练和评估脚本

,

以及在

ToolBench上微调的强大模型

ToolLLaMAhttps:/

/

github./

OpenBMB/

ToolBench40开源解决方案•

功能•

支持单工具和多工具方案•

ToolBench提供的响应不仅包括最终答案

,

而且还包含模型的思想链过程

,

工具执行和工具执行结果•

多步骤决策和工具执行•

另一个值得注意的优势是我们的

API的多样性

,

它是为现实世界的场景而设计的•

98k实例

,

312kAPI调用https:/

/

github./

OpenBMB/

ToolBench41开源解决方案•

施工工艺•

所有数据都由

OpenAIAPI自动生成

,

然后进行过滤

,

整个数据创建过程展https:/

/

github./

OpenBMB/

ToolBench42开源解决方案•

创建过程•

我们提供数据集

,

相应的训练和评估脚本

,

以及一个强大的模型

ToolLLaMAhttps:/

/

github./

OpenBMB/

ToolBench43开源解决方案•

评价•

ToolLLaMA与

ChatGPT在工具使用方面的能力相匹配•

ChatGPT自动评估

(

越高越好

)https:/

/

github./

OpenBMB/

ToolBench44Summary•

传统的语言任务

(

几乎

)

得到了很好的解决•

句法分析、实体识别、情感分析...•

我们面临着更具挑战性的任务

!•

基础模型可以通过使用语言在复杂的场景中利用

,

性能可能在很大程度上依赖于

LLM的有效性•

理论问题依然存在•

实际问题仍然存在•

探索在复杂场景中利用工具学习45工具学习论文列表https://github./thunlp/ToolLearningPapers46秦禹嘉THUNLP47Tool

Learning秦禹嘉.THUNLP0BackgroundTHUNLP1Tools

and

Intelligence•

Tools

are

extensions

ofhumancapabilities

designed

toenhanceproductivity,

efficiency,

andproblem-solving•

Throughouthistory,

humanshe

beenthe

primaryagents

in

theinvention

andmanipulation

oftools•

Question:

can

artificialintelligence

beas

capableashumansin

tool

use?2Tools

and

Intelligence•

Theanswer

is

yes

with

foundation

models•

Strongsemanticunderstanding•

Extensiveworldknowledge•

Powerfulreasoningandplanning

capabilities…3Tools

and

Intelligence•

Tool

Learning[1]:foundation

models

can

follow

humaninstructions

andmanipulatetools

for

task

solving[1]Qin,Yujia,

et

al."Tool

LearningwithFoundationModels."

arXivpreprint

arXiv:2304.08354(2023).4Categorization

of

Tool

Learning•

Tool-augmented

learning•

Augmentfoundationmodelswiththeexecutionresultsfromtools•

Tools

are

viewedasplementaryresourcesthataidinthegenerationofhigh-qualityoutputs5Categorization

of

Tool

Learning•

Tool-oriented

learning•

Utilize

modelsto

governtoolsand

make

sequentialdecisionsinplaceofhumans•

Exploitingfoundationmodels'vast

worldknowledgeandreasoningabilityforplexreasoningandplanning6FrameworkTHUNLP7FrameworkControllerprovides

feasibleplans

to

fulfilluserrequestsTool

Set:acollectionoftoolswithdifferent

functionalitiesEnvironment

provides

theplatform

where

toolsoperateThe

perceiversummarizesfeedback

to

the

controller8Intent

Understanding•prehendingtheunderlyingpurposeofan

instruction•

Learningamappingfrom

theinstruction

spaceto

themodel’s

cognition

space•

Instruction

Tuning•

Wrap

taskswithdiverseinstructions•

Supervisedfine-tuning•

Extraordinarygeneralizationcapability[1]FinetunedLanguageModels

AreZero-ShotLearners[2]MultitaskPrompted

TrainingEnablesZero-Shot

Task

Generalization[3]OPT-IML:ScalingLanguageModelInstructionMetaLearningthroughtheLensofGeneralization9userocate:2024-05-19,sgpjbgIntent

Understanding•

Scalingupthemodelsize

andthediversity

ofinstruction-tuningdatasets•

Enhancementof

generalizationcapability•

Challenges•

UnderstandingVague

Instructions:

vaguenessandambiguityintheuserquery•

TheoreticallyInfiniteInstructionSpace:

infiniteexpressionandpersonalizedinstructions10Tool

Understanding•

Elicitingtool

understandingwith

prompting•

Zero-shot

prompting:•

DescribeAPIfunctionalities,theirinput/outputformats,possibleparameters,

etc.•

Allowthemodelto

understandthetasks

thateachAPIcantackle•

Few-shot

prompting:•

Provideconcrete

tool-usedemonstrationsto

themodel•

By

mimickinghumanbehiorsfromthesedemonstrations,themodelcanlearnhowto

utilize

thesetools11Tool

Understanding•

Elicitingtool

understandingwith

prompting12Planning

and

Reasoning•

IntrospectiveReasoning•

Generate

astatic

planwithoutinteractingwiththeenvironment•

ExtrospectiveReasoning•

Generate

adynamicplanconsideringthechangeofenvironmentandfeedbacks13Planning

and

Reasoning•

IntrospectiveReasoning•

Ifprompted

appropriately,

PLMscan

effectivelydposehigh-leveltasks

into

mid-levelplanswithoutany

furthertraining14Language

Models

as

Zero-Shot

Planners:

Extracting

Actionable

Knowledge

for

Embodied

AgentsPlanning

and

Reasoning•

ExtrospectiveReasoning•

Challenge:foundationmodelsare

notembodiedorgroundedto

thephysicalworld•

Solution:constrain

themodelto

proposenaturallanguageactionsthatare

bothfeasibleandcontextuallyappropriateDoasIcan,NotasIsay!Ahn,Michael,etal."Do

asican,notasisay:

Groundinglanguage

inrobotic

affordances."

arXivpreprintarXiv:2204.01691(2022).15Planning

and

Reasoning•

ExtrospectiveReasoning•

InnerMonologue[1]:injectinginformationfromvarioussourcesoffeedbackintomodelplanning[1]Huang,Wenlong,etal."Innermonologue:Embodiedreasoningthroughplanningwithlanguagemodels."

arXivpreprintarXiv:2207.05608(2022).

16Planning

and

Reasoning•

Multi-step

Multi-toolScenarios•

Humanswon’tstickto

onescenarioandonetool•

UnderstandingtheInterplay

amongDifferent

Tools•

Modelsshouldnotonlyunderstandindividualtools,butlearntheirbinationusageandorderthetoolslogically•

From

SequentialExecution

to

Parallel

Execution•

Tools

do

nothe

to

beperformedsequentially,

parallelperformingleadsto

superimposedeffects•

From

Single-agent

Problem-Solvingto

Multi-agentCollaboration•plextasksoftennecessitate

collaborationamongmultipleagents,eachwiththeiruniqueexpertise17Training

Strategies•

Learningfrom

demonstrations:often

involves

(human)annotations•

Learningfrom

feedback:often

involves

reinforcementlearning18WebGPT•

SupervisedLearning•

Clonehumanbehiorto

usesearchengines•

Supervisedfine-tuning

+reinforcementlearning•

Onlyneed6,000annotated

dataNakano,Reiichiro,etal."WebGPT:Browser-assistedquestion-answeringwithhumanfeedback."arXivpreprintarXiv:2112.09332(2021).19WebCPM•

Motivation•

WebGPT

isnotpublic,anditsinnerworkingsremainopaque•

OurEfforts

(WebCPM)•

Open-sourceinteractive

websearchinterface•

Thefirstpublic

QAdatasetthatinvolves

interactive

websearch,andalsothefirstChineseLFQAdataset•

FrameworkandModelImplementation20WebCPM•

Interface

(search

mode)andpre-defined

actions21WebCPM22WebCPM•

Ourframework

consists

oftwo

models:•

1.Search

model,consistingof:•

Actionpredictionmodule•

Searchquerygenerationmodule•

Supportingfactextractionmodule•

2.Information

synthesis

model23WebCPMFor

anactionsequenceofTsteps,

thesearch

modelexecutes

actionsto

collectsupportingfacts,

whicharesent

to

thesynthesis

modelfor

answer

generation.24WebCPMHolisticPipelineEvaluation

(basedonhumanpreference)Model-generatedAnswer

v.s.

HumanAnnotationThreesourcesofsupportingfactsare

senttothesynthesismodel(1)pipeline-collected,(2)human-collected,(3)non-interactivesearch(TF-IDF)25WebShop•

Learningto

perform

onlineshopping26Toolformer•

Self-supervised

Tool

Learning•

Pre-definedtoolAPIs•

Encourage

modelsto

callandexecute

toolAPIs•

Designself-supervisedlossto

seeifthetool

execution

canhelplanguagemodelingIf

thetool

execution

reducesLMloss,se

the

instancesastraining

data27Tool

Creation•

From

Tool

Userto

Tool

Creator•

Humansare

theprimaryagentsthatcreate

andusetoolsfromStone

Age

to

21stcentury•

Mosttoolsare

created

for

humans,notAI•

Tools

Madefor

Models•

Modularized:posetoolsintosmallerunits•

Newinputandoutputformats:

moreputableandsuitablefor

AI28Tool

Creation29Tool

Creation•

Limitations

ofExistingWorks•

Mostexistingworktendsto

concentrate

onalimitednumberoftools•

Thereasoningprocessemployedbymodelsfor

determiningtheoptimalutilizationoftoolsisinherentlyplex•

Thecurrentpipelineslackaerror-handlingmechanismafterretrievingexecutionresults•

Instead

oflettingLLMsactastheusers

oftools,

weenablethemto

bethecreators

[1]30Qian,Cheng,etal."CREATOR:

Disentangling

AbstractandConcreteReasoningsofLargeLanguageModelsthrough

Tool

Creation."Tool

Creation•

Four

Procedures•

Creation•

Decision•

Execution•

Rectification31Tool

Creation•

Experiments•

Datasts:

MATH,

TabMWP•

SignificantimprovementsoverPoT

andpureCoT32ApplicationTHUNLP33ChatGPT

Plugins•

OpenAI’s

officialtool

library•

EmpowerChatGPTwithbroaderapplications•

By

simplyprovidingAPIswithdescriptions,

ChatGPTisenabledto

callapplicationsandplete

moreplex

tasks34Open-source

Solutions•

BMTools•

Anopen-sourcerepositorythatextendslanguagemodelsto

usetoolsandservesasaplatform

for

themunityto

buildandsharetools35Open-source

Solutions•

Features:•

Users

caneasilybuildanewpluginbywritingpythonfunctionsanduseexternalChatGPT-Plugins•

Users

can

hosttheirlocalmodels(e.g.,LLaMA,CPM)to

usetools36Open-source

Solutions•

Features:•

30+toolstoolssupported,weecontributing!databaseWeather

APIPPTHuggingface

ModelsGoogleScholarImage

Generation37Open-source

Solutions•

Features:•

Support

BabyAGIandAutoGPT•

100k+tool-useSFTdata

ontheway!38Open-source

Solutions39Open-source

Solutions•

ToolBench•

Anopen-source,large-scale,high-qualityinstructiontuningSFTdata

to

facilitate

generaltool-usecapability•

We

providethedataset,the

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论