SlowGuess/NAACL_2021_OCR huggingface dataset:
Srinivasan Iyer† Sewon Min‡* Yashar Mehdad† Wen-tau Yih†
†Facebook AI ‡University of Washington
{sviyer, mehdad, scottyih}@fb.com sewon@cs.washington.edu
State-of-the-art Machine Reading Comprehension (MRC) models for Open-domain Question Answering (QA) are typically trained for span selection using distantly supervised positive examples and heuristically retrieved negative examples. This training scheme possibly explains empirical observations that these models achieve a high recall amongst their top few predictions, but a low overall accuracy, motivating the need for answer re-ranking. We develop a successful re-ranking approach (RECONSIDER) for span-extraction tasks that improves upon the performance of MRC models, even beyond large-scale pre-training. RECONSIDER is trained on positive and negative examples extracted from high confidence MRC model predictions, and uses in-passage span annotations to perform span-focused re-ranking over a smaller candidate set. As a result, RECONSIDER learns to eliminate close false positives, achieving a new extractive state of the art on four QA tasks, with  $45.5\%$  Exact Match accuracy on Natural Questions with real user questions, and  $61.7\%$  on TriviaQA. We will release all related data, models, and code<sup>1</sup>.
Open-domain Question Answering (Voorhees et al., 1999) (QA) involves answering questions by extracting correct answer spans from a large corpus of passages, and is typically accomplished by a light-weight passage retrieval model followed by a heavier Machine Reading Comprehension (MRC) model (Chen et al., 2017). The span selection components of MRC models are trained on distantly supervised positive examples (containing the answer string) together with heuristically chosen negative examples, typically from upstream retrieval models. This training scheme possibly explains empirical
$Q$  : Who was the head of the Soviet Union when it collapsed?
Figure 1: Top-3 passage-spans predicted by a BERT-MRC model on a question from NQ (answer spans are underlined). RECONSIDER re-evaluates the passages with marked candidate answers, eliminates close false positives and ranks Mikhail Gorbachev as correct.
findings (Wang et al., 2018b,c) that while MRC models can confidently identify top-K answer candidates (high recall), they cannot effectively discriminate between top semantically similar false positive candidates (low accuracy). In this paper, we develop a general approach to make answer re-ranking successful for span-extraction tasks, even over large pretrained models, and improve the state of the art on four QA datasets.
Earlier work (Wang et al., 2018c,b) on open-domain QA have recognized the potential of answer re-ranking, which we continue to observe despite recent advances using large pre-trained models like BERT (Devlin et al., 2019). Figure 1 shows the top-3 predictions of a BERT-based SOTA model (Karpukhin et al., 2020) on a question from Natural Questions (NQ) (Kwiatkowski et al., 2019), "Who was the head of the Soviet Union when it collapsed?" While all predictions are very relevant and refer to Soviet Union heads, Mikhail Gorbachev is correct and the rest are close false positives. Table 1 presents accuracies obtained by the same model on four QA datasets, if the answer exactly matches
*Work done while at Facebook AI.
github.com/facebookresearch/reconsider
Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1280-1287 June 6-11, 2021. ©2021 Association for Computational Linguistics
Dataset	Top-1	Top-5	Top-10	Top-25
NQ	40.3	49.5	50.9	62.4
TRIVIAQA	57.2	64.6	65.7	73.1
WEBQ	42.6	49.0	50.7	60.4
TREC	49.6	58.7	60.9	71.4
Table 1: Top-k EM accuracies using a state-of-the-art model (Karpukhin et al., 2020) on four open-domain QA tasks (dev set). Improvements of up to  $22\%$  can potentially be achieved by re-ranking top-25 candidates.
any of the top-k predictions for  $k = 1,5,10$  and 25. We observe that an additional  $10\%$  and  $20\%$  of correct answers exist amongst the top-5 and top-25 candidates respectively, presenting an enormous opportunity for span reranking models.
Our re-ranking model is trained using positive and negative examples extracted from high confidence MRC model predictions, and thus, learns to eliminate hard false positives. This can be viewed as a coarse-to-fine approach of training span selectors, with the base MRC model trained on heuristically chosen negatives and the re-ranker trained on finer, more subtle negatives. This contrasts with multi-task training approaches (Wang et al., 2018c), whose re-scoring gains are limited by training on the same data, especially when coupled with large pre-trained models. Our approach also scales to any number of ranked candidates, unlike previous concatenation based cross-passage re-ranking methods (Wang et al., 2018b) that do not transfer well to current length-bounded large pre-trained models. Similar to MRC models, our re-ranking approach uses cross-attention between the question and a candidate passage (Seo et al., 2016). However, we now demarcate a specific candidate answer span in each passage, to assist the model to perform span-focused reasoning, in contrast to MRC models, which must reason across all spans. Therefore, the re-ranker performs span ranking of carefully chosen candidates, rather than span selection like the MRC model. Similar focused cross-attention methods have recently proved to be effective for Entity Linking (Wu et al., 2020) tasks, although they annotate the query rather than the passage.
We use our broadly applicable span-focused reranking approach on models from Karpukhin et al. (2020) and achieve a new extractive state of the art on four QA datasets, including  $45.5\%$  on the open-domain setting of NQ (real user queries,  $+1.6\%$  on small models) and  $61.1\%$  on TriviaQA (Joshi et al.,
2017)  $(+2.5\%)$  on small models). To our knowledge, we are the first to successfully leverage re-ranking to improve over large pre-trained models on open-domain QA.
Open-domain Question Answering (QA) aims to answer factoid questions from a large corpus of passages (Voorhees et al., 1999) (such as Wikipedia) in contrast with single passage MRC tasks (Rajpurkar et al., 2016). Prior works use pipelined approaches, that first retrieve candidate passages and subsequently use a neural MRC model to extract answer spans (Chen et al., 2017), with further improvements using joint learning (Wang et al., 2018a; Tan et al., 2018). Recent successes involve improving retrieval, thereby increasing the coverage of passages fed into the MRC model (Guu et al., 2020; Karpukhin et al., 2020). In this paper, we significantly improve MRC model performance by making re-ranking successful using span-focused re-ranking of its highly confident predictions.
For Open-domain QA, it is crucial to train MRC models to distinguish passage-span pairs containing the answer (positives) from those that do not (negatives). Using negatives that appear as close false positives can produce more robust MRC models. However, prior work relies on upstream retrieval models to supply distantly supervised positives (contain answer string) and negatives (Asai et al., 2020), that are in-turn trained using heuristically chosen positives and negatives. Our approach leverages positives and negatives from highly confident MRC predictions which are hard to classify, and thus, improve upon MRC model performance.
Jia and Liang (2017) motivate recent work on answer verification for QA by showing that MRC models are easily confused by similar passages. Wang et al. (2018b) use a weighted combination of three re-rankers and rescore a concatenation of all passages with a particular answer using a sequential model, while, Wang et al. (2018c) develop a multi-task end-to-end answer scoring approach. Although the main idea is to consider multiple passage-span candidates collectively, such approaches either used concatenation, which is prohibitively expensive to couple with length-restricted models like BERT, or are trained on the same data without variations only to realize marginal gains. Hu et al. (2019) use answer verification to predict the unanswerability of a question
passage pair for traditional MRC tasks. To our knowledge, our work is the first to (i) successfully demonstrate a re-ranking approach that significantly improves over large pre-trained models (Devlin et al., 2019) in an open domain setting, and (ii) use annotated top model predictions as harder negatives to train more robust models for QA.
We assume an extractive MRC model  $\mathcal{M}$  coupled with a passage retrieval model, that given a question  $q$  and a passage corpus  $\mathcal{P}$ , produces a list of  $N$  passage and span pairs,  $\{(p_j,s_j)\}_{j = 1}^N$ ,  $p_j\in \mathcal{P}$  and  $s_j$  is a span within  $p_j$ , ranked by the likelihood of  $s_j$  answering  $q$ . Note that  $\{p_j\}_{j = 1}^N$  is not disjoint as a passage can have multiple answer spans. In this section, we develop a span-focused re-ranking model  $\mathcal{R}$ , that learns a distribution  $p$ , over top- $K(p_{j},s_{j})$  pairs  $1\le j\le K$ , given question  $q$ . Essentially, model  $\mathcal{R}$  first scores every  $(q,p_j,s_j)$  triple using scoring function  $r$ , and then normalizes over these scores to produce  $p$ :
$$
p (q, p _ {j}, s _ {j}) = \frac {e ^ {r (q , p _ {j} , s _ {j})}}{\sum_ {1 \leq k \leq K} e ^ {r (q , p _ {k} , s _ {k})}}. \tag {1}
$$
Specifically, if  $E(q,p_j,s_j) \in \mathbb{R}^H$  is a dense representation of  $(q,p_j,s_j)$ ,  $r$  is defined as:
$$
r (q, p _ {j}, s _ {j}) = \mathbf {w} ^ {T} E (q, p _ {j}, s _ {j}), \tag {2}
$$
where  $\mathbf{w} \in \mathbb{R}^H$  is a learnable vector.
Span-focused tuple encoding We compute  $E$  using the representation of the [CLS] token of a BERT model (Devlin et al., 2019) applied to a span-focused encoding of  $(q, p_j, s_j)$ . This encoding is generated by first marking the tokens of  $s_j$  within passage  $p_j$  with special start and end symbols [A] and [/A], to form  $\hat{p}_j$ , followed by concatenating the [CLS] and question tokens, with the annotated passage tokens  $\hat{p}_j$ , using separator token [SEP]. We find span marking to be a crucial ingredient for answer re-ranking, without which, performance deteriorates (Section 5).
Training We obtain top  $K$  predictions  $(p_j,s_j)$  of model  $\mathcal{M}$  for each question  $q_{i}$  in its training set, which we divide into positives, where  $s_j$  is exactly the groundtruth answer, and remaining negatives. We train  $\mathcal{R}$  using mini-batch gradient descent, where in each iteration, for question  $q$ , we include 1 randomly chosen positive and  $M - 1$
randomly chosen negatives, and maximize the likelihood of the positive. Unlike the heuristically chosen negatives used to train  $\mathcal{M}$ ,  $\mathcal{R}$  is trained using negatives from high confidence predictions of  $\mathcal{M}$ , which are harder to classify. Thus, this can be viewed as an effective coarse-to-fine negative selection strategy for span extraction models (Section 5).
4 Baseline Model  $\mathcal{M}$
We use the state-of-the-art models of Karpukhin et al. (2020) which consists of 1) a dense passage retriever, and 2) a span extractive BERT reader, as our model  $\mathcal{M}$ . The retriever uses a passage encoder  $f_{p}$  and a question encoder  $f_{q}$  to represent all passages and questions as dense vectors in the same space. During inference, it retrieves top-100 passages similar to question  $q$  based on their inner product, and passes them on to the MRC reader.
The MRC reader is an extension of model  $\mathcal{R}$  of Section 3, to perform span extraction. We briefly describe it but Karpukhin et al. (2020) has complete details. Its input is a question  $q$  together with positive and negative passages  $p_j$  from its retrieval model.  $(q,p_{j})$  tuples are encoded as before  $(enc(q,p_j) = q[\mathrm{SEP}]p_j)$ , but without spans being marked (as spans are unavailable). A distribution over passages  $p_s$  is computed as before using scoring function  $r$  and context encoder  $E$ . In addition, a start-span probability,  $p_{st}(t_i|q,p_j)$  and an end-span probability,  $p_e(t_i|q,p_j)$  is computed for every token  $t_i$  in  $enc(q,p_j)$ . The model is trained to maximize the likelihood of  $p_s(p_j)\times p_{st}(s|q,p_j)\times p_e(t|q,p_j)$  for each correct answer span  $(s,t)$  in  $p_j$ , and outputs the top-K scoring passage-span pairs during inference.
Datasets We use four benchmark open-domain QA datasets following Lee et al. (2019):
Natural Questions (NQ) contains real user questions asked on Google searches; we consider questions with short answers up to 5 tokens.
TRIVIAQA (Joshi et al., 2017) consists of questions collected from trivia and quiz-league websites; we take questions in an unfiltered setting and discard the provided web snippets.
WebQuestions (WEBQ) (Berant et al., 2013) is a collection of questions extracted from the Google Suggest API, with answers being Freebase entities.
CuratedTREC (Baudiš and Šedivý, 2015) contains curated questions from TREC QA track.
Model	NQ	TRIVIAQA	WEBQ	TREC
BM25+BERT (Lee et al., 2019)	26.5	47.1	17.7	21.3
ORQA (Lee et al., 2019)	33.3	45.0	36.4	30.1
HardEM (Min et al., 2019a)	28.1	50.9	-	-
GraphRetriever (Min et al., 2019b)	34.5	56.0	36.4	-
PathRetriever (Asai et al., 2020)	32.6	-	-	-
REALM (Guu et al., 2020)	39.2	-	40.2	46.8
REALMNews (Guu et al., 2020)	40.4	-	40.7	42.9
Models that use DPRmulti (Karpukhin et al., 2020)
DPR-BERTbase (Karpukhin et al., 2020)	41.5	56.8	42.4	49.4
RECONSIDERbase (Ours)	43.1	59.3	44.4	49.3
DPR-BERTlarge (Karpukhin et al., 2020)	44.6	60.9	44.8	53.5
RAGlarge (Lewis et al., 2020)	44.5	56.1	45.5	52.2
RECONSIDERlarge (Ours)	45.5	61.7	45.9	55.3
Table 2: End-to-end QA test-set (Exact Match) accuracy. Models in the lower half use dense passage retrieval from Karpukhin et al. (2020). RECONSIDER outperforms previous methods under both base and large versions. Table layout and baselines are borrowed from Karpukhin et al. (2020) (published extractive SOTA). Dataset stats and dev set results are in Appendix, and baseline descriptions can be found in Karpukhin et al. (2020).  $\dagger$ : numbers from our own experiments.
Implementation details For all datasets, we use the retrieval model (without retraining) and setup from Karpukhin et al. (2020), retrieving 100-token passages from a Wikipedia corpus (from 2018-12-20). We also use their MRC model with their best performing hyperparameters as model  $\mathcal{M}$ . For model  $\mathcal{R}$ , we experiment with both  $\mathrm{BERT}_{\mathrm{base}}$  and  $\mathrm{BERT}_{\mathrm{large}}$ , use top-100 predictions from model  $\mathcal{M}$  during training (top-5 for testing), and use  $M = 30$ . We use a batch size of 16 on NQ and TRIVIAQA and 4 otherwise. For WEBQ and TREC, we start training from our trained NQ model.
Results Table 2 presents end-to-end test-set exact match accuracies for these datasets, compared with previous models. The BERTbase version of RECONSIDER outperforms the previous state-ofthe-art DPR model of Karpukhin et al. (2020) (our model  $\mathcal{M}$ ) by  $1.6\%$  on NQ and  $\sim 2\%$  on TRIVIAQA and WEBQ. For training on the smaller WEBQ and TREC datasets, we initialize models using the corresponding NQ model. Table 2 demonstrates the effectiveness of a coarse-to-fine approach for selecting negative passages, with dense retrieval based negatives (DPR) outperforming BM25, and in turn, improved upon by our reranking approach. We obtain gains despite  $\mathcal{R}$  being not only very similar in architecture to the MRC reader  $\mathcal{M}$ , but also trained on the same QA pairs, owing to (i) training using harder false-positive
style negatives, and (ii) answer-span annotations that allow a re-allocation of modeling capacity from modeling all spans to reasoning about specific spans with respect to the question and the passage. Re-ranking performance suffers without these crucial methods. For example, replacing answer-span annotations with answer concatenation reduces accuracy by  $\sim 1\%$  on the dev set of NQ.
We train a large variant of RECONSIDER using  $\mathrm{BERT}_{\mathrm{large}}$  for model  $\mathcal{R}$ , trained on predictions from a  $\mathrm{BERT}_{\mathrm{large}}$  model  $\mathcal{M}$ . For a fair comparison, we re-evaluate DPR using  $\mathrm{BERT}_{\mathrm{large}}$ . RECONSIDER outperforms it by  $\sim 1\%$  on all datasets  $(+ \sim 2\%$  on TREC). This model is also comparable in size to RAG (Lewis et al., 2020) (which uses  $\mathrm{BART}_{\mathrm{large}}$ ) but outperforms it on all tasks  $(+1$  on NQ,  $+5.5$  on TRIVIAQA,  $+3$  on TREC), demonstrating that retrieve-extract architectures can perform better than answer generation models.
We find  $K = 5$  (testing) to be best for all datasets, and increasing  $K$  has little effect on accuracy, despite training on top-100 predictions. Although in contrast with our expectations based on Table 1, this is anticipated since very low-ranked predictions are less likely to be reranked highly, but this also presents an opportunity for future work.
In Table 3, we present examples from the validation set of NQ, of cases where 1) DPR-BERTbase
Model	Prediction
Question DPR-BERTbase	Where are zebra mussels found in the United States?
... on the genetic algorithm for rule - set production (garp), a group of researchers predicted that the southeastern united states is moderately to highly likely to be inhabited by zebra mussels ...
... of zebra mussel in the great lakes alone exceeds $500 million a year.
+RECONSIDER
Question DPR-BERTbase	Where do you find neurons in the brain?
... there is strong evidence for generation of substantial numbers of new neurons in two brain areas, the hippocampus and olfactory bulb. A neuron is a specialized type of cell found in the bodies ...
+RECONSIDER	The brain is the most complex organ in a vertebrate's body. In a human, the cerebral cortex contains approximately 14-16 billion neurons.
Question DPR-BERTbase	Who said if I have seen further it is by standing on the shoulders of giants?
Standing on the shoulders of giants ... this concept has been traced to the 12th century, attributed to Bernard of Chartres. Its most familiar expression in English is by Isaac Newton in 1675: "If I have seen further it is by standing on the shoulders of giants ...
+RECONSIDER	Standing on the shoulders of giants ... this concept has been traced to the 12th century, attributed to Bernard of Chartres. Its most familiar expression in English is by Isaac Newton in 1675: "If I have seen further it is by standing on the shoulders of giants ...
Table 3: Top passage with answer span (in bold) for example questions from the validation set of NQ, both with and without re-ranking using RECONSIDER. For the first two examples, RECONSIDER re-ranks to obtain the correct answer, while in the last example, re-ranking eliminates the already correct top answer.
produces an incorrect top answer, which is corrected after re-ranking with RECONSIDER (top 2 examples), and 2) DPR-BERT $_{\text{base}}$ ’s answer is correct but is ranked lower after re-ranking. Of the  $15.4\%$  validation examples that were amenable for correction by re-ranking the top-5 candidates from DPR-BERT $_{\text{base}}$ , RECONSIDER was able to fix  $6.1\%$ . However, in this process,  $4.3\%$  of answers that were originally correct (top-ranked), lost their top-rank after RECONSIDER, and this presents an opportunity for further improving re-ranking.
We use a synergistic combination of two techniques viz. retraining with harder negatives, and, span-focused cross attention, to make re-ranking successful for span-extractive tasks over large pretrained models. This method achieves SOTA extractive results on four open domain QA datasets, also outperforming recent generative pre-training approaches.
Akari Asai, Kazuma Hashimoto, Hannaneh Hajishirzi, Richard Socher, and Caiming Xiong. 2020. Learning to retrieve reasoning paths over Wikipedia graph for question answering. In International Conference on Learning Representations (ICLR).
Petr Baudiš and Jan Šedivý. 2015. Modeling of the question answering task in the yodaqa system. In International Conference of the Cross-Language Evaluation Forum for European Languages.
Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Empirical Methods in Natural Language Processing (EMNLP).
Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. 2017. Reading Wikipedia to answer open-domain questions. In Association for Computational Linguistics (ACL).
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In North American Association for Computational Linguistics (NAACL).
Kelvin Guu, Kenton Lee, Zora Tung, Panupong Papat, and Ming-Wei Chang. 2020. REALM: Retrieval-augmented language model pre-training. In International Conference on Machine Learning (ICML).
Minghao Hu, Furu Wei, Yuxing Peng, Zhen Huang, Nan Yang, and Dongsheng Li. 2019. Read+ verify: Machine reading comprehension with unanswerable questions. In Conference on Artificial Intelligence (AAAI).
Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP).
Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Association for Computational Linguistics (ACL).
Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen,
and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Empirical Methods in Natural Language Processing (EMNLP).
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, Kenton Lee, Kristina N. Toutanova, Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association of Computational Linguistics (TACL).
Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Association for Computational Linguistics (ACL).
Patrick Lewis, Ethan Perez, Aleksandara Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Advances in Neural Information Processing Systems (NeurIPS).
Sewon Min, Danqi Chen, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2019a. A discrete hard EM approach for weakly supervised question answering. In Empirical Methods in Natural Language Processing (EMNLP).
Sewon Min, Danqi Chen, Luke Zettlemoyer, and Hannaneh Hajishirzi. 2019b. Knowledge guided text retrieval and reading for open domain question answering. arXiv preprint arXiv:1911.03868.
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Empirical Methods in Natural Language Processing (EMNLP).
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2016. Bidirectional attention flow for machine comprehension. In International Conference on Learning Representations (ICLR).
Chuanqi Tan, Furu Wei, Nan Yang, Bowen Du, Weifeng Lv, and Ming Zhou. 2018. S-net: From answer extraction to answer generation for machine reading comprehension. In Conference on Artificial Intelligence (AAAI).
Ellen M Voorhees et al. 1999. The TREC-8 question answering track report. In TREC.
Shuohang Wang, Mo Yu, Xiaoxiao Guo, Zhiguo Wang, Tim Klinger, Wei Zhang, Shiyu Chang, Gerry Tesauro, Bowen Zhou, and Jing Jiang. 2018a. R^3: Reinforced ranker-reader for open-domain question answering. In Conference on Artificial Intelligence (AAAI).