Attention Is (not) All You Need for Commonsense Reasoning

Tassilo Klein, Moin Nabi

Abstract

The recently introduced BERT model exhibits strong performance on several language understanding benchmarks. In this paper, we describe a simple re-implementation of BERT for commonsense reasoning. We show that the attentions produced by BERT can be directly utilized for tasks such as the Pronoun Disambiguation Problem and Winograd Schema Challenge. Our proposed attention-guided commonsense reasoning method is conceptually simple yet empirically powerful. Experimental analysis on multiple datasets demonstrates that our proposed system performs remarkably well on all cases while outperforming the previously reported state of the art by a margin. While results suggest that BERT seems to implicitly learn to establish complex relationships between entities, solving commonsense reasoning tasks might require more than unsupervised models learned from huge text corpora.

Introduction

Commonsense reasoning remains a significant hurdle in Natural Language Processing. A classic test for this capability is the Winograd Schema Challenge (WSC), where a system must resolve an ambiguous pronoun in a sentence. These sentences are designed such that simple statistical word associations are insufficient. For instance, in the sentence "The trophy doesn't fit in the suitcase because it is too small," the pronoun "it" refers to the suitcase. If "small" is replaced with "big," the referent changes to the trophy.

Traditional approaches to solving these schemas often relied on extensive hand-crafted rules, external knowledge bases like WordNet, or complex search engine queries to find supporting evidence. This paper investigates whether a pre-trained, general-purpose model like BERT already contains the necessary relational knowledge within its internal attention mechanisms.

Methodology: Maximum Attention Score (MAS)

The authors introduce the Maximum Attention Score (MAS), an unsupervised method that leverages BERT's internal attention tensors without any task-specific fine-tuning.

  1. Attention Extraction: Using a standard bert-base-uncased model, the system extracts attention weights from all layers and heads.
  2. Slicing and Masking: For any given sentence, the method focuses on the attention between the ambiguous pronoun and the potential candidate nouns.
  3. The MAS Algorithm: A binary mask is applied to retain only the attention values where a specific candidate is the dominant focus for a particular head and layer.
  4. Scoring: Final scores for each candidate are calculated by summing these "winning" attention values and normalizing them. The candidate with the highest MAS is selected as the referent.

This approach is entirely unsupervised regarding the reasoning task, relying solely on the patterns BERT acquired during its massive pre-training phase.

Experimental Results

The MAS method was evaluated on two key benchmarks: the PDP-60 (Pronoun Disambiguation Problem) and the WSC-273 (Winograd Schema Challenge).

On the PDP-60 dataset, the method achieved 68.3% accuracy, surpassing the previous best-supervised result of 66.7%. On the more challenging WSC-273 dataset, the method reached 60.3% accuracy, establishing a new state-of-the-art (SOTA) at the time of publication.

Performance comparison on the WSC-273 dataset.

Discussion and Insights

The success of the MAS method suggests that BERT implicitly learns to establish complex relationships between entities during unsupervised training. Instead of just learning word meanings, the model captures how words relate within a specific context.

Visualization of attention shifts in BERT for various Winograd Schema pairs.

As shown in the visualization above, BERT's attention shifts significantly based on the context. For example, in the sentence "Steve follows Fred's example... He admires him," the attention for "He" is strongly directed toward "Steve." When "admires" is changed to "influences," the attention shifts toward "Fred."

Limitations

Despite these gains, the "(not)" in the title highlights that BERT is not a complete solution for commonsense. The model struggles with:

  • Abstract Referrals: Resolving pronouns that refer to abstract concepts or implicit ideas not explicitly named.
  • World Knowledge Gaps: Some reasoning requires specific physical or social knowledge not fully captured in text corpora. For example, the model failed to correctly resolve "his" in a context involving a "bunk bed" versus "shoulders."

Future work may involve fine-tuning BERT's attention maps specifically for reasoning tasks to further bridge the gap toward human-level performance.

Summary updated

Abstract

The recently introduced BERT model exhibits strong performance on several language understanding benchmarks. In this paper, we describe a simple re-implementation of BERT for commonsense reasoning. We show that the attentions produced by BERT can be directly utilized for tasks such as the Pronoun Disambiguation Problem and Winograd Schema Challenge. Our proposed attention-guided commonsense reasoning method is conceptually simple yet empirically powerful. Experimental analysis on multiple datasets demonstrates that our proposed system performs remarkably well on all cases while outperforming the previously reported state of the art by a margin. While results suggest that BERT seems to implicitly learn to establish complex relationships between entities, solving commonsense reasoning tasks might require more than unsupervised models learned from huge text corpora.
BibTeX
@inproceedings{klein2019attention,
  author = {Tassilo Klein and Moin Nabi},
  title = {{Attention Is (not) All You Need for Commonsense Reasoning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  url = {https://openreview.net/forum?id=EUjRv2XGn9F},
}
Figure