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. [译] 揭秘 iOS 布局

    翻译自:Demystifying iOS Layout 在你刚开始开发 iOS 应用时,最难避免或者是调试的就是和布局相关的问题.通常这种问题发生的原因就是对于 view 何时真正更新的错误理解.想理 ...

  2. luogu_2831: 愤怒的小鸟

    洛谷2831:愤怒的小鸟(状压\(dp\)) 题意: 在二维平面上给定\(n\)个点\((1\leq n\leq18)\). 其中每个点用\((x_i,y_i)\)表示\((0<x_i,y_i& ...

  3. Cronicle 基于nodejs 的分布式任务调度工具

    Cronicle 是一款不多的分布式任务调度工具,基于nodejs 开发,同时包含看web UI,从官方介绍看到的UI还是 挺不错的,而且功能很丰富,值得试用下 参考资料 http://cronicl ...

  4. Linux(Contos7)下使用SSH远程安装MySQL 8.0.17 完整笔记

    1. 使用putty 配置远程服务器连接,登录服务器. 由于没有指定下载包 使用 yum install mysql-server  提示 未指定包,如: 2. 因为甲骨文的收购了Mysql并且对My ...

  5. Redis之eval+lua实现初步

    目录 目录 1 1. 前言 1 2. 执行方式 1 3. 执行过程 3 4. 使用原则 3 1. 前言 Redis的实现保证eval的执行是原子的,即使eval执行的lua超时,Redis也不会自动终 ...

  6. Vue绑定事件,双向数据绑定,只是循环没那么简单

    v-on对象处理 <p @mouseover = "doTish" @mouseout = "doThat"> 对象形式 </p> &l ...

  7. js 创建xml元素

    function createXML(pathData) { var xmlDOM = createXMLDOM(); //参考:http://iceworldvip.blog.51cto.com/5 ...

  8. 在 Mac、Linux、Windows 下Go交叉编译

    Golang 支持交叉编译,在一个平台上生成另一个平台的可执行程序,最近使用了一下,非常好用,这里备忘一下. Mac 下编译 Linux 和 Windows 64位可执行程序 CGO_ENABLED= ...

  9. cv2 的用法

    转载:https://www.cnblogs.com/shizhengwen/p/8719062.html 一.读入图像 使用函数cv2.imread(filepath,flags)读入一副图片 fi ...

  10. [技术博客]nginx 部署 apt 源

    [技术博客] nginx 部署 apt 源 出于各种各样的原因, 有时需要自己配置apt源, 比如发布自己编写的debian软件包, 内网中只有一台电脑可以访问外网,或者在本地配置自己的apt源.我们 ...