arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1906.04341cs.CL
收藏

BERT关注什么?BERT注意力分析

What Does BERT Look At? An Analysis of BERT's Attention

Stanford University(斯坦福大学);Facebook AI Research(Facebook人工智能研究院)

Kevin Clark, Urvashi Khandelwal, Omer Levy, Christopher D. Manning

摘要:

像BERT这样的大型预先训练的神经网络最近在NLP领域取得了巨大的成功,这激发了越来越多的研究,研究它们能够从未标记的数据中学习语言的哪些方面。最近的分析主要集中在模型输出上(例如,语言模型语法)或内部向量表示(例如,探测分类器)。作为对这些工作的补充,我们提出了分析预训练模型的注意力机制的方法,并将其应用于BERT。BERT的注意头表现出的模式,如注意到标记,特定的位置偏移,或广泛地关注整个句子,在同一层的头往往表现出类似的行为。我们进一步表明,某些注意头对应的句法和共指的语言概念。例如,我们发现中心语在处理动词的直接宾语、名词的限定词、介词的宾语和共指提及时具有非常高的准确性。最后,我们提出了一个基于注意的探测分类器,并使用它来进一步证明,大量的句法信息被捕获在BERT的注意。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