All Bark and No Bite: Rogue Dimensions in Transformer Language Models Obscure Representational Quality

William Timkey, Marten van Schijndel
9/9/2021
cs.CLcs.LG
transformer-attention

Official code: wtimkey/rogue-dimensions (11 stars, Jupyter Notebook, Apache-2.0, last commit 2021-11-15).

Abstract

Similarity measures are a vital tool for understanding how language models represent and process language. Standard representational similarity measures such as cosine similarity and Euclidean distance have been successfully used in static word embedding models to understand how words cluster in semantic space.

Show full abstract

Recently, these measures have been applied to embeddings from contextualized models such as BERT and GPT-2. In this work, we call into question the informativity of such measures for contextualized language models. We find that a small number of rogue dimensions, often just 1-3, dominate these measures. Moreover, we find a striking mismatch between the dimensions that dominate similarity measures and those which are important to the behavior of the model. We show that simple postprocessing techniques such as standardization are able to correct for rogue dimensions and reveal underlying representational quality. We argue that accounting for rogue dimensions is essential for any similarity-based analysis of contextual language models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

replication code for EMNLP 2021 paper

112Jupyter NotebookAug 30, 20215 years agoApache-2.0

Similar Papers

Cite this paper

@article{timkey2021bark,
  title  = {All Bark and No Bite: Rogue Dimensions in Transformer Language Models Obscure Representational Quality},
  author = {William Timkey and Marten van Schijndel},
  year   = {2021},
  eprint = {2109.04404},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.04404}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2109.04404.svg)](https://codeofpaper.com/paper/2109.04404)

Discussion