Towards Confident Machine Reading Comprehension

Rishav Chakravarti, Avirup SilarXiv 2021

Abstract

State-of-the-art machine reading comprehension (RC) models often exhibit overconfidence, providing incorrect answers with high probability scores. This paper introduces MR.C (Mr. Confident), a post-prediction model designed to bridge the "confidence gap." By leveraging internal model gradients via a novel feature called Query-Embedding-Gradients (QEG), MR.C accurately predicts when a system is likely to be incorrect, significantly enhancing reliability in production environments and under domain shift.

Introduction

While Transformer-based models like BERT and ALBERT have achieved human-level performance on academic benchmarks, a significant gap remains regarding their deployment in real-world applications. A primary hurdle is the lack of reliable confidence calibration. Standard RC models are frequently overconfident, assigning high scores to extracted spans that are factually incorrect or irrelevant. This makes it difficult for developers to establish effective thresholds for "I don't know" responses. This issue is particularly acute during domain shift, where a model trained on curated data (e.g., Wikipedia) is applied to organic search queries.

Methodology: The MR.C Framework

To address these limitations, we propose MR.C, a secondary "post-prediction" model that evaluates the outputs of a primary RC base model. MR.C is implemented as a Gradient Boosted Machine (GBM) that utilizes two distinct categories of features:

  1. Grey Box Features: These include external signals such as the likelihood scores of top-ranked answers, overlap between candidate spans, and the Inverse Document Frequency (IDF) of query terms.
  2. White Box Features (Query-Embedding-Gradients): The core innovation of MR.C is the use of QEG. By treating the model's top prediction as a target and backpropagating the loss to the input query, we can analyze the internal gradients.

The intuition behind QEG is that a truly confident and correct model should demonstrate significant "attention" to critical constraints within the query (e.g., negation or specific qualifiers). If gradients for these crucial words are low, it indicates the model may be ignoring parts of the question, signaling a likely hallucination or partial answer.

Experimental Results

We evaluated MR.C using two industry-standard benchmarks: SQuAD 2.0 (SQ2) and Natural Questions (NQ). A key focus was the domain shift scenario, where the model is trained on SQ2 and tested on the more challenging, organic queries of NQ.

Performance and Calibration

MR.C consistently improved the Area Under the Curve (AUC) for predicting answer correctness. As shown in the results for models trained on SQ2, MR.C significantly boosted the AUC and F1 scores when evaluated on the out-of-domain NQ dataset.

Table 1: Performance metrics for models trained on SQuAD 2.0 and evaluated on SQ2 and NQ. MR.C shows marked improvements in AUC and out-of-domain F1.

In the "Train on SQ2, Test on NQ" scenario, MR.C improved the F1 score for answerability detection by approximately 5 points, demonstrating its robustness in handling data distributions different from its training set.

Feature Importance

Analysis of the GBM model reveals that the novel QEG features are the most influential signals for performance prediction. Specifically, the mean(QEG) feature provided the highest average reduction in error, validating the hypothesis that internal gradients are a superior window into model certainty compared to standard output probabilities.

Table 2: Feature importance for the MR.C model, showing that Query-Embedding-Gradient (QEG) features provide the highest average reduction in error.

Discussion and Future Work

MR.C demonstrates that a relatively simple secondary model can effectively "judge" a complex Transformer. By looking "under the hood" at gradients, we can detect common failure modes where models ignore query constraints.

Future research will explore the application of gradient-based confidence measures to generative (sequence-to-sequence) models like T5. Additionally, we aim to refine training signals by incorporating multiple human annotations to better account for variations in valid answers, particularly in the Natural Questions dataset.

Conclusion

MR.C provides a practical path toward more reliable and "self-aware" machine reading comprehension. By improving calibration and robustness under domain shift, this approach helps close the gap between benchmark success and production-ready AI systems.

Summary updated

BibTeX
@misc{chakravarti2021towards,
  author = {Rishav Chakravarti and Avirup Sil},
  title = {{Towards Confident Machine Reading Comprehension}},
  year = {2021},
  eprint = {2101.07942},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.07942},
}
Figure