Source-linked AI summary

Evaluating Commonsense in Pre-trained Language Models

Xuhui Zhou, Yue Zhang, Leyang Cui, Dandan Huang

arXiv:1911.11931v2cs.CLcs.AI

TL;DR

Contextualized representations contain syntactic and semantic knowledge, but commonsense knowledge has been less systematically evaluated despite its importance for language understanding. The paper tests five models on seven benchmarks using unified sentence-scoring evaluations and finds useful but shallow commonsense ability, especially as inference demands increase. It releases CATs for future research.

  • Problem

    Commonsense knowledge is important for language understanding, but it has been comparatively little studied in contextualized representations.

  • Method

    The paper evaluates five contextualized embedding models on seven commonsense benchmarks using language-model perplexities on positive and negative samples.

  • Results

    Pre-training helps models acquire commonsense, while bidirectional context and larger training sets are favorable; performance drops with more inference steps and dual cases expose inconsistent predictions.

  • Takeaways & Limitations

    Pre-trained contextualized representations show some commonsense knowledge but remain substantially short of robust human-level commonsense reasoning.

  • Takeaways & Limitations

    The bidirectional-context language-model factorization assumes each word is independent of successive words.

Abstract

from arXiv · show

Contextualized representations trained over large raw text data have given remarkable improvements for NLP tasks including question answering and reading comprehension. There have been works showing that syntactic, semantic and word sense knowledge are contained in such representations, which explains why they benefit such tasks. However, relatively little work has been done investigating commonsense knowledge contained in contextualized representations, which is crucial for human question answering and reading comprehension. We study the commonsense ability of GPT, BERT, XLNet, and RoBERTa by testing them on seven challenging benchmarks, finding that language modeling and its variants are effective objectives for promoting models' commonsense ability while bi-directional context and larger training set are bonuses. We additionally find that current models do poorly on tasks require more necessary inference steps. Finally, we test the robustness of models by making dual test cases, which are correlated so that the correct prediction of one sample should lead to correct prediction of the other. Interestingly, the models show confusion on these test cases, which suggests that they learn commonsense at the surface rather than the deep level. We release a test set, named CATs publicly, for future research.

Introduction

The paper evaluates commonsense knowledge in contextualized language models, addressing its limited systematic study. Across benchmarks, pre-training helps, but performance declines with harder inference and dual-case modifications expose shallow understanding.

  • Motivation: Commonsense supports natural language inference, reading comprehension, and coreference resolution, yet contextualized representations have received limited systematic evaluation for it.Resolving pronouns such as “it” can require knowledge beyond the sentence.
  • Approach: The study evaluates five contextualized embedding models across seven commonsense benchmarks using language-model perplexities on positive and negative samples.The benchmarks span physical knowledge, social conventions, scientific domains, and daily-life scenes.
  • Approach: Word-level tests replace selected words, whereas sentence-level tests replace full subsentences to probe commonsense inference.The targeted words include nouns, verbs, adjectives, adverbs, pronouns, and conjunctions.
  • Findings: Pre-trained models outperform random baselines; bidirectional context and larger training sets are associated with stronger commonsense performance.The reported observations identify language-model pre-training, bidirectional context, and training-set size as favorable factors.
  • Findings: Performance drops as required inference steps increase, indicating that commonsense reasoning remains incompletely solved by pre-trained contextualized language models.The paper describes the models as having a certain degree of commonsense reasoning ability despite this decline.
  • Robustness: Dual test cases reveal inconsistent predictions: models often retain the same prediction after modifications even when the gold labels differ.The authors interpret this pattern as surface-level rather than deep semantic commonsense understanding.

Tasks for Evaluating Commonsense

The benchmark reframes diverse commonsense datasets as sentence-scoring tasks spanning world knowledge, logical relations, physical situations, and abductive reasoning. It integrates these tasks into CATs for evaluating both basic knowledge and multi-step reasoning.

  • Task design: Commonsense ability includes basic world knowledge and reasoning over that knowledge, motivating tests of both categories.Examples distinguish facts such as water going down from explanations involving gravity or appropriate responses to injury.
  • Task design: The authors reframe datasets as sentence-scoring tasks by substitution or concatenation, selecting the highest-scoring sentence as the prediction.The reframing includes replacing WSC pronouns with candidate nouns.
  • Existing benchmarks: Sense Making asks models to choose the more sensible statement from a pair that typically differs in one key word.The varying words cover nouns, verbs, adjectives, and adverbs.
  • Existing benchmarks: WSC tests pronoun resolution by asking which noun a pronoun refers to; its 273 instances are recognized as highly difficult.The paper transforms the original questions into its evaluation format.
  • New and specialized tasks: Conjunction Acceptability probes logic relations by replacing conjunctions such as “because” and “but” with alternatives in paired samples.These conjunctions represent relations including cause and effect, contradiction, preconditions, simultaneous conditions, and addition.
  • Existing benchmarks: SWAG tests physical-scene understanding by pairing a context with candidate next actions, requiring inductive and temporal reasoning.Each instance contains one positive sample and three negative samples.
  • Reasoning tasks: HellaSwag extends SWAG with more inference steps and higher data quality, while SMR and ARCT probe abductive reasoning through reasons or warrants.ARCT focuses on social topics, whereas SMR identifies reasons behind statements that conflict with commonsense.
  • Benchmark release: The integrated test sets form the CATs benchmark, released for future research on commonsense ability.

Pre-trained Models

