XLNET

 
 

 
 

But the AE language model also has its disadvantages. It uses the [MASK] in the pretraining, but this kind of artificial symbols are absent from the real data at finetuning time, resulting in a pretrain-finetune discrepancy.Another disadvantage of [MASK] is that it assumes the predicted (masked) tokens are independent of each other given the unmasked tokens. For example, we have a sentence "It shows that the housing crisis was turned into a banking crisis". We mask "banking" and "crisis". Attention here, we know the masked "banking" and "crisis" contains implicit relation to each other. But AE model is trying to predict "banking" given unmasked tokens, and predict "crisis" given unmasked tokens separately. It ignores the relation between "banking" and "crisis". In other words, it assumes the predicted (masked) tokens are independent of each other. But we know the model should learn such correlation among the predicted (masked) tokens to predict one of the tokens.

 
 

 
 

 
 

A traditional language model would predict the tokens in the order

"I", "like", "cats", "more", "than", "dogs"

where each token uses all previous tokens as context.

In permutation language modeling, the order of prediction is not necessarily left to right and is sampled randomly instead. For instance, it could be

"cats", "than", "I", "more", "dogs", "like"

where "than" would be conditioned on seeing "cats", "I" would be conditioned on seeing "catsthan" and so on. The following animation demonstrates this.

 
 

输入看上去仍然是x1,x2,x3,x4,可以通过不同的掩码矩阵,让当前单词Xi只能看到被排列组合后的顺序x3->x2->x4->x1中自己前面的单词

 
 

 
 

 
 

 
 

Robertra

 
 

与BERT的差别

Facebook的研究人员发现超参数选择对BERT的最终结果有重大影响,因此他们重新研究了BERT的预训练模型,测量了不同超参数和训练集大小的影响,结果发现BERT存在明显的训练不足。

经过调整后,BERT可以达到或超过其后发布的每个模型的性能,这些结果突出了之前被忽视的设计选择的重要性,

RoBERTa与BERT的不同之处在于,它依赖于预训练大量数据和改变训练数据的mask模式,而且RoBERTa删除了下一句预测(NSP)。

RoBERTa的修改很简单,包括:

  1. 更长时间的训练时间,更大的batch,更多的数据;
  2. 删除下一句预测(NSP)目标;
  3. 在较长序列上进行训练;
  4. 动态改变用于训练数据的mask模式。(The original BERT implementation performed masking once during data preprocessing, resulting in a single static mask. To avoid using the same mask for each training instance in every epoch, training data was duplicated 10 times so that each sequence is masked in 10 different ways over the 40 epochs of training. Thus, each training sequence was seen with the same mask four times during training.)

 
 

参考:

 
 

https://zhuanlan.zhihu.com/p/75856238

https://towardsdatascience.com/what-is-xlnet-and-why-it-outperforms-bert-8d8fce710335

https://zhuanlan.zhihu.com/p/70257427

https://mlexplained.com/2019/06/30/paper-dissected-xlnet-generalized-autoregressive-pretraining-for-language-understanding-explained/

XLNet and Robertra的更多相关文章

  1. XLNet预训练模型,看这篇就够了!(代码实现)

    1. 什么是XLNet XLNet 是一个类似 BERT 的模型,而不是完全不同的模型.总之,XLNet是一种通用的自回归预训练方法.它是CMU和Google Brain团队在2019年6月份发布的模 ...

  2. 百度ERNIE 2.0强势发布!16项中英文任务表现超越BERT和XLNet

    2019年3月,百度正式发布NLP模型ERNIE,其在中文任务中全面超越BERT一度引发业界广泛关注和探讨. 今天,经过短短几个月时间,百度ERNIE再升级.发布持续学习的语义理解框架ERNIE 2. ...

  3. NLP中的预训练语言模型(三)—— XL-Net和Transformer-XL

    本篇带来XL-Net和它的基础结构Transformer-XL.在讲解XL-Net之前需要先了解Transformer-XL,Transformer-XL不属于预训练模型范畴,而是Transforme ...

  4. XLNet原理探究

    1. 前言 XLNet原文链接是CMU与谷歌大脑提出的全新NLP模型,在20个任务上超过了BERT的表现,并在18个任务上取得了当前最佳效果,包括机器问答.自然语言推断.情感分析和文档排序. 这篇新论 ...

  5. BERT、ERNIE以及XLNet学习记录

    主要是对 BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingtichu提出的BERT 清华 ...

  6. 自然语言处理(三) 预训练模型:XLNet 和他的先辈们

    预训练模型 在CV中,预训练模型如ImagNet取得很大的成功,而在NLP中之前一直没有一个可以承担此角色的模型,目前,预训练模型如雨后春笋,是当今NLP领域最热的研究领域之一. 预训练模型属于迁移学 ...

  7. Transformer 和 Transformer-XL——从基础框架理解BERT与XLNet

    目录写在前面1. Transformer1.1 从哪里来?1.2 有什么不同?1.2.1 Scaled Dot-Product Attention1.2.2 Multi-Head Attention1 ...

  8. XLNet:运行机制及和Bert的异同比较

    这两天,XLNet貌似也引起了NLP圈的极大关注,从实验数据看,在某些场景下,确实XLNet相对Bert有很大幅度的提升.就像我们之前说的,感觉Bert打开两阶段模式的魔法盒开关后,在这条路上,会有越 ...

  9. 3分钟了解GPT Bert与XLNet的差异

    译者 | Arno 来源 | Medium XLNet是一种新的预训练模型,在20项任务中表现优于BERT,且有大幅度的提升. 这是什么原因呢? 在不了解机器学习的情况下,不难估计我们捕获的上下文越多 ...

随机推荐

  1. wordpress调用指定tag的文章

    前面的文章wordpress调用指定分类文章如何实现有网友回复要如何调用指定tag的文章,原理是类似的,有两种方法,随ytkah一起来看看 1.第一种 <?php $args=array( 't ...

  2. hdu2068-RPG的错排-(dp递推式)

    去年看错排公式,死都看不懂,基础扎实之后再来看就略懂了. 公式: dp[ n ] = ( n-1 ) * ( dp[n-1] + dp[n-2] ) 解析公式:比如有n个元素,各对应n个正确位置,dp ...

  3. Git git2.8.1客户端安装教程

    Git git2.8.1客户端安装教程 一 Git介绍 git是一款免费.开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. 分布式相比于集中式的最大区别在于开发者可以提交到本地,每个开 ...

  4. [React] Fetch Data with React Suspense

    Let's get started with the simplest version of data fetching with React Suspense. It may feel a litt ...

  5. 5.学习springmvc响应json数据

    一.配置不过滤静态资源文件:用来访问webapp中js,css,images文件 1.修改springmvc.xml <!--配置前端控制器,用于设置哪些资源不拦截--> <mvc: ...

  6. 13--网页,网站,微信公众号基础入门(PHP获取网页的get请求)

    https://www.cnblogs.com/yangfengwu/p/11148976.html 大家在访问网页的时候有没有注意一件事情 现在咱来看这种哈 现在咱做个功能哈,类似于这样 长话短说 ...

  7. hive基础知识二

    1. Hive的分区表 1.1 hive的分区表的概念 在文件系统上建立文件夹,把表的数据放在不同文件夹下面,加快查询速度. 1.2 hive分区表的构建 创建一个分区字段的分区表 hive> ...

  8. linux命令之------Mv命令

    Mv命令 1)作用:用来为文件或目录改名/或将文件或目录一如其他位置 2)-i:若指定目录已有同名文件,则先询问是否覆盖旧文件: 3)-f:在mv操作要覆盖某已有的目标文件时,不给任何指示: 4)案例 ...

  9. X86 下的SSDT HOOK

    目录 SSDTHOOK 1.SSDTHOOK 原理. 1.x32下的SSDT HOOK 2.SSDT HOOK代码 3.结果 4.总结 SSDTHOOK 1.SSDTHOOK 原理. x32下,直接获 ...

  10. [技术博客]Pyqt5实现Widget内部拖拽

    Pyqt5实现Widget内部拖拽 ​ 在本次项目的beta迭代中,程序需要在需要在QListWidget内实现对于添加后的测试序列,可以通过鼠标拖拽的方式来移动测试序列,方便用户操作. 允许拖拽 ​ ...