定义
- \(p(w_1,...,w_n)=\prod_{i=1,...,n}p(w_i|w1,...,w_{i-1})\),\(p(w_i|w1,...,w_{i-1})\)通常是一个(循环)神经网络
- 2018年之前用于文本生成,如机器翻译和语音识别;2018年之后,在大量数据上预训练,在任何特定任务上精调
ELMo[2]
- 训练两个语言模型,从左到右和从右到左;从网络中抽取上下文化向量
- 上下文词嵌入:\(f(w_k|w_1,...,w_n)\in R^N\)
- \(f(\text{play}|\text{Elmo and Cookie Monster play a game.})\ne f(\text{play}|\text{The Broadway play premiered yesterday.})\)
语言模型预训练
GPT[3]
- 训练transformer语言模型(预训练一个常见架构)
- 在更长的文本上训练,具有自注意力,能很好地进行扩展(如GPT-2和GPT-3),不是双向的
BERT[4]
- 训练遮蔽语言模型,联合建模左右上下文
- 引入新任务:预测遗失/遮蔽词
- 双向推理对许多任务是重要的
RoBERTa[5]
参考资料
- [1]AAAI 2021 Tutorial Recent Advances in LM Pretraining
- [2] 2018 | Deep contextualized word representations | Matthew E. Peters et al.
- [3] 2018 | Improving Language Understanding by Generative Pre-Training | Alec Radford et al.
- [4] 2018 | BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding | Jacob Devlin et al.
- [5] 2019 | RoBERTa: A Robustly Optimized BERT Pretraining Approach | Yinhan Liu et al.
语言模型
原文:https://www.cnblogs.com/yao1996/p/14503002.html