Source-linked AI summary

Selective Question Answering under Domain Shift

Amita Kamath, Robin Jia, Percy Liang

arXiv:2006.09462v1cs.CLcs.LG

TL;DR

The paper studies selective question answering under domain shift, where QA systems must answer as many mixed in-domain and out-of-domain questions as possible while maintaining high accuracy. It trains a calibrator to detect likely QA errors using out-of-domain behavior, achieving better selective performance than relying directly on model probabilities.

  • Problem

    QA systems need to know when to abstain because users often ask out-of-domain questions, where models perform poorly and softmax confidence can be unreliable.

  • Method

    The paper introduces selective question answering under domain shift and trains a calibrator to predict QA errors using model behavior, including on other out-of-domain data.

  • Results

    The method answers 56% of questions at 80% accuracy, compared with 48% when directly using the model’s probabilities.

  • Takeaways & Limitations

    Out-of-domain data from a different distribution than the test data can improve selective prediction under domain shift when used to train a calibrator.

  • Takeaways & Limitations

    The paper does not focus on settings where training uses out-of-domain data similar to the test distribution, although such access is helpful.

Abstract

from arXiv · show

To avoid giving wrong answers, question answering (QA) models need to know when to abstain from answering. Moreover, users often ask questions that diverge from the model's training data, making errors more likely and thus abstention more critical. In this work, we propose the setting of selective question answering under domain shift, in which a QA model is tested on a mixture of in-domain and out-of-domain data, and must answer (i.e., not abstain on) as many questions as possible while maintaining high accuracy. Abstention policies based solely on the model's softmax probabilities fare poorly, since models are overconfident on out-of-domain inputs. Instead, we train a calibrator to identify inputs on which the QA model errs, and abstain when it predicts an error is likely. Crucially, the calibrator benefits from observing the model's behavior on out-of-domain data, even if from a different domain than the test data. We combine this method with a SQuAD-trained QA model and evaluate on mixtures of SQuAD and five other QA datasets. Our method answers 56% of questions while maintaining 80% accuracy; in contrast, directly using the model's probabilities only answers 48% at 80% accuracy.

1 Introduction

The paper introduces selective QA under domain shift, where systems must abstain on likely errors while handling mixtures of in-domain and unknown OOD questions. It shows that softmax confidence is overconfident on OOD inputs, whereas a calibrator trained with known OOD data improves coverage at fixed accuracy.

  • Motivation: Models should abstain when they are likely to err, because perfect accuracy on OOD questions is unattainable with limited training data.Selective prediction outputs both an answer and confidence, abstaining below a threshold.
  • Problem setting: Selective QA under domain shift evaluates systems on mixtures of source-distribution and unknown OOD questions while requiring them to decide when to abstain.The setting combines test-time distribution shift with selective prediction.
  • Challenge: MaxProb performs poorly in mixed settings because QA models are overconfident on OOD examples and therefore abstain too infrequently there.MaxProb gives good confidence estimates in-domain but unreliable estimates OOD.
  • Method: A calibrator predicts whether the QA model is correct using held-out source data and known OOD data, then supplies confidence for selective answering.The paper uses a calibrator trained on a mixture rather than only in-domain data.
  • Results: 56.1% coverage at 80% accuracy outperforms MaxProb’s 48.2% coverage at 80% accuracy on mixtures involving SQuAD and five other QA datasets.The experiment averages over all 20 choices of known and unknown OOD datasets.
  • Takeaway: Out-of-domain data from a distribution different from the test data can improve selective prediction when used to train the calibrator.This is the paper’s central methodological finding about known OOD data.

2 Related Work

