Context Analysis for Pre-trained Masked Language Models
32145Authors
nan
Abstract
AbstractPre-trained language models that learn contextualized word representations from a large un-annotated corpus have become a standard component for many state-of-the-art NLP systems. Despite their successful applications in various downstream NLP tasks, the extent of contextual impact on the word representation has not been explored. In this paper, we present a detailed analysis of contextual impact in Transformer- and BiLSTM-based masked language models. We follow two different approaches to evaluate the impact of context: a masking based approach that is architecture agnostic, and a gradient based approach that requires back-propagation through networks. The findings suggest significant differences on the contextual impact between the two model architectures. Through further breakdown of analysis by syntactic categories, we find the contextual impact in Transformer-based MLM aligns well with linguistic intuition. We further explore the Transformer attention pruning based on our findings in contextual analysis.
Keywords
Full Content
Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3789–3804 November 16 - 20, 2020. c⃝2020 Association for Computational Linguistics 3789 Context Analysis for Pre-trained Masked Language Models Yi-An Lai Garima Lalwani Yi Zhang AWS AI HLT {yianl,glalwani,yizhngn}@amazon.com Abstract Pre-trained language models that learn contex- tualized word representations from a large un- annotated corpus have become a standard com- ponent for many state-of-the-art NLP systems. Despite their successful applications in vari- ous downstream NLP tasks, the extent of con- textual impact on the word representation has not been explored. In this paper, we present a detailed analysis of contextual impact in Transformer- and BiLSTM-based masked lan- guage models. We follow two different ap- proaches to evaluate the impact of context: a masking based approach that is architecture agnostic, and a gradient based approach that requires back-propagation through networks. The findings suggest significant differences on the contextual impact between the two model architectures. Through further breakdown of analysis by syntactic categories, we find the contextual impact in Transformer-based MLM aligns well with linguistic intuition. We fur- ther explore the Transformer attention pruning based on our findings in contextual analysis. 1 Introduction Pre-trained masked language models (MLM) such as BERT (Devlin et al., 2019) and ALBERT (Lan et al., 2019) have set state-of-the-art performance on a broad range of NLP tasks. The success is often attributed to their ability to capture complex syntac- tic and semantic characteristics of word use across diverse linguistic contexts (Peters et al., 2018). Yet, how these pre-trained MLMs make use of the con- text remains largely unanswered. Recent studies have started to inspect the linguis- tic knowledge learned by pre-trained LMs such as word sense (Liu et al., 2019a) , syntactic parse trees (Hewitt and Manning, 2019), and semantic rela- tions (Tenney et al., 2019). Others directly analyze model’s intermediate representations and attention weights to understand how they work (Kovaleva et al., 2019; Voita et al., 2019). While previous works either assume access to model’s internal states or take advantage of model’s special structures such as self-attention maps, these analysis are difficult to generalize as the architec- tures evolve. In this paper, our work complements these previous efforts and provides a richer under- standing of how pre-trained MLMs leverage con- text without assumptions on architectures. We aim to answer following questions: (i) How much con- text is relevant to and used by pre-trained MLMs when composing representations? (ii) How far do MLMs look when leveraging context? That is, what are their effective context window sizes? We further define a target word’s essential context as the set of context words whose absence will make the MLM indiscriminate of its prediction. We analyze linguistic characteristics of these essen- tial context words to better understand how MLMs manage context. We investigate the contextual impacts in MLMs via two approaches. First, we propose the context perturbation analysis methodology that gradually masks out context words following a predetermined procedure and measures the change in the target word probability. For example, we …
Content truncated to 500 words
Labeled Text
AbstractPre-trained language models that learn contextualized word representations from a large un-annotated corpus have become a standard component for many state-of-the-art NLP systems. Despite their successful applications in various downstream NLP tasks, the extent of contextual impact on the word representation has not been explored. In this paper, we present a detailed analysis of contextual impact in Transformer- and BiLSTM-based masked language models. We follow two different approaches to evaluate the impact of context: a masking based approach that is architecture agnostic, and a gradient based approach that requires back-propagation through networks. The findings suggest significant differences on the contextual impact between the two model architectures. Through further breakdown of analysis by syntactic categories, we find the contextual impact in Transformer-based MLM aligns well with linguistic intuition. We further explore the Transformer attention pruning based on our findings in contextual analysis.
Publication Details
- Paper ID:
- 32145
- Year:
- 2020
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan