SlowGuess/ACL_2020_OCR huggingface dataset:
Hao Cheng*, Ming-Wei Chang†, Kenton Lee†, Kristina Toutanova†
*Microsoft Research chehao@microsoft.com
$\dagger$ Google Research {mingweichang, kentonl, kristout}@google.com
We address the problem of extractive question answering using document-level distant supervision, pairing questions and relevant documents with answer strings. We compare previously used probability space and distant supervision assumptions (assumptions on the correspondence between the weak answer string labels and possible answer mention spans). We show that these assumptions interact, and that different configurations provide complementary benefits. We demonstrate that a multi-objective model can efficiently combine the advantages of multiple assumptions and outperform the best individual formulation. Our approach outperforms previous state-of-the-art models by 4.3 points in F1 on TriviaQA-Wiki and 1.7 points in Rouge-L on NarrativeQA summaries. $^{1}$
Distant supervision assumptions have enabled the creation of large-scale datasets that can be used to train fine-grained extractive short answer question answering (QA) systems. One example is TriviaQA (Joshi et al., 2017). There the authors utilized a pre-existing set of Trivia question-answer string pairs and coupled them with relevant documents, such that, with high likelihood, the documents support answering the questions (see Fig. 1 for an illustration). Another example is the NarrativeQA dataset (Kočisky et al., 2018), where crowd-sourced abstractive answer strings were used to weakly supervise answer mentions in the text of movie scripts or their summaries. In this work, we focus on the setting of document-level extractive QA, where distant supervision is specified as a set  $\mathcal{A}$  of answer strings for an input question-document pair.
Figure 1: TriviaQA and NarrativeQA examples. In the TriviaQA example, there are three occurrences of the original answer string "Joan Rivers" (blue), and one alternate but incorrect alias "Diary of a Mad Diva" (purple). Only two "Joan Rivers" mentions (shown in blue boxes) support answering the question. In the NarrativeQA example, there are two answer stings in  $\mathcal{A}$ : "in the spring at mount helicon" (blue) and "mount helicon" (orange), with the latter being a substring of the former. Both mentions in P2 are correct answer spans.
Depending on the data generation process, the properties of the resulting supervision from the sets  $\mathcal{A}$  may differ. For example, the provided answer sets in TriviaQA include aliases of original trivia question answers, aimed at capturing semantically equivalent answers but liable to introducing semantic drift. In Fig. 1, the possible answer string "Diary of a Mad Diva" is related to "Joan Rivers", but is not a valid answer for the given question.
On the other hand, the sets of answer strings in NarrativeQA are mostly valid since they have high overlap with human-generated answers for the given question/document pair. As shown in Fig. 1, "in the spring at mount helicon" and "mount helicon" are both valid answers with relevant mentions. In this case, the annotators chose answers
Based on the TriviaQA-Wiki leaderboard, our approach was the SOTA when this work was submitted on Dec 04, 2019.
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5657-5667 July 5 - 10, 2020. ©2020 Association for Computational Linguistics
that appear verbatim in the text but in the more general case, noise may come from partial phrases and irrelevant mentions.
While distant supervision reduces the annotation cost, increased coverage often comes with increased noise (e.g., expanding entity answer strings with aliases improves coverage but also increases noise). Even for fixed document-level distant supervision in the form of a set of answers  $\mathcal{A}$ , different interpretations of the partial supervision lead to different points in the coverage/noise space and their relative performance is not well understood.
This work systematically studies methods for learning and inference with document-level distantly supervised extractive QA models. Using a BERT (Devlin et al., 2019) joint question-passage encoder, we study the compound impact of:
- Probability space (§2): ways to define the model's probability space based on independent paragraphs or whole documents.
- Distant supervision assumptions (§3): ways to translate the supervision from possible strings  $\mathcal{A}$  to possible locations of answer mentions in the document.
- Optimization and inference (§4): ways to define corresponding training objectives (e.g. Hard EM as in Min et al. (2019) vs. Maximum Marginal Likelihood) and make answer string predictions during inference (Viterbi or marginal inference).
We show that the choice of probability space puts constraints on the distant supervision assumptions that can be captured, and that all three choices interact, leading to large differences in performance. Specifically, we provide a framework for understanding different distant supervision assumptions and the corresponding trade-off among the coverage, quality and strength of distant supervision signal. The best configuration depends on the properties of the possible annotations  $\mathcal{A}$  and is thus data-dependent. Compared with recent work also using BERT representations, our study shows that the model with most suitable probabilistic treatment achieves large improvements of 4.6 F1 on TriviaQA and 1.7 Rouge-L on NarrativeQA respectively. Additionally, we design an efficient multi-loss objective that can combine the benefits of different formulations, leading to significant improvements in accuracy, surpassing the best previously reported results on the two studied
Figure 2: The document-level QA model as used for test-time inference. The lower part is a BERT-based paragraph-level answer scoring component, and the upper part illustrates the probability aggregation across answer spans sharing the same answer string.  $\Xi$  refers to either a sum or a max operator. In the given example, "John Rivers" is derived from two paragraphs.
tasks. Results are further strengthened by transfer learning from fully labeled short-answer extraction data in SQuAD 2.0 (Rajpurkar et al., 2018), leading to a final state-of-the-art performance of 76.3 F1 on TriviaQA-Wiki and 62.9 on the NarrativeQA summaries task. $^{2}$
2 Probability Space
Here, we first formalize both paragraph-level and document-level models, which have been previously used for document-level extractive QA. Typically, paragraph-level models consider each paragraph in the document independently, whereas document models integrate some dependencies among paragraphs.
To define the model, we need to specify the probability space, consisting of a set of possible outcomes and a way to assign probabilities to individual outcomes. For extractive QA, the probability space outcomes consist of token positions of answer mention spans.
The overall model architecture is shown in Fig. 2. We use BERT (Devlin et al., 2019) to derive representations of document tokens. As is standard in state-of-the-art extractive QA models (Devlin et al., 2019; Lee et al., 2019; Min et al., 2019), the BERT model is used to encode a pair of a given question with one paragraph from a given document into neural text representations. These representations are then used to
The code is available at https://github.com/ hao-cheng/ds_doc_qa
5658
define scores/probabilities of possible answer begin and end positions, which are in turn used to define probabilities over possible answer spans. Then the answer string probabilities can be defined as the aggregation over all possible answer spans/mentions.
In the following, we show that paragraph-level and document-level models differ only in the space of possible outcomes and the way of computing answer span probabilities from answer position begin and end scores.
Scoring answer begin and end positions Given a question  $q$  and a document  $d$  consisting of  $K$  paragraphs  $p_1, \ldots, p_K$ , the BERT encoder produces contextualized representations for each question-paragraph pair  $(q, p_k)$ . Specifically, for each token position  $i^k$  in  $p_k$ , the final hidden vector  $\mathbf{h}^{(i,k)} \in \mathbb{R}^d$  is used as the contextualized token embedding, where  $d$  is the vector dimension.
The span-begin score is computed as  $s_b(i^k) = \mathbf{w}_b^T\mathbf{h}^{(i,k)}$  using a weight vector  $\mathbf{w}_b\in \mathbb{R}^d$ . The span-end score  $s_e(j^k)$  is defined in the same way. The probabilities for a start position  $i^k$  and an end position  $j^k$  are
$$
P _ {b} \left(i ^ {k}\right) = \frac {\exp \left(s _ {b} \left(i ^ {k}\right)\right)}{Z _ {b}}, \tag {1}
$$
$$
P _ {e} (j ^ {k}) = \frac {\exp \left(s _ {e} (j ^ {k})\right)}{Z _ {e}}, \tag {2}
$$
where  $Z_{b}, Z_{e}$  are normalizing factors, depending on the probability space definition (detailed below). The probability of an answer span from  $i^{k}$  to  $j^{k}$  is defined as  $P_{s}(i^{k},j^{k}) = P_{b}(i^{k})P_{e}(j^{k})$ .
The partition functions  $Z_{b}$  and  $Z_{e}$  depend on whether we use a paragraph-level or document-level probability space.
Paragraph-level model In paragraph level models, we assume that for a given question against a document  $d$ , each of its paragraphs  $p_1,\ldots ,p_K$  independently selects a pair of answer positions  $(i^k,j^k)$ , which are the begin and end of the answer from paragraph  $p_k$ . In the case that  $p_k$  does not support answering the question  $q$ , special NULL positions are selected (following the SQuAD 2.0 BERT implementation<sup>3</sup>). Thus, the set of possible outcomes  $\Omega$  in the paragraph-level probability space is the set of lists of begin/end position pairs, one from each paragraph:  $\{[(i^{1},j^{1}),\dots,(i^{K},j^{K})]\}$ , where  $i^k$
and  $j^k$  range over positions in the respective paragraphs.
The answer positions in different paragraphs are independent, and the probability of each paragraph's answer begins and ends is computed by normalizing over all possible positions in that paragraph, i.e.,
$$
Z _ {b} ^ {k} = \sum_ {i \in \mathcal {I} ^ {k} \cup \{\text {N U L L} \}} \exp (s _ {b} (i)), \tag {3}
$$
$$
Z _ {e} ^ {k} = \sum_ {j \in \mathcal {I} ^ {k} \cup \{\text {N U L L} \}} \exp (s _ {e} (j)), \tag {4}
$$
where  $\mathcal{I}^k$  is the set of all positions in the paragraph  $p_k$ . The probability of an answer begins at  $i^k$  is  $P_b(i^k) = \exp (s_b(i^k)) / Z_b^k$  and the probability of an end at  $j^{k}$  is defined analogously. The probability of a possible answer position assignment for the document  $d$  is then defined as  $P([(i^{1},j^{1}),\ldots ,(i^{K},j^{K})]) = \prod_{k}P_{b}(i^{k})P_{e}(j^{k})$ .
As we can see from the above definition, due to the independence assumption, models using paragraph-level normalization do not learn to directly calibrate candidate answers from different paragraphs against each other.
Document-level model In document-level models, we assume that for a given question against document  $d$ , a single answer span is selected (as opposed to one for each paragraph in the paragraph-level models).<sup>4</sup> Here, the possible positions in all paragraphs are a part of a joint probability space and directly compete against each other.
In this case,  $\Omega$  is the set of token spans  $\{(i,j)\}$ , where  $i$  and  $j$  are the begin and end positions of the selected answer. The normalizing factors are therefore aggregated over all paragraphs, i.e.,
$$
Z _ {b} ^ {*} = \sum_ {k = 1} ^ {K} \sum_ {i \in \mathcal {I} ^ {k}} \exp (s _ {b} (i)), \tag {5}
$$
$$
Z _ {e} ^ {*} = \sum_ {k = 1} ^ {K} \sum_ {j \in \mathcal {I} ^ {k}} \exp \left(s _ {e} (j)\right). \tag {6}
$$
Compared with (3) and (4), since there is always a valid answer in the document for the tasks studied here, NULL is not necessary for document-level models and thus can be excluded from the
4 In this paper, we focus on datasets where the document is known to contain a valid answer. It is straightforward to remove this assumption and consider document-level NULL for future work.
<sup>3</sup>https://github.com/google-research/bert
5659
Coverage	Quality	Strength
H1	↑	↓	↑
H2	→	→	→
H3	↓	↑	↓
Table 1: Distant supervision assumptions and their corresponding tradeoffs.  $(\nearrow)$  indicates highest value,  $(\rightarrow)$  medium, and  $(\searrow)$  lowest value.
inner summation of (5) and (6). The probability of a possible outcome, i.e. an answer span, is  $P(i,j) = \exp (s_b(i) + s_e(j)) / (Z_b^* Z_e^*)$ .
3 Distant Supervision Assumptions
There are multiple ways to interpret the distant supervision signal from  $\mathcal{A}$  as possible outcomes in our paragraph-level and document-level probability spaces, leading to corresponding training loss functions. Although several different paragraph-level and document-level losses (Chen et al., 2017; Kadlec et al., 2016; Clark and Gardner, 2018; Lin et al., 2018; Min et al., 2019) have been studied in the literature, we want to point out that when interpreting the distant supervision signal, there is a tradeoff among multiple desiderata:
- Coverage: maximize the number of instances of relevant answer spans, which we can use to provide positive examples to our model.
- Quality: maximize the quality of annotations by minimizing noise from irrelevant answer strings or mentions.
- Strength: maximize the strength of the signal by reducing uncertainty and pointing the model more directly at correct answer mentions.
We introduce three assumptions (H1, H2, H3) for how the distant supervision signal should be interpreted, which lead to different tradeoffs among the desiderata above (see Table 1).
We begin with setting up additional useful notation. Given a document-question pair  $(d,q)$  and a set of answer strings  $\mathcal{A}$ , we define the set of  $\mathcal{A}$ -consistent token spans  $\mathcal{Y}_{\mathcal{A}}$  in  $d$  as follows: for each paragraph  $p_k$ , span  $(i^k,j^k)\in \mathcal{Y}_A^k$  if and only if the string spanning these positions in the paragraph is in  $\mathcal{A}$ . For paragraph-level models, if for paragraph  $p_k$  the set  $\mathcal{Y}_{\mathcal{A}}^k$  is empty, we redefine  $\mathcal{Y}_{\mathcal{A}}^k$  to be  $\{\mathrm{NULL}\}$ . Similarly, we define the set of  $\mathcal{A}$ -consistent begin positions  $\mathcal{Y}_{b,\mathcal{A}}^k$  as the start positions of consistent spans:  $\mathcal{Y}_{b,\mathcal{A}}^k = \cup_{(i,j)\in \mathcal{Y}_A^k}\{i\}$ .  $\mathcal{Y}_{e,\mathcal{A}}^k$  for  $\mathcal{A}$ -consistent end positions is defined
analogously. In addition, we term an answer span  $(i,j)$  correct for question  $q$ , if its corresponding answer string is a correct answer to  $q$ , and the context of the specific mention of that answer string from positions  $i$  to  $j$  entails this answer. Similarly, we term an answer begin/end position correct if there exists a correct answer span starting/ending at that position.
H1: All  $\mathcal{A}$ -consistent answer spans are correct. While this assumption is evidently often incorrect (low on the quality dimension  $\searrow$ ), especially for TriviaQA, as seen from Fig. 1, it provides a large number of positive examples and a strong supervi-sion signal (high on coverage  $\nearrow$  and strength  $\nearrow$ ). We include this in our study for completeness.
H1 translates differently into possible outcomes for corresponding models depending on the probability space (paragraph or document). Paragraph-level models select multiple answer spans, one for each paragraph, to form a possible outcome. Thus, multiple  $\mathcal{A}$ -consistent answer spans can occur in a single outcome, as long as they are in different paragraphs. For multiple  $\mathcal{A}$ -consistent answer spans in the same paragraph, these can be seen as mentions that can be selected with equal probability (e.g., by different annotators). Document-level models select a single answer span in the document and therefore multiple  $\mathcal{A}$ -consistent answer spans can be seen as occurring in separate annotation events. Table 2 shows in row one the log-probability of outcomes consistent with H1.
H2: Every positive paragraph has a correct answer in its  $\mathcal{A}$ -consistent set. Under this assumption, each paragraph with a non-empty set of  $\mathcal{A}$ -consistent spans (termed a positive paragraph) has a correct answer. As we can see from the TriviaQA example in Fig. 1, this assumption is correct for the first and third paragraph, but not the second one, as it only contains a mention of a noisy answer alias. This assumption has medium coverage  $(\rightarrow)$ , as it generates positive examples from multiple paragraphs but does not allow multiple positive mentions in the same paragraph. It also decreases noise (higher quality  $\rightarrow$ ) (e.g. does not claim that all the mentions of "Joan Rivers" in the first paragraph support answering the question). The strength of the supervision signal is weakened  $(\rightarrow)$  relative to H1, as now the model needs to figure out which of the multiple  $\mathcal{A}$ -consistent mentions in each paragraph is correct.
H2 has two variations: correct span, assuming
5660
Span-Based	Position-Based
H1	∑k∈K∑(ik,jk)∈YkA log Ps(i^k, j^k)	∑k∈K ∑i^k∈Yb,A log Pb(i^k) + ∑k∈K ∑j^k∈Ye,A log Pe(j^k)
H2	∑k∈K log Εi(k, jk)∈YkA Ps(i^k, j^k)	∑k∈K log Εi^k∈Yb,A Pb(i^k) + ∑k∈K log Εj^k∈Ye,A Pe(j^k)
H3	log Εk∈K Εi(k, jk)∈YkA Ps(i^k, j^k)	log Εk∈K Εi^k∈Yb,A Pb(i^k) + log Εk∈K Εj^k∈Ye,A Pe(j^k)
Table 2: Objective functions for a document-question pair  $(d, q)$  under different distant supervision assumptions.  $\Xi$  refers to  $\sum$  and max for MML and HardEM, respectively.
that one of the answer spans  $(i^k,j^k)$  in  $\mathcal{Y}_{\mathcal{A}}^{k}$  is correct, and correct position, assuming that the paragraph has a correct answer begin position from  $\mathcal{Y}_{b,\mathcal{A}}^{k}$  and a correct answer end position from  $\mathcal{Y}_{e,\mathcal{A}}^{k}$ , but its selected answer span may not necessarily belong to  $\mathcal{Y}_{\mathcal{A}}^{k}$ . For example, if  $\mathcal{A}$  contains  $\{abcd, bc\}$ , then abc would have correct begin and end, but not be a correct span. It does not make sense for modeling to assume the paragraph has correct begin and end positions instead of a correct answer span (i.e., we don't really want to get inconsistent answers like abc above), but given that our probabilistic model assumes independence of begin and end answer positions, it may not be able to learn well with span-level weak supervision. Some prior work (Clark and Gardner, 2018) uses an H2 position-based distant supervision assumption with a pair-paragraph model akin to our document-level ones. Lin et al. (2018) use an H2 span-based distant supervision assumption. The impact of position vs. span-based modeling of the distant supervision is not well understood. As we will see in the experiments, for the majority of settings, position-based weak supervision is more effective than span-based for our model.
For paragraph-level and document-level models, H2 corresponds differently to possible outcomes. For paragraph models, one outcome can select answer spans in all positive paragraphs and NULL in negative ones. For document-level models, we view answers in different paragraphs as outcomes of multiple draws from the distribution. The identity of the particular correct span or begin/end position is unknown, but we can compute the probability of the event comprising the consistent outcomes. Table 2 shows the log-probability of the outcomes consistent with H2 in row two (right for span-based and left for position-based interpretation, when plugging in  $\sum$  for  $\Xi$ ).
H3: The document has a correct answer in its  $\mathcal{A}$ -consistent set  $\mathcal{Y}_A$ . This assumption posits that the document has a correct answer span (or
begin/end positions), but not every positive paragraph needs to have one. It further improves supervision quality  $(\nearrow)$ , because for example, it allows the model to filter out the noise in paragraph two in Fig. 1. Since the model is given a choice of any of the  $\mathcal{A}$ -consistent mentions, it has the capability to assign zero probability mass on the supervision-consistent mentions in that paragraph.
On the other hand, H3 has lower coverage  $(\searrow)$  than H1 and H2, because it provides a single positive example for the whole document, rather than one for each positive paragraph. It also reduces the strength of the supervision signal  $(\searrow)$ , as the model now needs to figure out which mention to select from the larger document-level set  $\mathcal{V}_A$ .
Note that we can only use H3 coupled with a document-level model, because a paragraph-level model cannot directly tradeoff answers from different paragraphs against each other, to select a single answer span from the document. As with the other distant supervision hypotheses, span-based and position-based definitions of the possible consistent outcomes can be formulated. The log-probabilities of these events are defined in row three of Table 2, when using  $\sum$  for  $\Xi$ . H3 was used by Kadlec et al. (2016) for cloze-style distantly supervised QA with recurrent neural network models.
The probability-space (paragraph vs. document-level) and the distant supervision assumption (H1, H2, and H3, each position or span-based) together define our interpretation of the distant supervision signal resulting in definitions of probability space outcomes consistent with the supervision. Next, we define corresponding optimization objectives to train a model based on this supervision and describe the inference methods to make predictions with a trained model.
4 Optimization and Inference Methods
For each distant supervision hypothesis, we maximize either the marginal log-likelihood of  $\mathcal{A}$
5661
consistent outcomes (MML) or the log-likelihood of the most likely outcome (HardEM). The latter was found effective for weakly supervised tasks including QA and semantic parsing by Min et al. (2019).
Table 2 shows the objective functions for all distant supervision assumptions, each comprising a pairing of a distant supervision hypothesis (H1, H2, H3) and position-based vs. span-based interpretation. The probabilities are defined according to the assumed probability space (paragraph or document). In the table,  $\mathcal{K}$  denotes the set of all paragraphs in the document, and  $\mathcal{Y}^k$  denotes the set of weakly labeled answer spans for the paragraph  $p_k$  (which can be  $\{\mathrm{NULL}\}$  for paragraph-level models). Note that span-based and position-based objective functions are equivalent for H1 because of the independence assumption, i.e.  $P_s(i^k,j^k) = P_b(i^k)P_e(j^k)$ .
Inference: Since the task is to predict an answer string rather than a particular mention for a given question, it is potentially beneficial to aggregate information across answer spans corresponding to the same string during inference. The score of a candidate answer string can be obtained as  $P_{a}(x) = \Xi_{(i,j)\in \mathcal{X}}P_{s}(i,j)$ , where  $\mathcal{X}$  is the set of spans corresponding to the answer string  $x$ , and  $\Xi$  can be either  $\sum$  or max. It is usually beneficial to match the training objective with the corresponding inference method, i.e. MML with marginal inference  $\Xi = \sum$ , and HardEM with max (Viterbi) inference  $\Xi = \max$ . Min et al. (2019) showed HardEM optimization was useful when using an H2 span-level distant supervision assumption coupled with max inference, but it is unclear whether this trend holds when  $\sum$  inference is useful or other distant supervision assumptions perform better. We therefore study exhaustive combinations of probability space, distant supervision assumption, and training and inference methods.
5.1 Data and Implementation
Two datasets are used in this paper: TriviaQA (Joshi et al., 2017) in its Wikipedia formulation, and NarrativeQA (summaries setting) (Kočiský et al., 2018). Using the same preprocessing as