Skip to main content
QUICK REVIEW

[Paper Review] Open Sesame: Getting Inside BERT's Linguistic Knowledge

Yongjie Lin, Yi Chern Tan|arXiv (Cornell University)|Jun 4, 2019
Neurobiology of Language and BilingualismNeuroscience27 references15 citations
TL;DR

This paper investigates how BERT encodes syntactic structure by combining diagnostic classifiers and a novel attention-based confusion score metric. It finds that BERT progressively shifts from encoding linear, positional information in lower layers to increasingly abstract, hierarchical syntactic representations in higher layers, with self-attention mechanisms showing sensitivity to subject-verb agreement and reflexive anaphora—though not with full human-like categorical precision.

ABSTRACT

How and to what extent does BERT encode syntactically-sensitive hierarchical information or positionally-sensitive linear information? Recent work has shown that contextual representations like BERT perform well on tasks that require sensitivity to linguistic structure. We present here two studies which aim to provide a better understanding of the nature of BERT's representations. The first of these focuses on the identification of structurally-defined elements using diagnostic classifiers, while the second explores BERT's representation of subject-verb agreement and anaphor-antecedent dependencies through a quantitative assessment of self-attention vectors. In both cases, we find that BERT encodes positional information about word tokens well on its lower layers, but switches to a hierarchically-oriented encoding on higher layers. We conclude then that BERT's representations do indeed model linguistically relevant aspects of hierarchical structure, though they do not appear to show the sharp sensitivity to hierarchical structure that is found in human processing of reflexive anaphora.

Motivation & Objective

  • To understand how BERT representations encode syntactic structure versus linear word order.
  • To investigate whether BERT captures hierarchical dependencies such as subject-verb agreement and reflexive anaphora.
  • To evaluate the role of self-attention in encoding linguistic structure beyond surface-level word order.
  • To develop a quantitative metric for assessing BERT’s sensitivity to syntactic distortions using attention weights.
  • To determine at which network layers BERT transitions from positional to hierarchical encoding.

Proposed method

  • Trained diagnostic classifiers using a 'poverty of the stimulus' paradigm to distinguish between linear and hierarchical solutions in BERT representations.
  • Proposed a confusion score metric based on self-attention weights to quantify BERT’s response to syntactic distractors in agreement and anaphora tasks.
  • Used linear models to analyze the effects of syntactic structure (e.g., relative clauses vs. prepositional phrases) and grammatical feature matching on confusion scores.
  • Analyzed layer-wise attention patterns across BERT’s transformer blocks to track the evolution of structural encoding.
  • Compared confusion scores across different distractor types (grammatically accessible vs. inaccessible, matching vs. mismatching features) to assess attention selectivity.
  • Evaluated performance on subject-verb agreement and reflexive anaphora tasks with controlled syntactic distortions to isolate structural sensitivity.

Experimental results

Research questions

  • RQ1To what extent do BERT representations encode hierarchical syntactic structure versus linear word order?
  • RQ2How does BERT’s attention mechanism respond to syntactic distractors in subject-verb agreement and reflexive anaphora tasks?
  • RQ3At which layers of BERT does the representation shift from positional to hierarchical encoding?
  • RQ4How do grammatical features like number and gender influence BERT’s attention patterns in agreement and anaphora resolution?
  • RQ5Is BERT’s attention mechanism sensitive to structural complexity, such as embedding within relative clauses versus prepositional phrases?

Key findings

  • BERT’s lower layers encode strong positional and sequential information, which diminishes in higher layers.
  • Higher layers show increasing sensitivity to hierarchical syntactic structure, with representations becoming more abstract and structure-oriented.
  • The confusion score metric revealed that BERT’s attention is sensitive to syntactic structure: distractors in relative clauses cause more confusion than those in prepositional phrases.
  • Grammatically accessible distractors increase confusion more than inaccessible ones, and feature-matching distractors have a stronger effect, indicating sensitivity to grammatical features.
  • Confusion scores for both subject-verb agreement and reflexive anaphora decrease with increasing layer depth, indicating progressive abstraction of syntactic structure.
  • A notable spike in confusion at layer 4 coincides with the degradation of linear information, suggesting a transition point in representation composition.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.