Does BERT Know that the IS-A Relation Is Transitive?

Ruixi Lin, Hwee Tou NgACL 2022 · OpenReview

Abstract

While BERT is often hailed for its surprisingly deep knowledge of language, its ability to maintain basic logical consistency is less certain. This paper investigates whether BERT’s internal representations respect the transitivity of the IS-A relation (hypernymy). By probing BERT-base using WordNet-derived data, the study demonstrates that while the model can identify individual relationships, it fails to consistently "connect the dots"—predicting the transitive shortcut (A is-a C) only about 82% of the time when it has already identified the intermediate steps (A is-a B and B is-a C).

Introduction

Deep learning models have revolutionized NLP, but researchers still grapple with whether these models truly "understand" the hierarchy of language or if they are simply exploiting surface-level statistical patterns. A cornerstone of human reasoning is the IS-A relation, which is inherently transitive. For example, if a poodle is a dog, and a dog is a mammal, one logically concludes a poodle is a mammal. This paper investigates whether BERT’s internal representations respect this logical constraint, as a lack of consistency suggests that its ability to perform complex machine inference remains brittle.

Methodology

The authors employ a minimalist probing strategy to measure what BERT "knows" rather than what a complex classifier can "learn" from BERT's noise. They use a simple 1-Nearest Neighbor (1-NN) classifier based on contextualized embeddings.

  1. Contextualized Embeddings: Final hidden states are extracted from BERT-base for specific words within example sentences provided by WordNet.
  2. Relation Representation: To represent a pair (A, B), the embeddings of word A and word B are concatenated.
  3. Probing: The 1-NN classifier compares a test pair against the training set using Euclidean distance to predict if an IS-A relation exists.
Figure 1: The probing setup extracts embeddings from context sentences to map them to WordNet's hierarchical structure.

Key Insights and Results

The study reveals a significant "Consistency Gap." While BERT is reasonably good at identifying IS-A relations in isolation (achieving 72.6% accuracy across all pairs), its logic is leaky.

Transitivity Performance

The core of the experiment involves "3-tuples" (A, B, C) where A → B and B → C are true. The researchers measured the conditional probability: if BERT correctly predicts the first two links, does it also predict the transitive link (A → C)?

Table 1: Accuracy of individual links versus the conditional probability of transitive completion.

As shown in the results, when BERT correctly predicted that A is-a B and B is-a C, it correctly predicted A is-a C only 82.4% of the time. This indicates that even when the model "knows" the components of a logical chain, it fails to complete the triangle nearly 18% of the time.

The Impact of Hierarchy Depth

BERT's accuracy is also sensitive to the "distance" between concepts. The model is more accurate at identifying relations with fewer "hops" in the WordNet hierarchy (1–4 hops) than more distant, abstract ones (5–6 hops). This may be due to data imbalance; WordNet example sentences are heavily skewed toward specific, "leaf-level" concepts (72% coverage) compared to abstract, top-level concepts (17% coverage), hindering BERT's ability to form stable representations for high-level categories.

Conclusion

The findings suggest that logical transitivity is not automatically "baked in" to language models through standard pre-training. The authors conclude that future research should focus on training or fine-tuning models to explicitly enforce these logical constraints, making them more reliable for downstream reasoning tasks where consistency is paramount.

Summary updated

BibTeX
@inproceedings{lin2022does,
  author = {Ruixi Lin and Hwee Tou Ng},
  title = {{Does BERT Know that the IS-A Relation Is Transitive?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=j_cyGS7FqeG},
}

Loading related content...

Figure