Large pre-trained neural networks such as BERT have had great recent success in NLP, motivating a growing body of research investigating what aspects of language they are able to learn from unlabeled data. Most recent analysis has focused on model outputs (e.g., language model surprisal) or internal vector representations (e.g., probing classifiers). Complementary to these works, we propose methods for analyzing the attention mechanisms of pre-trained models and apply them to BERT. BERT's attention heads exhibit patterns such as attending to delimiter tokens, specific positional offsets, or broadly attending over the whole sentence, with heads in the same layer often exhibiting similar behaviors. We further show that certain attention heads correspond well to linguistic notions of syntax and coreference. For example, we find heads that attend to the direct objects of verbs, determiners of nouns, objects of prepositions, and coreferent mentions with remarkably high accuracy. Lastly, we propose an attention-based probing classifier and use it to further demonstrate that substantial syntactic information is captured in BERT's attention.


翻译:最近的分析侧重于模型输出(例如语言模型超正)或内部矢量代表(例如标定分类器)。作为对这些工作的补充,我们提出了分析预先培训模型的注意机制的方法,并将其应用到BERT。BERT的注意负责人的注意力展示模式,如参加定界标牌、特定位置偏移,或广泛参加整个句子,同一层的负责人往往表现出相似的行为。我们进一步表明,某些关注对象与语法和共同参照的语言概念非常吻合。例如,我们发现那些关注动词的直接物体的负责人,确定名词、预置对象和核心人物的确定者,并以非常高的精确度提及。最后,我们建议以关注为基点的标本分类器,并使用它进一步表明大量同步信息在BERT的注意力中被捕获。

4
下载
关闭预览

相关内容

BERT全称Bidirectional Encoder Representations from Transformers,是预训练语言表示的方法,可以在大型文本语料库(如维基百科)上训练通用的“语言理解”模型,然后将该模型用于下游NLP任务,比如机器翻译、问答。
ExBert — 可视化分析Transformer学到的表示
专知会员服务
30+阅读 · 2019年10月16日
强化学习最新教程,17页pdf
专知会员服务
166+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
89+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
96+阅读 · 2019年10月9日
使用BERT做文本摘要
专知
23+阅读 · 2019年12月7日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
【资源推荐】情感分析资源列表
专知
31+阅读 · 2019年3月20日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
15+阅读 · 2018年12月24日
笔记 | Sentiment Analysis
黑龙江大学自然语言处理实验室
10+阅读 · 2018年5月6日
Visualizing and Measuring the Geometry of BERT
Arxiv
7+阅读 · 2019年10月28日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
4+阅读 · 2019年9月5日
Arxiv
12+阅读 · 2019年2月28日
Conditional BERT Contextual Augmentation
Arxiv
8+阅读 · 2018年12月17日
Arxiv
25+阅读 · 2017年12月6日
VIP会员
相关论文
Visualizing and Measuring the Geometry of BERT
Arxiv
7+阅读 · 2019年10月28日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
4+阅读 · 2019年9月5日
Arxiv
12+阅读 · 2019年2月28日
Conditional BERT Contextual Augmentation
Arxiv
8+阅读 · 2018年12月17日
Arxiv
25+阅读 · 2017年12月6日
Top
微信扫码咨询专知VIP会员