The paper places selective QA under domain shift at the intersection of OOD generalization and selective prediction. It distinguishes the setting from related tasks that either assume test-distribution access or abstain for different reasons.

  • Extrapolation to out-of-domain data: NLP models often struggle to extrapolate from training data to new distributions, which may contain new question types or reasoning requirements.Related domain-adaptation methods commonly assume unlabeled or labeled access to the test distribution.
  • Selective prediction under domain shift: The paper assumes no access to the unknown test distribution, instead allowing samples from a different known OOD distribution.This is weaker test-distribution access than standard domain-adaptation assumptions.
  • Selective prediction: Selective prediction lets a model either predict or abstain on each test example, but prior NLP work generally assumes matching training and test distributions.The paper studies selective prediction when those distributions differ.
  • Selective prediction under domain shift: The paper reports the first study of selective prediction under domain shift in NLP, extending a concern recognized in medical and computational-chemistry applications.Those applications use selective prediction to identify cases for which models are reliable.
  • Distinctions from related tasks: Answer validation and unanswerable-question detection differ from selective prediction because selective QA abstains when the model would give a wrong answer, not only when no answer is entailed.Traditional answer validation may also rely on external entity knowledge.
  • Distinctions from related tasks: Outlier detection is not equivalent to selective prediction because abstaining on every detected OOD example would be too conservative when some OOD answers are correct.Selective prediction ranks predictions by their likelihood of correctness rather than rejecting all OOD inputs.

3 Problem Setup

The problem setup defines selective prediction through confidence-based abstention and evaluates it when test data mixes a source distribution with unknown OOD data. Extractive QA uses passage spans as answer candidates while all methods retain the base model’s top answer.

  • 3.1 Selective Prediction: A selective predictor outputs an answer candidate and scalar confidence, answering when confidence meets threshold γ and abstaining otherwise.This threshold determines which examples enter the answered set.
  • 3.1 Selective Prediction: Risk-coverage curves trade off the fraction of answered examples against their error rate as the confidence threshold changes.The paper evaluates area under this curve and maximum coverage at a desired risk level.
  • 3.2 Selective Prediction under Domain Shift: The domain-shift setting draws training data from p_source, test-time OOD data from unknown q_unk, and calibration data from a separate known OOD distribution q_known.The developer has a small calibration dataset from q_known but no access to q_unk.
  • 3.2 Selective Prediction under Domain Shift: The test distribution combines source and unknown OOD data, with the mixture ratio varied experimentally.The mixture represents users whose questions are only sometimes covered by the training distribution.
  • 3.3 Selective Question Answering: For extractive QA, each input is a passage-question pair, answer candidates are passage spans, and every method selects the base model’s highest-probability span.Methods differ in the confidence score attached to that shared answer choice.

4 Methods

The methods adapt selective prediction to domain shift by using known out-of-domain data and confidence estimates from MaxProb, test-time dropout, or a learned calibrator. The calibrator predicts whether the base QA model is correct using features from mixed in-domain and known OOD data.

  • Using known OOD data: Known OOD data is incorporated into selective prediction methods to improve generalization to unknown OOD test data.The setting provides known OOD data during calibration while unknown OOD data appears at test time.
  • MaxProb: MaxProb estimates confidence from the probability assigned by the base model to its predicted answer.It can use a base model trained on source data alone or on source plus known OOD data.
  • Test-time Dropout: Test-time dropout estimates confidence by averaging predictions or using the negative variance across K dropout masks.Higher variance indicates greater uncertainty and favors abstention; dropout can use source-only or source-plus-known-OOD training.
  • Test-time Dropout: Test-time dropout requires internal model representations and K forward passes, whereas MaxProb requires only black-box access and one model evaluation.These requirements create a K-fold runtime increase relative to a single forward pass.
  • Calibrator: The calibrator predicts base-model correctness using a classifier trained on held-out source examples combined with known OOD examples.The approach anticipates the test mixture of source and unknown OOD data and defines confidence as the calibrator’s prediction probability.
  • Calibrator: A random forest calibrator uses passage length, predicted-answer length, and the model’s top five softmax probabilities as features.These features require minimal domain knowledge, and the simple model is fast to train on new data.

5 Experiments and Analysis

