Quantifying the Contextualization of Word Representations with Semantic Class Probing

32372

Authors

nan

Abstract

AbstractPretrained language models achieve state-of-the-art results on many NLP tasks, but there are still many open questions about how and why they work so well. We investigate the contextualization of words in BERT. We quantify the amount of contextualization, i.e., how well words are interpreted in context, by studying the extent to which semantic classes of a word can be inferred from its contextualized embedding. Quantifying contextualization helps in understanding and utilizing pretrained language models. We show that the top layer representations support highly accurate inference of semantic classes; that the strongest contextualization effects occur in the lower layers; that local context is mostly sufficient for contextualizing words; and that top layer representations are more task-specific after finetuning while lower layer representations are more transferable. Finetuning uncovers task-related features, but pretrained knowledge about contextualization is still well preserved.

Keywords

nan

Full Content

Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1219–1234 November 16 - 20, 2020. c⃝2020 Association for Computational Linguistics 1219 Quantifying the Contextualization of Word Representations with Semantic Class Probing Mengjie Zhao†, Philipp Dufter†, Yadollah Yaghoobzadeh‡, Hinrich Schütze† † CIS, LMU Munich, Germany ‡ Microsoft Turing, Montréal, Canada mzhao@cis.lmu.de Abstract Pretrained language models achieve state-of- the-art results on many NLP tasks, but there are still many open questions about how and why they work so well. We investigate the con- textualization of words in BERT. We quantify the amount of contextualization, i.e., how well words are interpreted in context, by studying the extent to which semantic classes of a word can be inferred from its contextualized em- bedding. Quantifying contextualization helps in understanding and utilizing pretrained lan- guage models. We show that the top layer rep- resentations support highly accurate inference of semantic classes; that the strongest contex- tualization effects occur in the lower layers; that local context is mostly sufficient for con- textualizing words; and that top layer repre- sentations are more task-specific after finetun- ing while lower layer representations are more transferable. Finetuning uncovers task-related features, but pretrained knowledge about con- textualization is still well preserved. 1 Introduction Pretrained language models like ELMo (Peters et al., 2018a), BERT (Devlin et al., 2019), and XL- Net (Yang et al., 2019) are top performers in NLP because they learn contextualized representations, i.e., representations that reflect the interpretation of a word in context as opposed to its general mean- ing, which is less helpful in solving NLP tasks. As stated, pretrained language models contextualize words, is clear qualitatively; there has been lit- tle work on investigating contextualization, i.e., to which extent a word can be interpreted in context, quantitatively. We use BERT (Devlin et al., 2019) as our pre- trained language model and quantify contextual- ization by investigating how well BERT infers se- mantic classes (s-classes) of a word in context, e.g., the s-class organization for “Apple" in “Apple stock rises" vs. the s-class food in “Apple juice is healthy". We use s-class inference as a proxy for contextualization since accurate s-class inference reflects a successful contextualization of a word: an effective interpretation of the word in context. We adopt the methodology of probing (Adi et al., 2016; Shi et al., 2016; Belinkov et al., 2017; Liu et al., 2019; Tenney et al., 2019b; Be- linkov and Glass, 2019; Hewitt and Liang, 2019; Yaghoobzadeh et al., 2019): diagnostic classifiers are applied to pretrained language model embed- dings to determine whether they encode desired syntactic or semantic features. By probing for s-classes we quantify directly where and how contextualization happens in BERT. E.g., we find that the strongest contextual inter- pretation effects occur in the lower layers and that the top two layers contribute little to contextual- ization. We also investigate how the amount of context available affects contextualization. In addition, since pretrained language models in practice need to be finetuned on downstream tasks (Devlin et al., 2019; Peters et …

Content truncated to 500 words

Labeled Text

AbstractPretrained language models achieve state-of-the-art results on many NLP tasks, but there are still many open questions about how and why they work so well. We investigate the contextualization of words in BERT. We quantify the amount of contextualization, i.e., how well words are interpreted in context, by studying the extent to which semantic classes of a word can be inferred from its contextualized embedding. Quantifying contextualization helps in understanding and utilizing pretrained language models. We show that the top layer representations support highly accurate inference of semantic classes; that the strongest contextualization effects occur in the lower layers; that local context is mostly sufficient for contextualizing words; and that top layer representations are more task-specific after finetuning while lower layer representations are more transferable. Finetuning uncovers task-related features, but pretrained knowledge about contextualization is still well preserved.

Publication Details

Paper ID:
32372
Year:
2020
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan