Commonsense Reasoning in NLP

Machine Learning
Introduced by
Sap et al. (ATOMIC, 2019); Zellers et al. (HellaSwag, 2019)
Year
2019 (landmark benchmarks)
Type
NLP reasoning task

What does it do?

Commonsense reasoning in NLP is the ability of a language model or inference system to use background world knowledge that is not stated in the text, such as everyday physical, social, and causal expectations, to answer questions, complete stories, or interpret dialogue.

Two landmark benchmarks formalised the task: ATOMIC (Sap et al., 2019), an if-then knowledge graph of causes, effects, and intentions, and HellaSwag (Zellers et al., 2019), a sentence-completion challenge that exposed gaps in machine understanding of everyday events.

The intuition behind the method

When a person reads 'He picked up the umbrella before leaving,' they instantly infer it is probably raining outside — without being told so. This kind of background world-knowledge inference is trivial for humans but hard for machines. Commonsense reasoning in NLP is the study and engineering of systems that can make the same leap: drawing on structured knowledge bases like ConceptNet or ATOMIC, or on the implicit knowledge absorbed by large pretrained language models, to fill the gap between what is written and what is meant.

History

Interest in machine commonsense predates the 2019 benchmarks, but the modern NLP work described here relies on large knowledge resources, notably ConceptNet, a semantic network of everyday concepts. In 2019, Sap et al. released ATOMIC, an if-then knowledge graph of 877k causal and intentional relations built from crowdsourced annotations of short event phrases. Zellers et al. introduced HellaSwag, a sentence-completion benchmark in which machine-generated wrong endings were filtered adversarially against language models, so that surface cues alone were not a reliable route to the correct continuation. Together these benchmarks established commonsense reasoning as a measurable NLP capability.

When to use it

Use commonsense reasoning when the input depends on background knowledge that the text does not state: story understanding, dialogue, question answering where the answer is implied, and narrative continuation. A pretrained language model is the usual starting point. Whether a commonsense KB such as ConceptNet or ATOMIC is worth adding depends on whether the task needs explicit, inspectable inference relations rather than a single generated or selected answer. Do not use it where the answer is stated in the passage, as in extractive factual QA, or for purely factual, self-contained text.

Limitations and considerations

  • Results depend heavily on the pretrained language model, because the encoding and inference stages inherit the commonsense knowledge that model absorbed during pretraining. Smaller models may cover fewer commonsense categories.
  • KB coverage is incomplete: ConceptNet and ATOMIC do not contain every piece of world knowledge, so rare or domain-specific situations may not be covered.
  • Evaluation is difficult because many commonsense questions admit more than one plausible answer, so benchmark accuracy is an imperfect proxy for understanding.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Targets implicit meaning that literal text analysis misses, such as the unstated cause of an event in a story or the likely intention behind a dialogue turn.
  • When paired with a structured KB such as ATOMIC or ConceptNet, the retrieved relations can be inspected, so the knowledge behind a prediction is visible in a way that a model-only approach does not expose.
  • The same stages (knowledge retrieval or internalisation, encoding, inference, scoring) apply to different tasks such as story completion and question answering, although the output format changes with the task.

Applications

  • Dialogue systems and chatbots that must infer user intent and background context not spelled out in the utterance.
  • Reading comprehension and question answering where the correct answer requires world-knowledge not present in the passage.
  • Story generation and narrative coherence checking — ensuring that generated continuations are physically and socially plausible.
  • Fact verification and argument analysis where implicit causal or social assumptions underlie the claim being evaluated.

How it works

How it works

1

Raw input, such as a story, dialogue turn, or question, is cleaned and tokenised. Spans that may need external knowledge are then marked so that the retrieval step has defined inputs. Common choices are noun and verb phrases, or all content tokens. Implementations commonly differ on this choice, so the span rule should be fixed and reported for any comparison. Using the same preprocessing throughout keeps the retrieval and encoding steps working on comparable units.

2

Relevant commonsense knowledge is sourced from a structured knowledge base such as ConceptNet (a semantic network of everyday concepts) or ATOMIC (an if-then event-knowledge graph with causes, effects, and intent relations). Each trigger span is matched to KB nodes, and the associated relations and tail events are typically added to the input as soft context. When no external KB is used, a large pretrained language model implicitly encodes such knowledge and this stage is internalised.

3

The augmented input, consisting of the original text plus any retrieved KB context, is encoded into dense vector representations by a pretrained language model such as BERT, or by a model fine-tuned specifically on commonsense tasks. The model learns to align surface language with underlying world-knowledge concepts.

4

The model produces the reasoning output: selecting the most plausible story continuation from candidates (as in HellaSwag), generating an if-then inference chain (as in ATOMIC-style reasoning), or answering a question that requires unstated background knowledge. The output is the inferred implicit fact or the chosen plausible option.

5

System outputs are scored against annotated ground-truth labels using accuracy (for multiple-choice tasks) or task-specific metrics. Build the evaluation set as a held-out split that does not overlap with the training data of the model under test. Report results separately for each knowledge category, such as physical, social, and temporal, together with the number of items in each category. Because many items admit more than one plausible answer, report the annotation agreement on the gold labels and test whether differences between systems are statistically significant before attributing them to commonsense ability. Error analysis by category then guides further fine-tuning or KB enrichment.

Common pitfalls

  • Running the pipeline without a pretrained language model or a commonsense KB leaves the inference stage with little implicit knowledge to draw on, so many implicit inferences will be missed.
  • Relying on KB lookups without contextual encoding can introduce noise when retrieved relations are semantically distant from the actual text.
  • Public benchmark items may appear in the pretraining data of the model you use. Before interpreting high scores on HellaSwag or ATOMIC-based evaluations, check that your evaluation split is held out from that model's training data.
  • Do not conflate factual question answering, where the answer is in the text, with commonsense reasoning, where it is not. The two require different data preparation and evaluation protocols.

Frequently asked questions

What distinguishes commonsense reasoning from ordinary question answering?

In standard extractive QA, the answer is present in the provided passage. In commonsense reasoning, the answer requires knowledge that is not written in the text at all — it is implicit background knowledge that humans apply automatically but must be explicitly modelled for machines.

Do I need an external knowledge base like ConceptNet or ATOMIC?

Not necessarily. Large pretrained language models absorb substantial commonsense knowledge during pretraining and can perform reasonably on many tasks without explicit KB integration. However, KB integration is beneficial when you need interpretable inference chains or when the task involves structured causal and intentional relations that the model alone handles inconsistently.

How is performance measured on commonsense reasoning tasks?

Multiple-choice benchmarks such as HellaSwag use accuracy — the proportion of correctly selected plausible continuations. Generation-based tasks are evaluated with task-specific metrics or human judgement. Error analysis by knowledge category (physical, social, temporal) is important because aggregate accuracy hides systematic gaps.

Why do models that score well on benchmarks still fail at everyday commonsense in practice?

Benchmark performance can be inflated by surface-level pattern matching or by data contamination if the test set appeared in pretraining data. Real-world commonsense is also more open-ended than multiple-choice formats allow. Strong benchmark scores should be verified with out-of-distribution test sets and qualitative error inspection.

Related methods

Sources

  1. Sap, M. et al. (2019). ATOMIC: An Atlas of Machine Commonsense for If-Then Reasoning. AAAI.

    Open publication reference
  2. Zellers, R. et al. (2019). HellaSwag: Can a Machine Really Finish Your Sentence? ACL.

    Open publication reference