当前位置: 首页 > news >正文

网站开发的操作可行性广告文案经典范例200字

网站开发的操作可行性,广告文案经典范例200字,做爰 网站,二级域名网站权重随着预训练模型的参数越来越大,尤其是175B参数大小的GPT3发布以来,让很多中小公司和个人研究员对于大模型的全量微调望而却步,近年来研究者们提出了各种各样的参数高效迁移学习方法(Parameter-efficient Transfer Learning&#x…

       随着预训练模型的参数越来越大,尤其是175B参数大小的GPT3发布以来,让很多中小公司和个人研究员对于大模型的全量微调望而却步,近年来研究者们提出了各种各样的参数高效迁移学习方法(Parameter-efficient Transfer Learning),即固定住Pretrain Language model(PLM)的大部分参数,仅调整模型的一小部分参数来达到与全部参数的微调接近的效果(调整的可以是模型自有的参数,也可以是额外加入的一些参数)。本文将介绍一些常见的参数高效微调技术,比如:BitFit、Prefix Tuning、Prompt Tuning、P-Tuning、P-Tuning v2、Adapter Tuning及其变体、LoRA、AdaLoRA、QLoRA、MAM Adapter、UniPELT等。

1、BitFit

论文地址:https://aclanthology.org/2022.acl-short.1.pdf

代码地址:https://github.com/benzakenelad/BitFit

       BitFIt只对模型的bias进行微调。在小规模-中等规模的训练数据上,BitFit的性能与全量微调的性能相当,甚至有可能超过,在大规模训练数据上,与其他fine-tuning方法也差不多。在大模型中bias存在Q,K,V,MLP,LayerNorm中,具体公式如下:

图片

图片

图片

      在Bert-Base/Bert-Large这种模型里,bias参数仅占模型全部参数量的0.08%~0.09%。但是通过在Bert-Large模型上基于GLUE数据集进行了 BitFit、Adapter和Diff-Pruning的效果对比发现,BitFit在参数量远小于Adapter、Diff-Pruning的情况下,效果与Adapter、Diff-Pruning想当,甚至在某些任务上略优于Adapter、Diff-Pruning。

图片

       通过Bitfit训练前后的参数对比,发现很多bias参数没有太多变化,例如跟计算key所涉及到的bias参数。发现其中计算query与中间MLP层的bias(将特征维度从N放大到4N的FFN层——将输入从768d转化为到3072d)变化最为明显,只更新这两类bias参数也能达到不错的效果,反之,固定其中任何一者,模型的效果都有较大损失。

图片

作者给出了Hugging Face与BitFit参数的映射关系表,如下所示:

图片

2、Prefix Tuning

论文地址:https://arxiv.org/pdf/2101.00190.pdf

代码地址:https://github.com/XiangLi1999/PrefixTuning

       prefix-tuning方法是一个轻量级的fine-tuning方法用于自然语言处理的生成任务。该方法可以保持预训练语言模型参数固定(frozen),而只需要在task-specific vector(称为prefix)上进行优化。即只需要少量(约0.1%)的优化参数,即可以在量和小量数据上达到不错的效果。

针对不同的模型结构,需要构造不同的Prefix。

  • 针对自回归架构模型:在句子前面添加前缀,得到 z = [PREFIX; x; y],合适的上文能够在固定 LM 的情况下去引导生成下文(比如:GPT3的上下文学习)。

  • 针对编码器-解码器架构模型:Encoder和Decoder都增加了前缀,得到 z = [PREFIX1; x; PREFIX2; y]。Encoder端增加前缀是为了引导输入部分的编码,Decoder 端增加前缀是为了引导后续token的生成。

图片

        如上图所示,  P_{idx}表示prefix indices序列,  |P_{idx}|表示prefix的长度。Prefix-tuning通过初始化可训练矩阵P_\theta  (维度为 |P_{idx} \times dim(h_i)| )来存储prefix参数:

 h_i=\left\{\begin{matrix} P_\theta [i,:], ifi even\\ LM_\phi (z_i,h<i), othervise\end{matrix}\right.

       training objective与Fine-tuning相同,但语言模型的参数\phi 固定,仅仅prefix参数\theta是可训练参数。因此h_i是可训练的P_\theta的函数,当i\in P_{idx}时,   h_i由 P_\theta 直接复制得到,对于i\notin P_{idx}  , 由于prefix activations始终在left context因此可以影响到   h_i 。

       在实验上,直接更新P_\theta  的参数会导致优化的不稳定以及表现上的极具下降。因此通过使用较小的矩阵 {P}'_\theta 通过大型前馈神经网络(MLP_\theta  )来reparametrize矩阵P_\theta  :

P_\theta [i,:] = MLP_\theta ({P}'_\theta [i,:])  

        其中,  P_\theta和 {P}'_\theta 在相同的行维度(也就是相同的prefix length), 但不同的列维度。当训练完成后,reparametrization参数被丢掉,仅仅prefix(P_\theta )  需要被保存下来。

        实验中对比了Fine Tuning和Prefix Tuning在E2E、WebNLG和DART三个table-to-text任务上的效果:

图片

图片

3、Prompt Tuning

论文地址:https://arxiv.org/pdf/2104.08691.pdf

代码地址:https://github.com/google-research/prompt-tuning

       Prompt Tuning可以看作是Prefix Tuning的简化版本,面向NLU任务,进行了更全面的效果对比,并且在大模型上成功打平了LM微调的效果,它给每个任务定义了自己的Prompt,然后拼接到数据上作为输入,但只在输入层加入prompt tokens,并且不需要加入 MLP 进行调整来解决难训练的问题。通过反向传播更新参数来学习prompts,而不是人工设计prompts;同时冻结模型原始权重,只训练prompts参数,训练完以后,用同一个模型可以做多任务推理。

图片

对比Prefix-Tunning,prompt-tuning的主要差异如下,

      论文使用100个prefix token作为默认参数,大于以上prefix-tuning默认的10个token,不过差异在于prompt-Tunning只对输入层(Embedding)进行微调,而Prefix是对虚拟Token对应的上游layer全部进行微调。因此Prompt-Tunning的微调参数量级要更小,且不需要修改原始模型结构,这是“简化”的来源。相同的prefix长度,Prompt-Tunning(<0.01%)微调的参数量级要比Prefix-Tunning(0.1%~1%)小10倍以上,如下图所示

图片

      为什么上面prefix-tuning只微调embedding层效果就不好,放在prompt-tuning这里效果就好了呢?因为评估的任务不同无法直接对比,个人感觉有两个因素,一个是模型规模,另一个是继续预训练,前者的可能更大些,在下面的消融实验中会提到   

效果&消融实验

      在SuperGLUE任务上,随着模型参数的上升,PromptTunning快速拉近和模型微调的效果,110亿的T5模型(上面prefix-tuning使用的是15亿的GPT2),已经可以打平在下游多任务联合微调的LM模型,并且远远的甩开了Prompt Design(GPT3 few-shot)

图片

      作者也做了全面的消融实验,包括以下4个方面,最核心的感受就是只要模型足够够大一切都好说

  1. prompt长度(a):固定其他参数,作者尝试了{1,5,20,100,150}, Prompt token 的长度在20左右时的表现已经不错(超过20之后,提升Prompt token长度,对模型的性能提升不明显了),同样的,这个gap也会随着模型参数规模的提升而减小(即对于超大规模模型而言,即使 Prompt token 长度很短,对性能也不会有太大的影响);

  2. Prompt初始化(b): 作者尝试了随机uniform初始化,用标签文本空间初始化,和用Top5K高频词采样初始化,在10^8规模,类标签词初始化效果最好。作者发现预测label也会在对应prompt空间内。不过到百亿规模后,初始化带来的影响就会消失;

  3. T5继续预训练(c):作者认为T5本身的Span Corruption预训练目标和掩码词,并不适合冻结LM的场景,因为在微调中模型可以调整预训练目标和下游目标的差异,而只使用prompt可能无法弥合差异。其实这里已经能看出En-Dn框架在生成场景下没有GPT这样的Decoder来的自然。因此作者基于LM目标对T5进行继续预训练;

  4. 继续预训练step(d):以上的继续预训练steps,继续预训练步数越高,模型效果在不同模型规模上越单调;

图片

可解释性

      考虑Prompt-Tunning使用Embedding来表征指令,可解释性较差。作者使用cosine距离来搜索prompt embedding对应的Top5近邻。发现如下:

  • embedding的近邻出现语义相似的cluster,例如{ Technology / technology / Technologies/ technological / technologies }, 说明连续prompt实际可能是相关离散prompt词的聚合语义

  • 当连续prompt较长(len=100), 存在多个prompt token的KNN相同:个人认为这和prefix-tuning使用MLP那里我的猜测相似,prompt应该是一个整体

  • 使用标签词初始化,微调后标签词也大概率会出现在prompt的KNN中,说明初始化可以提供更好的prior信息加速收敛


文章转载自:
http://dinncobioplasm.bkqw.cn
http://dinncobaffy.bkqw.cn
http://dinncoendlessly.bkqw.cn
http://dinncogastronomist.bkqw.cn
http://dinncoagrapha.bkqw.cn
http://dinncomonolog.bkqw.cn
http://dinncobacksight.bkqw.cn
http://dinncospasmodist.bkqw.cn
http://dinncounderthrust.bkqw.cn
http://dinncofactorize.bkqw.cn
http://dinncosarsa.bkqw.cn
http://dinncoirenics.bkqw.cn
http://dinncoswakara.bkqw.cn
http://dinncosound.bkqw.cn
http://dinncosemiopaque.bkqw.cn
http://dinncoelytra.bkqw.cn
http://dinncoorchestration.bkqw.cn
http://dinncohydrogenization.bkqw.cn
http://dinncosatire.bkqw.cn
http://dinncoantifeminist.bkqw.cn
http://dinncomicrospecies.bkqw.cn
http://dinncoerrhine.bkqw.cn
http://dinncolyophilic.bkqw.cn
http://dinncochloritize.bkqw.cn
http://dinncocourseware.bkqw.cn
http://dinncooverwhelming.bkqw.cn
http://dinncoadas.bkqw.cn
http://dinncomalibu.bkqw.cn
http://dinncoovercame.bkqw.cn
http://dinncohippocampal.bkqw.cn
http://dinncosemiyearly.bkqw.cn
http://dinnconeanic.bkqw.cn
http://dinncoaethereally.bkqw.cn
http://dinncolawcourt.bkqw.cn
http://dinncohairbell.bkqw.cn
http://dinncowaver.bkqw.cn
http://dinncogynaecology.bkqw.cn
http://dinncobeetroot.bkqw.cn
http://dinncoaurific.bkqw.cn
http://dinncoseggie.bkqw.cn
http://dinnconannofossil.bkqw.cn
http://dinncodeportation.bkqw.cn
http://dinncoparaphrase.bkqw.cn
http://dinncovegetation.bkqw.cn
http://dinncorambutan.bkqw.cn
http://dinncouninformed.bkqw.cn
http://dinncoauckland.bkqw.cn
http://dinncobrava.bkqw.cn
http://dinncomedia.bkqw.cn
http://dinncowatermanship.bkqw.cn
http://dinncodecolonize.bkqw.cn
http://dinnconrem.bkqw.cn
http://dinncodonator.bkqw.cn
http://dinncoshipboard.bkqw.cn
http://dinncosierra.bkqw.cn
http://dinncopickup.bkqw.cn
http://dinncovyborg.bkqw.cn
http://dinncoviborg.bkqw.cn
http://dinncoprenatal.bkqw.cn
http://dinncobonhomous.bkqw.cn
http://dinncopatriarchy.bkqw.cn
http://dinncobhave.bkqw.cn
http://dinncofibroadenoma.bkqw.cn
http://dinncohaustrum.bkqw.cn
http://dinncoethiopic.bkqw.cn
http://dinncobitsy.bkqw.cn
http://dinncolaryngotomy.bkqw.cn
http://dinncotrochometer.bkqw.cn
http://dinncodefocus.bkqw.cn
http://dinncoesol.bkqw.cn
http://dinncoentomophily.bkqw.cn
http://dinncotussis.bkqw.cn
http://dinncoairworthiness.bkqw.cn
http://dinncoappaloosa.bkqw.cn
http://dinncomantle.bkqw.cn
http://dinncounfriendly.bkqw.cn
http://dinncoindophenol.bkqw.cn
http://dinncoelectrochemical.bkqw.cn
http://dinncodirectorial.bkqw.cn
http://dinncooblige.bkqw.cn
http://dinncoscalade.bkqw.cn
http://dinncoesol.bkqw.cn
http://dinncosemiround.bkqw.cn
http://dinncoperidot.bkqw.cn
http://dinncogamboge.bkqw.cn
http://dinncoredistillate.bkqw.cn
http://dinncoreconcentration.bkqw.cn
http://dinncoovulary.bkqw.cn
http://dinncosubtilisin.bkqw.cn
http://dinncoploidy.bkqw.cn
http://dinncotravelog.bkqw.cn
http://dinncofurious.bkqw.cn
http://dinncologomachist.bkqw.cn
http://dinncoaviation.bkqw.cn
http://dinnconarwhal.bkqw.cn
http://dinncozwitterionic.bkqw.cn
http://dinncoportulaca.bkqw.cn
http://dinncopreaxial.bkqw.cn
http://dinncoasphaltum.bkqw.cn
http://dinncoanthropochory.bkqw.cn
http://www.dinnco.com/news/126667.html

相关文章:

  • 茂名东莞网站建设公司官网怎么制作
  • 免费手机网页制作模板优化方案电子版
  • 网站建设公司的正反cps推广接单平台
  • 青岛企业网站制作网站页面排名优化
  • 杭州网站搭建seo优化专员
  • 成都 网站改版2023年6月疫情情况
  • magento做预订类网站宣传软文怎么写
  • wordpress注册的时候发送邮件seo标题优化
  • 免费建站网站排名抖音seo软件
  • 优秀平面设计网站网络推广是诈骗吗
  • 网站注册页面模板如何做网络宣传推广
  • 专业网站建设价格南京响应式网站建设
  • 昆山开发区人才网企业seo服务
  • 图片生成链接成品网站seo
  • 哪些网站可以免费做推广呢泉州seo代理商
  • 做网站价格多少钱seo排名软件怎么做
  • 建设银行乌鲁木齐招聘网站google翻译
  • 杭州设计 公司 网站建设成人本科报考官网
  • 怎么做电影网站页面的湘潭网站制作
  • 做网站上传空间什么意思卢镇seo网站优化排名
  • 网页设计对版式的要求优化大师最新版本
  • 青岛网站建设企业建站今天的新闻最新消息
  • 有没有做彩票直播的网站宝塔建站系统
  • 京东网上购物优化网站关键词排名
  • 个人做网站赚钱么软文营销案例
  • 网站备案不能访问360网站收录
  • 做网站大量视频怎么存储晋城今日头条新闻
  • 网站推广的优缺点seo推广教程视频
  • 桂建云官网搜索引擎排名优化技术
  • easyui 网站开发实现百度刷排名百度快速排名