Textual Entailment — Natural Language Inference (NLI)
- Type
- NLP sentence-pair classification task
What does it do?
Textual entailment, also known as natural language inference (NLI), is the natural-language-processing task of deciding whether one piece of text (the premise) entails a second piece of text (the hypothesis), contradicts it, or is neutral with respect to it.
Formalised by the PASCAL Recognising Textual Entailment Challenge (Dagan, Glickman & Magnini, 2006) and broadened by the MultiNLI corpus (Williams, Nangia & Bowman, 2018), it underpins question answering and fact-verification pipelines.
The intuition behind the method
Two sentences can stand in different logical relations: if you accept the first, the second may follow automatically, may clearly conflict with it, or may simply be unrelated. Textual entailment teaches a machine to make that judgement — given a premise and a hypothesis, it decides whether the hypothesis is entailed, contradicted, or neither. This three-way verdict is the building block for checking whether a candidate answer is supported by a source text or whether a claim is backed by evidence.
History
Textual entailment was established as a shared task by the PASCAL Recognising Textual Entailment Challenge (Dagan, Glickman & Magnini, 2006), which framed entailment recognition as a generic semantic problem cutting across NLP applications. The MultiNLI corpus (Williams, Nangia & Bowman, 2018) later supplied broad-coverage, multi-genre training data, enabling the large pretrained NLI models that drive today's question-answering and fact-checking systems.
When to use it
Use textual entailment when your data consists of premise-hypothesis text pairs and you need to judge the logical relationship between them — typically inside a question-answering or fact-verification chain. It expects at least a few dozen pairs and works best with a large pretrained language model available for the target language. If you only have isolated documents rather than paired text, this task does not apply.
Limitations and considerations
- Requires text organised as premise-hypothesis pairs; isolated documents are not enough.
- Quality depends heavily on the availability and language coverage of a large pretrained language model.
- Subtle or domain-specific inferences remain hard, and the neutral class is often the most error-prone.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Provides a principled three-way verdict (entailment / contradiction / neutral) rather than a single similarity score.
- Directly supports downstream question answering and fact-verification pipelines.
- Can be run zero-shot with a large pretrained NLI model, without task-specific labelled training data.
Applications
- Question answering — checking whether a candidate answer is entailed by a source passage.
- Fact verification — deciding whether a claim is supported or contradicted by evidence text.
- Information consistency checks across documents and summaries.
- Serving as the underlying engine for zero-shot text classification via candidate-label entailment.
How it works
How it works
The input is organised into premise-hypothesis pairs. Each example couples a premise text with a hypothesis text whose relationship to the premise is to be judged; in question answering and fact verification these pairs are formed from a source passage and a candidate claim or answer.
A large pretrained language model reads the pair and turns it into a contextual representation that captures the meaning of premise and hypothesis together. Because the task hinges on subtle logical relations, a strong pretrained model is preferred over hand-built features.
The model assigns one of three labels to the pair — entailment, contradiction, or neutral. A common practical realisation casts the premise as a candidate label and runs a zero-shot entailment classifier (for example a BART model fine-tuned on MNLI) to score the relationship.
Predictions are scored against labelled pairs using accuracy and per-class metrics, and disagreements are inspected before deployment. Because the three classes can be unevenly distributed, per-class precision and recall matter as much as overall accuracy.
Common pitfalls
- Confusing entailment with mere surface similarity — two sentences can share words yet contradict each other.
- Applying a model pretrained for one language or domain to another degrades the inference judgement.
- Reporting only overall accuracy when the three classes are imbalanced; inspect per-class precision and recall.
- Running the task on fewer than the recommended ~30 pairs, which makes any evaluation unreliable.
Frequently asked questions
What is the difference between entailment, contradiction, and neutral?
Given a premise, the hypothesis is labelled entailment if accepting the premise means the hypothesis follows, contradiction if the hypothesis cannot be true when the premise is, and neutral when neither holds — the premise neither supports nor rules out the hypothesis.
How is textual entailment different from sentence similarity?
Similarity measures how alike two sentences are, which is symmetric and graded. Entailment is a directional, logical relation: a premise can entail a hypothesis without the reverse holding, and two highly similar sentences can still contradict one another.
Do I need labelled training data?
Not necessarily. With a large pretrained NLI model you can run the task zero-shot — for example casting the premise as a candidate label and scoring the hypothesis — though a small labelled set of premise-hypothesis pairs helps with evaluation and domain adaptation.
Why is it used for fact verification and question answering?
Both tasks reduce to checking whether a piece of text is supported by a source. Entailment gives exactly that judgement, so a claim or candidate answer can be accepted when the source entails it and rejected when the source contradicts it.
Related methods
Sources
Dagan, I., Glickman, O. & Magnini, B. (2006). The PASCAL Recognising Textual Entailment Challenge.
Open publication referenceCopied.Williams, A., Nangia, N. & Bowman, S. (2018). A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference. NAACL.
Open publication referenceCopied.