机器学习:self supervised learning- Recent Advances in pre-trained language models

机器学习:self supervised learning- Recent Advances in pre-trained language models_第1张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第2张图片

机器学习:self supervised learning- Recent Advances in pre-trained language models_第3张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第4张图片

背景

机器学习:self supervised learning- Recent Advances in pre-trained language models_第5张图片

Autoregressive Langeuage Models

不完整的句子,预测剩下的空的词语
机器学习:self supervised learning- Recent Advances in pre-trained language models_第6张图片

  • sentence completion
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第7张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第8张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第9张图片

Transformer-based ALMs

机器学习:self supervised learning- Recent Advances in pre-trained language models_第10张图片

Masked language models-MLMs

机器学习:self supervised learning- Recent Advances in pre-trained language models_第11张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第12张图片

机器学习:self supervised learning- Recent Advances in pre-trained language models_第13张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第14张图片
预训练模型能将输入文本转成hidden feature representation

机器学习:self supervised learning- Recent Advances in pre-trained language models_第15张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第16张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第17张图片
模型参数最开始是从预训练模型中拿到,然后给予具体任务再微调,中间模型参数可固定也可以微训练
机器学习:self supervised learning- Recent Advances in pre-trained language models_第18张图片

  • 相关paper
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第19张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第20张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第21张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第22张图片

The Problems of PLMs

问题1:有label的数据少

机器学习:self supervised learning- Recent Advances in pre-trained language models_第23张图片

问题2:模型慢慢越来越大了,推理费时间

机器学习:self supervised learning- Recent Advances in pre-trained language models_第24张图片

机器学习:self supervised learning- Recent Advances in pre-trained language models_第25张图片
4个任务需要4倍显存大小
机器学习:self supervised learning- Recent Advances in pre-trained language models_第26张图片
推理耗时长

解决办法

Labeled Data Scarcity——Data-efficient-tuning

机器学习:self supervised learning- Recent Advances in pre-trained language models_第27张图片
当数据少的时候,可能模型无法学习到上述任务功能
机器学习:self supervised learning- Recent Advances in pre-trained language models_第28张图片
将数据转成自然语言的prompt,模型能更容易知道自己应该做什么
机器学习:self supervised learning- Recent Advances in pre-trained language models_第29张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第30张图片机器学习:self supervised learning- Recent Advances in pre-trained language models_第31张图片

  • 1 A prompt template: 告诉模型要做什么事,这里是填充中间的mask
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第32张图片
  • 2-一个plm模型执行任务,输出概率最大的可能情况

机器学习:self supervised learning- Recent Advances in pre-trained language models_第33张图片

  • verbalizer: 将标签和概率映射起来
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第34张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第35张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第36张图片
    当标注数据比较少的话,标准微调是比较难训练好的;
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第37张图片
    机器学习:self supervised learning- Recent Advances in pre-trained language models_第38张图片

few-shot learning

机器学习:self supervised learning- Recent Advances in pre-trained language models_第39张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第40张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第41张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第42张图片

semi-supervised learning

机器学习:self supervised learning- Recent Advances in pre-trained language models_第43张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第44张图片

  • PET
    • 第一步:设计不同的prompt
      机器学习:self supervised learning- Recent Advances in pre-trained language models_第45张图片
    • 第二步:使用多个训练的模型去预测标签,将预测的结果加起来作为总的预测
      机器学习:self supervised learning- Recent Advances in pre-trained language models_第46张图片
    • 第三步:使用标准的训练方法,soft label
      机器学习:self supervised learning- Recent Advances in pre-trained language models_第47张图片

Zero-shot learning

机器学习:self supervised learning- Recent Advances in pre-trained language models_第48张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第49张图片
大模型够大,就可以实现zero-shot
机器学习:self supervised learning- Recent Advances in pre-trained language models_第50张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第51张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第52张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第53张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第54张图片

总结

机器学习:self supervised learning- Recent Advances in pre-trained language models_第55张图片

  • 蒸馏
  • 提纯到下游任务

机器学习:self supervised learning- Recent Advances in pre-trained language models_第56张图片
共享相关transfomer layers的参数

PLMs Are Gigantic——Reducing the Number of Parameters

机器学习:self supervised learning- Recent Advances in pre-trained language models_第57张图片
转变为共用一个bert模型
机器学习:self supervised learning- Recent Advances in pre-trained language models_第58张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第59张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第60张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第61张图片

Adapter

机器学习:self supervised learning- Recent Advances in pre-trained language models_第62张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第63张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第64张图片
只更新adapter,不更新transformer;adapter做的事情是先降维,然后再升维,产生△h
机器学习:self supervised learning- Recent Advances in pre-trained language models_第65张图片
每个下游任务只学习它自己的△h, transformer层的参数h不动,这样能大大减少需要的显存空间。

LoRA

机器学习:self supervised learning- Recent Advances in pre-trained language models_第66张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第67张图片
先把低维向量变成高维,然后高维再变成低维。
机器学习:self supervised learning- Recent Advances in pre-trained language models_第68张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第69张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第70张图片
Lora效果比adaper效果好,不会增加模型层数,参数量比adapter要小。

Prefix Tuning

机器学习:self supervised learning- Recent Advances in pre-trained language models_第71张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第72张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第73张图片
在标准的自注意力结构的前面插了一些东西
机器学习:self supervised learning- Recent Advances in pre-trained language models_第74张图片
在infer的时候把蓝色的部分丢掉
机器学习:self supervised learning- Recent Advances in pre-trained language models_第75张图片

Soft Prompting

机器学习:self supervised learning- Recent Advances in pre-trained language models_第76张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第77张图片

总结

机器学习:self supervised learning- Recent Advances in pre-trained language models_第78张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第79张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第80张图片

Early Exit

机器学习:self supervised learning- Recent Advances in pre-trained language models_第81张图片
用整个模型跑花很长时间
机器学习:self supervised learning- Recent Advances in pre-trained language models_第82张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第83张图片
第一层的分类器信心不足,到第二层:
机器学习:self supervised learning- Recent Advances in pre-trained language models_第84张图片
如果信心够了,就不用后面的过程了,以节约时间
机器学习:self supervised learning- Recent Advances in pre-trained language models_第85张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第86张图片

总结

机器学习:self supervised learning- Recent Advances in pre-trained language models_第87张图片

Closing Remarks

机器学习:self supervised learning- Recent Advances in pre-trained language models_第88张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第89张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第90张图片
机器学习:self supervised learning- Recent Advances in pre-trained language models_第91张图片

你可能感兴趣的:(NLP,AIGC,机器学习,机器学习,语言模型,预训练语言模型,lora)