Positional Artefacts Propagate Through Masked Language Model Embeddings
8283Authors
nan
Abstract
AbstractIn this work, we demonstrate that the contextualized word vectors derived from pretrained masked language model-based encoders share a common, perhaps undesirable pattern across layers. Namely, we find cases of persistent outlier neurons within BERT and RoBERTa’s hidden state vectors that consistently bear the smallest or largest values in said vectors. In an attempt to investigate the source of this information, we introduce a neuron-level analysis method, which reveals that the outliers are closely related to information captured by positional embeddings. We also pre-train the RoBERTa-base models from scratch and find that the outliers disappear without using positional embeddings. These outliers, we find, are the major cause of anisotropy of encoders’ raw vector spaces, and clipping them leads to increased similarity across vectors. We demonstrate this in practice by showing that clipped vectors can more accurately distinguish word senses, as well as lead to better sentence embeddings when mean pooling. In three supervised tasks, we find that clipping does not affect the performance.
Keywords
Full Content
Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 5312–5327 August 1–6, 2021. ©2021 Association for Computational Linguistics 5312 Positional Artefacts Propagate Through Masked Language Model Embeddings Ziyang Luo1∗, Artur Kulmizev1, Xiaoxi Mao2 1 Department of Linguistics and Philology, Uppsala University, Sweden 2 Fuxi AI Lab, NetEase Inc., Hangzhou, China Ziyang.Luo.9588@student.uu.se, artur.kulmizev@lingfil.uu.se maoxiaoxi@corp.netease.com Abstract In this work, we demonstrate that the contex- tualized word vectors derived from pretrained masked language model-based encoders share a common, perhaps undesirable pattern across layers. Namely, we find cases of persistent outlier neurons within BERT and RoBERTa’s hidden state vectors that consistently bear the smallest or largest values in said vectors. In an attempt to investigate the source of this in- formation, we introduce a neuron-level anal- ysis method, which reveals that the outliers are closely related to information captured by positional embeddings. We also pre-train the RoBERTa-base models from scratch and find that the outliers disappear without using posi- tional embeddings. These outliers, we find, are the major cause of anisotropy of encoders’ raw vector spaces, and clipping them leads to in- creased similarity across vectors. We demon- strate this in practice by showing that clipped vectors can more accurately distinguish word senses, as well as lead to better sentence em- beddings when mean pooling. In three super- vised tasks, we find that clipping does not af- fect the performance. 1 Introduction A major area of NLP research in the deep learn- ing era has concerned the representation of words in low-dimensional, continuous vector spaces. Traditional methods for achieving this have in- cluded word embedding models such as Word2Vec (Mikolov et al., 2013), GloVe (Pennington et al., 2014), and FastText (Bojanowski et al., 2017). However, though influential, such approaches all share a uniform pitfall in assigning a single, static vector to a word type. Given that the vast major- ity of words are polysemous (Klein and Murphy, 2001), static word embeddings cannot possibly rep- resent a word’s changing meaning in context. ∗ Work partly done during internship at NetEase Inc.. In recent years, deep language models, like ELMo (Peters et al., 2018), BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019b), have achieved great success across many NLP tasks. Such models introduce a new type of word vectors, deemed the contextualized variety, where the repre- sentation is computed with respect to the context of the target word. Since these vectors are sensitive to context, they can better address the polysemy problem that hinders traditional word embeddings. Indeed, studies have shown that replacing static embeddings (e.g. word2vec) with contextualized ones (e.g. BERT) can benefit many NLP tasks, including constituency parsing (Kitaev and Klein, 2018), coreference resolution (Joshi et al., 2019) and machine translation (Liu et al., 2020). However, despite the major success in deploy- ing these representations across linguistic tasks, there remains little understanding about informa- tion embedded in contextualized vectors and the mechanisms that generate them. Indeed, an …
Content truncated to 500 words
Labeled Text
AbstractIn this work, we demonstrate that the contextualized word vectors derived from pretrained masked language model-based encoders share a common, perhaps undesirable pattern across layers. Namely, we find cases of persistent outlier neurons within BERT and RoBERTa’s hidden state vectors that consistently bear the smallest or largest values in said vectors. In an attempt to investigate the source of this information, we introduce a neuron-level analysis method, which reveals that the outliers are closely related to information captured by positional embeddings. We also pre-train the RoBERTa-base models from scratch and find that the outliers disappear without using positional embeddings. These outliers, we find, are the major cause of anisotropy of encoders’ raw vector spaces, and clipping them leads to increased similarity across vectors. We demonstrate this in practice by showing that clipped vectors can more accurately distinguish word senses, as well as lead to better sentence embeddings when mean pooling. In three supervised tasks, we find that clipping does not affect the performance.
Publication Details
- Paper ID:
- 8283
- Year:
- 2021
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan