NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Does BERT really agree ? Fine-grained Analysis of Lexical Dependence on a Syntactic Task

Karim Lasri, Alessandro Lenci, Thierry PoibeauACL 2022

Abstract

Subject-verb agreement is a hallmark of syntactic competence in linguistics. While BERT demonstrates high accuracy on standard agreement benchmarks, this study investigates whether this performance stems from abstract hierarchical rules or lexical heuristics. By evaluating BERT on "nonce" sentences—grammatically correct but semantically meaningless—we reveal that the model's syntactic knowledge is surprisingly brittle. Our results show that BERT relies heavily on semantic common sense, linear proximity, and memorized patterns from its training data, with performance collapsing toward chance levels on complex structures when semantic cues are removed.

Introduction

In natural language, subject-verb number agreement (e.g., "The keys to the cabinet are...") requires identifying the true subject while ignoring "attractors"—nouns that are linearly closer to the verb but syntactically irrelevant. Previous research suggested that models like BERT had mastered these abstract hierarchical rules. However, this paper challenges that assumption by asking: Is BERT utilizing abstract syntax, or is it merely performing sophisticated pattern-matching on specific word combinations? To test this, we employ "nonce" sentences, which preserve grammatical structure while stripping away semantic meaning, forcing the model to rely solely on its syntactic understanding.

Methodology

We conducted a fine-grained analysis of BERT-base using two primary experimental frameworks:

  1. Semantic Sensitivity Analysis: We compared BERT’s performance across three datasets: M&L (manually crafted meaningful sentences), WIKI (naturally occurring Wikipedia sentences matching specific templates), and NONCE (syntactically identical to M&L but with words replaced by random category-matched terms). This dataset is balanced to ensure a 50% chance level.
  2. One-Word Replacement Tests: To identify which words BERT "cares" about most, we systematically replaced words at specific positions (subject, attractor, or verb) and measured the resulting impact on the model's accuracy.

The core task involved "masking" the target verb and requiring BERT to predict the correct singular or plural form based on the sentential context.

Results and Discussion

Our analysis reveals that BERT's syntactic proficiency is highly dependent on lexical and semantic context.

The "Nonce Crash"

While BERT maintains high accuracy on simple sentences without attractors (e.g., "The boy laughs") even in the nonce condition, its performance on complex structures is far less robust. As shown in Figure 1, when faced with structures like object relative clauses (Obj. RC Across), BERT’s accuracy on nonce sentences drops precipitously, often reaching or falling below the 50% chance level. This suggests that BERT uses semantic "common sense" as a crutch to navigate syntax in standard text.

Accuracy across different syntactic structures and datasets.

Proximity and Lexical Heuristics

In the one-word replacement tests, we observed that BERT is highly sensitive to words that are linearly adjacent to the target verb, regardless of their syntactic role. For example, in the sensitivity analysis for a sentential complement structure (Figure 2), replacing the word immediately preceding the target verb ("girls") has a more pronounced impact on accuracy than replacing the actual subject ("boy").

Word-level sensitivity for a sentential complement structure (B).

These findings imply that BERT uses "semi-lexicalized heuristics"—shortcuts based on specific words and their immediate neighbors—rather than universal grammar rules. Furthermore, BERT consistently performs better on the WIKI dataset than on the M&L dataset, indicating a reliance on memorized word sequences from its pre-training phase.

Conclusion

This study demonstrates that BERT’s apparent syntactic mastery is largely driven by lexical dependencies and semantic cues rather than a deep understanding of abstract hierarchical structures. While the model succeeds on standard benchmarks, its failure on nonce sentences reveals a fundamental brittleness. Future research should investigate whether larger models or different architectures can overcome these linear traps and if human error patterns on similar meaningless stimuli mirror these computational limitations.

Summary updated

BibTeX
@inproceedings{lasri2022does,
  author = {Karim Lasri and Alessandro Lenci and Thierry Poibeau},
  title = {{Does BERT really agree ? Fine-grained Analysis of Lexical Dependence on a Syntactic Task}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.181},
}
Figure