Using contradictions improves question answering systems

Etienne Fortier-Dubois, Domenic Rosati

Introduction

Large Language Models (LLMs) and specialized Question Answering (QA) systems frequently encounter the "hallucination" problem, where they generate plausible-sounding but factually unsupported answers. To mitigate this, researchers often turn to Natural Language Inference (NLI). NLI categorizes the relationship between a premise (source text) and a hypothesis (the proposed answer) into three classes: Entailment (support), Contradiction (denial), or Neutral (no clear relationship).

Historically, the focus has been almost exclusively on entailment. However, in high-stakes domains like medicine or law, explicitly rejecting a contradicted answer is arguably more important than finding a perfectly supported one. This paper explores whether explicitly measuring contradiction can yield more accurate and "safer" QA systems.

The QA-NLI Pipeline

The authors propose a multi-stage pipeline designed to re-rank and filter candidate answers using NLI signals. This approach moves beyond simple confidence scores by verifying the logical relationship between the context and the generated answer.

Overview of the QA-NLI pipeline, showing the conversion of question-answer pairs into declarative hypotheses for NLI scoring.

As illustrated in the pipeline, the process involves:

  1. Answer Generation: A base QA model produces a candidate answer and an associated confidence score.
  2. QA2D (Question-Answer to Declarative): The question and answer are transformed into a declarative statement. For instance, "What is the most abundant metal? Aluminum" becomes "The most abundant metal is aluminum."
  3. NLI Scoring: This statement (hypothesis) and the source context (premise) are processed by a pre-trained NLI model to generate scores for Entailment (E), Contradiction (C), and Neutral (N).
  4. Calibration: A logistic regression model determines the optimal linear combination of these signals (QA score + E + C) to produce a final ranking.

Experimental Evaluation

The methodology was evaluated across 16 datasets, including 9 multiple-choice tasks (e.g., CosmosQA, RACE, SciQ) and 7 extractive QA tasks (e.g., SQuAD 2.0, BioASQ). The study also included adversarial datasets to test robustness against "tricky" or out-of-domain inputs.

A primary finding is that contradiction often serves as a stronger filter than entailment. An answer might be correct even if the text doesn't explicitly support every word (resulting in a 'Neutral' NLI score), but it is almost certainly incorrect if the text explicitly denies it. The research argues for the explicit separation of "Contradicted" and "Neutral" states, rather than lumping them into a single "Not Entailed" category, to improve system safety.

Results and Discussion

The integration of NLI signals consistently improved performance across the board. In multiple-choice settings, the calibrated QA+E+C model achieved the highest average accuracy.

Performance comparison across multiple-choice datasets, showing that the combined QA+E+C model outperforms the base QA model.

As shown in the results table, the QA+E+C model reached an average accuracy of 84.57%, surpassing the base QA model's 84.08%. In "Selective QA" scenarios—where the model can choose to abstain from answering if confidence is low—the contradiction signal was particularly potent. For example, on the CosmosQA dataset at 20% coverage, the QA+C model reached 91.12% accuracy, a significant jump from the base model's 88.61%.

In extractive QA, while entailment was slightly more useful than in multiple-choice settings, contradiction remained a critical signal. For the SQuAD2 dataset, which includes unanswerable questions, the contradiction signal helped the model correctly identify when to stay silent.

Conclusion and Future Work

While re-ranking with NLI adds computational overhead and depends on the accuracy of the QA2D conversion, the benefits are clear. Using contradiction as a first-class signal allows QA systems to better identify incorrect answers and know when to remain silent, paving the way for more reliable and trustworthy AI. Future work may focus on improving the robustness of the QA2D "bridge" and exploring more granular NLI categories for complex scientific reasoning.

Summary updated

BibTeX
@inproceedings{fortierdubois2023using,
  author = {Etienne Fortier-Dubois and Domenic Rosati},
  title = {{Using contradictions improves question answering systems}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-short.72},
}
Figure