The study evaluates six off-the-shelf contextualized representation models, spanning autoregressive, masked, and permutation-based language-modeling objectives. The models differ in context direction, architecture scale, and pre-training data size.

  • Six off-the-shelf contextualized representation models are selected from systems with state-of-the-art NLP benchmark performance.
  • GPT and GPT2 use uni-directional autoregressive language modeling, predicting each token from preceding tokens.GPT is trained on 800M BookCorpus tokens; GPT2 expands the context and vocabulary sizes and uses WebText.
  • BERT trains with masked language modeling and next sentence prediction on BookCorpus and English Wikipedia.The masking objective predicts masked tokens from a corrupted sequence, with BERT-base and BERT-large providing two model scales.
  • XLNet uses permutation-based language modeling to capture bidirectional contexts while retaining autoregressive modeling benefits.Its permutation objective allows each token to use tokens occurring before or after it; XLNet-large also uses a substantially larger training corpus.
  • RoBERTa retains BERT’s architecture but changes training procedures and uses a 160GB corpus spanning four text sources.Its differences include dynamic masking, full-sentence training without NSP, a larger batch size, and a larger vocabulary.

Experimental Design

CAT evaluates models by scoring positive and negative commonsense sentences and selecting the higher-scoring sample. Sentence scores average token log probabilities, using preceding context for uni-directional models and masked context for bi-directional models.

  • CAT datasets support any model that can score a sentence, including the pre-trained language models evaluated here.
  • Sentence scores average token log probabilities to reduce the influence of sentence length on model predictions.
  • Uni-directional models score each token from its preceding words, implementing the standard autoregressive language-modeling factorization.
  • Bi-directional models score each token using the sentence with that token removed, commonly replacing it with [MASK] in BERT.The factorization assumes the target token is independent of successive words.
  • Table 3 reports accuracy for each pre-trained contextualizer on every test set and the average accuracy in the rightmost column.
  • Models choose the positive sentence by assigning the highest score among the samples in each test instance.The scoring setup reflects commonsense when an implausible substitution receives a lower conditional probability.

Commonsense Tests Results

Across seven commonsense benchmarks, pre-trained models generally outperform random baselines, with bidirectional context, larger models, and more training data associated with stronger performance. Performance declines as required inference steps increase, while dual-case tests reveal inconsistent predictions.

  • Commonsense Tests Results: Except for ARCT, all tested models outperform random baselines, but most remain well below human performance.On WSC, RoBERTa-large reaches 0.693 versus a 0.5 random baseline and 0.920 human performance.
  • Uni-directional Vs Bi-directional LM: RoBERTa-large outperforms GPT2-medium by a large margin on every task despite having the same parameter size.RoBERTa-large is trained with much more data than GPT2-medium.
  • Uni-directional Vs Bi-directional LM: BERT-large and XLNet-large generally outperform GPT2-medium, indicating that bidirectional context can support commonsense learning.The comparison excludes the SM task, where this pattern does not hold.
  • Scale of Training Data: Larger training datasets generally improve performance, although increased data does not always help when model capacity is limited.GPT2-base underperforms GPT on many tasks, while RoBERTa-base benefits from more data at the same parameter size as GPT2-base.
  • Robustness Tests: Dual test cases expose robustness problems because models often retain the same prediction after a modification that changes the gold label.The robust example changes a key word from “like” to “hate,” switching the correct answer from A to B.
  • Number of Inference Steps: Performance decreases as the average number of required inference steps increases across the seven test datasets.SWAG and HellaSwag fall outside this trend, possibly reflecting stronger temporal-reasoning ability.

Robustness Test

The paper evaluates robustness by pairing original commonsense instances with minimally modified dual cases that should receive consistent, knowledge-based predictions. None of the models achieves the expected consistency, suggesting their commonsense representations remain surface-level rather than deeply semantic.

  • Consistency Criterion: A model with relevant commonsense should make consistent predictions across each original–dual pair, including when both predictions are correct or both are wrong.The evaluation defines a case as consistent when the model gives the same correctness status to both paired instances.
  • Dual Test Construction: Dual instances add, delete, replace, or swap words in original commonsense samples to create closely related test cases.The study constructs 75 dual instances for each method across WSC, SM, and ARCT, then pairs each with its original instance.
  • Results: None of the five contextualizers reaches consistency on the dual cases, and consistency falls below random baselines except for the Swap method.Table 6 reports the portion of consistent cases for each modification method and contextualizer.
  • Results: The models tend to give identical predictions to dual samples despite different gold labels, especially for substitution, addition, and deletion.Examples in Figure 3 show instances predicted correctly originally but incorrectly on their duals.
  • Interpretation: The robustness test therefore indicates that commonsense knowledge in these pre-trained models may remain at a surface level without deep semantic comprehension.The dual cases are designed to preserve or closely relate the underlying commonsense knowledge point while changing the wording.

Related Work

Prior work showed that contextualized representations encode broad syntactic and semantic information, but this paper focuses specifically on probing commonsense knowledge across diverse tasks and models.

  • Prior Representation Probing: Earlier evaluations found contextualized features sufficient for strong performance across many linguistic tasks while failing on fine-grained linguistic knowledge.Related studies also reported that contextualized word representations encode both syntax and semantics.
  • Commonsense Evaluation: This work extends representation probing to commonsense by testing five contextualized models on seven diverse tasks rather than focusing on a single model or benchmark.The authors distinguish their evaluation from prior language-model scoring work focused on Winograd schemas with self-trained recurrent language models.

Conclusion

The study finds that large-scale pre-trained contextualized representations contain some commonsense knowledge, but remain substantially below robust human-level commonsense reasoning. The authors release the CATs test sets publicly.

  • Conclusion: Large-scale pre-trained contextualized representations show a certain degree of commonsense knowledge but remain far from robust human-level commonsense reasoning.The authors state that closing this gap may require further breakthroughs in modeling.
  • Conclusion: The authors release their commonsense test sets, named CATs, publicly.The release is intended to support future research on commonsense evaluation.
Loading 1911.11931v2…