Experiments show that calibrating abstention with known OOD data improves selective QA over MaxProb, especially in mixed-domain settings. The analyses also examine calibration failures, cross-domain transfer, feature importance, unanswerable questions, and computational trade-offs.

  • Main results: 4.3 and 6.7 percentage points higher coverage at 80% and 90% accuracy, respectively, than MaxProb with the same known OOD data.The calibrator also has 1.1 points lower AUC and gains 2.4% coverage at 80% accuracy over calibrating on source data alone.
  • Main results: 3.9% higher coverage at 80% accuracy is achieved by the calibrator with dropout features, but test-time dropout incurs K-fold runtime overhead.The remaining analyses therefore focus on methods without test-time dropout.
  • QA accuracy under shift: Training on 2,000 known OOD examples does not significantly improve the QA model's accuracy on other unknown OOD distributions.OOD accuracy remains around 40%–50% for most datasets, compared with around 80% on SQuAD.
  • Main results: Using known OOD data for calibrator training outperforms adding it to QA model training across all tested data amounts.The calibrator uses an 80–20 train-validation split for the known OOD data.
  • Overconfidence of MaxProb: MaxProb is overconfident on OOD examples, assigning about 80% correctness likelihood to in-domain cases versus 45% for OOD cases at MaxProb 0.6.The calibrator assigns lower OOD confidence, reduces the in-domain/OOD calibration gap, and abstains on more OOD examples than MaxProb.
  • Generalization across domains: Calibrator gains are larger when known and unknown OOD datasets use similar passages, while HotpotQA receives little help from other datasets.TriviaQA and SearchQA help each other, whereas HotpotQA's multi-hop focus is unusually distinct.
  • Related tasks: 18.38 versus 18.47 AUC shows that adding unanswerable questions through SQuAD 2.0 changes calibrator performance little.Selective prediction under distribution shift is distinct from identifying unanswerable questions because OOD examples can still be answered correctly.

6 Discussion

The paper frames selective QA under domain shift as a general problem for systems facing mixtures of familiar and unfamiliar inputs. Its framework targets more judicious abstention when test distributions differ from training distributions.

  • Selective QA under domain shift combines abstention with handling mixtures of in-domain and unknown OOD examples.
  • The framework is presented as extensible beyond QA to prediction tasks requiring graceful handling of out-of-domain inputs.
  • Models trained on standard NLP datasets often generalize poorly to other distributions, especially when new domains require different questions or reasoning skills.
  • Traditional NLU systems can abstain when inputs are unparseable, ambiguous, or unsupported by a reasoning chain.
  • Real-world NLP systems inevitably encounter familiar and unfamiliar inputs, motivating a framework for more judicious abstention.

A.1 Dataset Sources

The dataset construction separates training, validation, and test sources to avoid a train/test mismatch for the QA model.

  • OOD calibrator data came from MRQA training data, while SQuAD calibrator data came from MRQA validation data.Test data was sampled from a disjoint subset of MRQA validation data.

A.2 Calibrator Features and Model

The study tests additional input features and calibrator architectures, finding no benefit from question-length or word-overlap features and slightly better performance from Random Forest.

  • Question length and passage-question word overlap did not improve calibrator validation performance.The authors hypothesize these features may be misleading across datasets such as SQuAD and HotpotQA.
  • Random Forest performed slightly better than the tested MLP and logistic-regression calibrators.

A.3 Outlier Detection for Selective Prediction

Outlier detection is a weak substitute for predicting whether the QA model will be correct, whereas the calibrator remains well calibrated in-domain and out-of-domain.

  • 37.91% coverage at 80% accuracy and 14.26% coverage at 90% accuracy were achieved by outlier detection, with AUC 24.23.
  • Outlier detection fails to identify OOD examples that the QA model would correctly answer.
  • MaxProb is well-calibrated in-domain but remains overconfident out-of-domain when only one answer option is treated as correct.
  • The calibrator is almost perfectly calibrated on both in-domain and out-of-domain examples under the same evaluation.

A.4 Underconfidence of MaxProb on SQuAD

MaxProb is underconfident on SQuAD because test-time evaluation permits additional correct answer options absent during training. Under the mixed-data evaluation, the calibrator answers a larger share of in-domain questions than MaxProb at 80% accuracy.

  • MaxProb is underconfident on SQuAD because test-time evaluation allows additional correct answer options not present during training.The paper retains this multi-span evaluation because it follows standard SQuAD practice and treats exact match over multiple spans as more appropriate when several spans are equally correct.
  • At 80% accuracy, 68% of calibrator-answered examples are in-domain, compared with 62% for MaxProb.The calibrator therefore answers more in-domain questions than MaxProb under the mixed-data evaluation.
  • Table 5 reports per-domain accuracy and coverage for MaxProb and the calibrator at 80% and 90% accuracy on Dtest.The table distinguishes source and known-OOD settings through psource and qknown.
Loading 2006.09462v1…