Picking BERT's Brain: Probing for Linguistic Dependencies in Contextualized Embeddings Using Representational Similarity Analysis
This work provides a method for probing the linguistic information encoded in contextualized embeddings, which is important for researchers and developers working with large language models.
This paper investigates which aspects of context are encoded in BERT's contextualized embeddings using Representational Similarity Analysis (RSA). The authors demonstrate that BERT's embeddings reflect linguistic dependencies such as verb-subject, pronoun-antecedent, and sentence-head word relationships to a greater extent than less salient controls.
As the name implies, contextualized representations of language are typically motivated by their ability to encode context. Which aspects of context are captured by such representations? We introduce an approach to address this question using Representational Similarity Analysis (RSA). As case studies, we investigate the degree to which a verb embedding encodes the verb's subject, a pronoun embedding encodes the pronoun's antecedent, and a full-sentence representation encodes the sentence's head word (as determined by a dependency parse). In all cases, we show that BERT's contextualized embeddings reflect the linguistic dependency being studied, and that BERT encodes these dependencies to a greater degree than it encodes less linguistically-salient controls. These results demonstrate the ability of our approach to adjudicate between hypotheses about which aspects of context are encoded in representations of language.