Large pre-trained language models (LMs) are known to encode substantial amounts of linguistic information. However, high-level reasoning skills, such as numerical reasoning, are difficult to learn from a language-modeling objective only. Consequently, existing models for numerical reasoning have used specialized architectures with limited flexibility. In this work, we show that numerical reasoning is amenable to automatic data generation, and thus one can inject this skill into pre-trained LMs, by generating large amounts of data, and training in a multi-task setup. We show that pre-training our model, GENBERT, on this data, dramatically improves performance on DROP ( 49 . 3  72 . 3 F 1 ), reaching performance that matches state-of-the-art models of comparable size, while using a simple and general-purpose encoder-decoder architecture. Moreover, GENBERT generalizes well to math word problem datasets, while maintaining high performance on standard RC tasks. Our approach provides a general recipe for injecting skills into large pre-trained LMs, whenever the skill is amenable to automatic data augmentation. Recently, models trained on large amounts of data with a language modeling (LM) objective, have shown great promise in natural language processing, exhibiting surprising amounts of knowledge and information (Peters et al., 2018; Devlin et al., 2019; Liu et al., 2019; Lan et al., 2019; Petroni et al., 2019; Hewitt and Manning, 2019). However, high-level skills, such as the ability to perform numerical reasoning over text, can be challenging to capture with a LM objective only. Consider the example in Table 1. To solve the first question (Q1), a model must capture the value of numbers in the  These authors contributed equally. Figure 1 : An overview of our approach for injecting numerical skills into a pre-trained LM. (a) We add two pre-training steps over large amounts of synthetic numerical data (ND) and textual data (TD); (b) we further fine-tune the model over either numerical reasoning datasets (DROP, MAWPS) or reading comprehension datasets (SQUAD). text, compute their difference, and generate the tokens corresponding to the result, which generally do not appear in the input passage. To make the task more manageable, state-of-the-art models have employed specialized architectures, restricting the space of possible numerical computations to a limited set. Modules were designed for counting (but only until 9') and for addition and subtraction (but of 2-3 numbers only). Such models perform well on existing datasets, such as DROP (Dua et al., 2019), but do not generalize to unsupported computations, which will require modifying the model architecture. Moreover, current models marginalize at training time over all numerical expressions that evaluate to the correct answer. Since the number of such expressions grows exponentially, scaling these approaches to arbitrary computations entails using non-differentiable operations (sampling or computing topK numerical expressions), which can lead to training difficulties. with different answer types. In this work, we propose that reasoning skills, such as numerical reasoning, are amenable to automatic data generation . Hence, one can inject that skill directly into the model by adding additional pre-training steps, allowing the model to learn the skill in an end-to-end fashion. This results in a fully-differentiable training procedure over a standard and general-purpose architecture, where the output space can be easily controlled through the data generation procedure. Specifically (Figure 1), we add to a large pre-trained LM two pre-training steps over automatically-generated synthetic data. First, we generate numerical data of the form 3 + 4 + 11 = 18 . Training on this data teaches the model to compute the value of numbers from their tokens and to perform numerical operations. Second, we automatically generate question-passage pairs that require numerical reasoning using a compact grammar ( textual data ). Training on this data endows the model with the ability to understand computations expressed in pseudo-natural language. In both pre-training steps, the model, GENBERT, generates output numbers token-by-token. Thus, the model has a standard architecture, where an answer can either be extracted from the input question and passage or generated from a decoder. Pre-training is done in a multi-task setup with a standard LM objective, in order to avoid catas-trophic forgetting (Kirkpatrick et al., 2017) of the linguistic information in the original LM. After pre-training, the model has sufficient language and numerical skills to be directly fine-tuned on a target numerical reasoning dataset, without resorting to specialized architectures. Augmenting more numerical skills does not require changing the model, only generating additional data. (b) Pre-training on these tasks provides GENBERT with 1) skills to reach performance that matches state-of-the-art models of comparable size on DROP (Dua et al., 2019), a standard numerical reasoning dataset, as well as 2) the ability to generalize to math word problem (MWP) datasets (Koncel-Kedziorski et al., 2016). (c) GENBERT learns these numerical skills while maintaining high performance on SQuAD (Ra-jpurkar et al., 2016), a standard reading comprehension dataset. (d) Initializing models for numerical reasoning with GEN BERT's weights improves their original performance. To conclude, in this work we address the problem of injecting LMs with numerical reasoning skills. Our contributions are:  A method for injecting skills into pre-trained LMs, given that automatic data generation is possible. GENBERT, an architecture for pre-trained LM with generative and extractive abilities. A framework for generating numerical and textual synthetic data for numerical reasoning. Our code and data can be downloaded from https://github.com/ag1988/ injecting_numeracy . Numerical reasoning over text (NRoT) is commonly set up as a reading comprehension (RC) task. Given a training set of question-context-answer triples { ( q i , c i , a i ) } Ni =1 , the goal is to learn a function that returns the answer a to a question q given a context c . However, in NRoT the answer generally requires to internally perform some numerical computation using the entities and numbers in the context. Specifically, the answer is either: (a) a span (or list of spans) from the context c or question q , or (b) a number that is the result of some computation (see examples in Table 1). Two natural, yet opposing, approaches lend themselves to tackling NRoT: (a) A symbolic approach : a model can read the question and context, output a numerical expression and evaluate the answer with an external symbolic calculator. This approach is a particular case of semantic parsing (Kamath and Das, 2019), and was common in early NRoT datasets (Koncel-Kedziorski et al., 2015; Roy and Roth, 2015; Hosseini et al., 2014). However, it suffers from several drawbacks. First, because numerical expressions are discrete and their space grows combinatorially, the model must learn to search in this space using non-differentiable operations, which are usually difficult to optimize. Second, numerical expressions are limited to numerical answers, while in DROP often a numerical computation is required but the final answer is a text span. (b) A distributed approach : have a model directly generate the answer given ( q , c ) . When the answer is a text span, the model can extract it from the input, and when the answer is a number that is not in q or c , the model must generate it. While this makes training straightforward, the model must learn to perform numerical computations from the relatively small target dataset. We empirically show in 3 that this leads to low performance in general. As a compromise, most NRoT models (Dua et al., 2019; Kinley and Lin, 2019; Hu et al., 2019; Efrat et al., 2019) have taken a hybrid approach: they augment standard extractive QA models with specialized modules for handling a limited set of numerical computations. We briefly describe this architecture, as it is the basis for our model in 3. Given a question with n 1 tokens q = ( q 1 , . . . , q n 1 ) and a context with n 2 tokens c = ( c 1 , . . . , c n 2 ) , the hybrid model first computes contextualized representations for the n 1 + n 2 + 3 tokens (cid:104) [CLS] q [SEP] c [SEP] (cid:105) using a pre-trained LM, such as BERT (Devlin et al., 2019): L = LM ( q , c ) . The representations L are then passed to multiple heads , which are small neural networks that estimate p ( a | q , c , h ) , that is, the probability of the answer given the input and conditioned on a head h , corresponding to a particular answer type:  Context span head : computes a distribution over all spans in the context using a feed-forward network (FFN) FF c ( L ) . Question span head : computes a distribution over spans in the question using a FFN FF q ( L ) . Count head : computes a distribution over the numbers { 0 , . . . , 9 } using a FFN FF cnt ( L ) . Arithmetic head : computes a distribution over all signed combinations of numbers in the context using a FFN FF cmb ( L ) (the numbers in the context are identified in a pre-processing step). While the first two heads are standard in extractive QA, the latter two heads are specialized and meant to handle answers that do not appear in the input. Finally, for deciding which answer head to use for a given input, a type head FF typ ( L ) outputs a probability distribution p head ( h | q , c ) (using a FFN). Thus the model probability for an answer is p ( a | q , c ) = (cid:88) h  heads p head ( h | c , q )  p ( a | c , q , h ) . Training is done by enumerating all of the ways in which the answer can be obtained using all of the heads, and maximizing this marginal probability. While existing models perform well on DROP, the aforementioned architecture is not flexible. First, the output space is severely constrained  the model can only count up to 9', and numerical computations are restricted to signed combinations of a few numbers. Second, expanding the space of supported numerical computations is non-trivial, because training involves marginalizing over all expressions that lead to the correct answer. Since the space of numerical expressions grows exponentially, expanding this space quickly leads to a difficult search problem. Third, delegating numerical computations to an external symbolic calculator leads to modeling challenges, since there could be interactions between text and numerical computation: Consider the DROP question How many total yards did Phil Dawson throw for touch-downs? . Current models handle such questions by computing a sum from numbers in the text and returning the result. However, if the question was Who threw 45 total yards for touchdowns? , the model would have to compute the sum internally , and then find the relevant span in the text. This is impossible when the computation itself is delegated to an external calculator. Thus, training models to handle such numerical questions is desirable. Motivated by the above arguments, we wish to push the frontier of end-to-end differentiable models for numerical reasoning. Thus, we will automatically generate large amounts of data that endow a pre-trained LM with numerical skills. We now describe a simple BERT-based generative model that performs numerical computations internally, termed GENBERT. The model combines the Transformer encoder-decoder architecture (Vaswani et al., 2017) with a pre-trained LM, specifically, BERT. Our architecture is illustrated in Figure 2. Our encoder is a standard Transformer, initialized with BERT weights. To also enjoy BERT's representations at decoding time, we tie the weights of the decoder and the encoder. Because the Transformer decoder has source attention weights (weights for attending to the encoder representations at decoding time) that are not present in BERT, we tie these source-attention weights to the self-attention weights of the encoder (which are tied to the self-attention weights of the decoder). This fully initializes the Transformer model with BERT weights. Since the encoder and decoder weights are tied, we make them learn distinct representations by adding a FFN FF enc that transforms the encoder contextualized representations L enc as H enc = layer-norm ( gelu ( W  L enc )) , where W is a parameter matrix (Hendrycks and Gimpel, 2016; Ba et al., 2016). Analogously, we add FF dec to the decoder. To further distinguish the encoder and decoder, we use distinct start and end tokens for input and output sequences. Given m answer tokens a = ( a 1 , . . . , a m ) , we form an output sequence with m + 2 tokens: (cid:104) [SOS] a [EOS] (cid:105) . The output tokens are passed through the decoder and FF dec to obtain H dec . Finally, the probability of an answer is defined in the usual manner: Let (cid:104) a (cid:105) = ( a 0    a m +1 ) be the output sequence. The decoder outputs the probability p dec ( a i +1 | a 0 , ..a i , c , q ) , and the probability of an answer is: p dec ( (cid:104) a (cid:105) | c , q ) = m (cid:89) i =0 p dec ( a i +1 | a 0 , ..a i , c , q ) . As we have a generative model, we can remove the specialized count and arithmetic heads from 2. Thus, the type head FF typ ( H enc ) outputs a distribution ( p q , p c , p dec ) over the context span, question span, and decoder heads. To improve pre-training on the numeric data (4), we make two additional modifications. Digit Tokenization (DT) Conventional wordpiece tokenization treats numbers no differently than any other token. However, computing the value of numbers should be simpler when using digits directly (Wallace et al., 2019). Hence, we tokenize numbers digit-by-digit. For example, a wordpiece ## d 1    d k where d i  {0,...,9} is further split into ## d 1 , ..., ## d k . We show in 5.1 that this substantially improves sample complexity when training to perform numerical operations. Figure 2 : GEN BERT's network architecture: (a) a high-level overview of the network, including a generative head (red), two span-extraction heads (yellow), and an answer type head. (b) a closer overview of GEN BERT's generative head. Random Shift (RS) The original Transformer uses absolute positional embeddings for each token. However, in 4, we train on short inputs such as 1086.1 2.54 + 343.8 . Thus, the model can potentially over-fit and learn to perform numerical reasoning only when numbers are at the beginning of an input. To prevent this, when the input length n 1 + n 2 + 3 < 512 , we shift all position IDs by a random integer in (0 , 1 , . . . , 512  ( n 1 + n 2 + 3)) . Training For each span ( i, j ) , a span extraction head h outputs its probability p h (( i, j ) | c , q , h ) of being the answer. Let S be the set of spans in the input corresponding to the gold answer. The model loss L model marginalizes over all ways in which the answer can be predicted:  log (cid:18) p dec  p dec ( (cid:104) a (cid:105) ) + (cid:88) h  q , c p h  (cid:88) ( i,j )  S p h ( i, j ) (cid:19) , where conditionals have been dropped for brevity. To evaluate the ability of GENBERT to perform numerical reasoning, we initialize it with BERT and fine-tune it on DROP. GENBERT obtains 46.1 EM and 49.3 F 1 , roughly 20 points lower than prior models. Thus, we conclude that acquiring numerical reasoning skills from DROP data only is difficult. To remedy this, we will automatically generate training data that will endow GENBERT with numerical skills before training it on DROP. Jackson scored 3 running 4 Pre-training Tasks for Numerical Skills We now describe two automatically-generated datasets and the multi-task training procedure. touchdowns . Template extraction To extract templates, we go over sentences from the corpus provided by Hosseini et al. (2014). For each sentence, we use a procedure described by Hosseini et al. (2014) to abstract its tokens to the following categories: numbers ( NUM ), entities ( ENT ), containers ( CONT ) and attributes ( ATTR ). In addition, verbs are abstracted to six categories, each corresponding to a different change in the number of entities owned by containers. Thus, each template fully specifies how to update a world state , i.e., the number of entities each container owns. The top part of Figure 3 illustrates the abstraction process. Finally, we count for each extracted template its frequency in the data, and use the top12 templates for passage generation. Details on the abstraction process, categories used, and extracted templates are in A.2. Figure 3 : Template extraction and instantiation. A template (in red) is extracted from a MWP sentence, using categories for containers, entities, verbs, attributes and numbers, according to Hosseini et al. (2014). For generation, the categories are instantiated with a domain-specific vocabulary. Our first dataset focuses on learning numerical values expressed by tokens and computing numerical operations, i.e., it does not involve textual content. As such, it is easy to craft templates that correspond to various numeric operations. We designed six such templates, described in Table 2. Each template consists of an expression to evaluate and its solution. Further details on their instantiation are provided in A.1. While the numerical operations were chosen based on DROP, it is trivial to extend them to other domains (Saxton et al., 2019) with different numerical operations. Numeric data is easy to generate, since it does not contain any textual context. However, to tackle NRoT, a model needs to comprehend how numerical operations are expressed in text that refers to events, entities and quantities. This primes us to generate textual data from a simple grammar. While text generation is hard in the general case, we are specifically interested in text that focuses on number manipulations. Therefore, we use the framework of Hosseini et al. (2014), who proposed to model math word problems with a simple structure. In their framework a world state consists of entities , which are objects that are being counted, and containers , which are objects that own entities. Sentences use verb categories to describe how the number of entities in a container changes, and thus a world state can be updated given a sentence. Consider the textual example in Figure 1. the entities are soldiers and citizens, and the containers are the king and the commander. The verbs ( had and received ) describe the entities the king holds, and how many were passed to the commander. In this work, we use this framework to automatically generate examples. We extract templates that describe changes in the number of entities owned by containers, and automatically generate question-context pairs from these templates. Passage generation Using the extracted templates, we can generate sentences and maintain a world state of all containers and the number of entities they own. We construct a small vocabulary (<100 words) that maps categories to domain-specific words, and use the following procedure to generate passages. We sample 3-6 templates with replacement, and instantiate them one-by-one (the bottom part of Figure 3 illustrates instantiation). Each template is instantiated by uniformly sampling values from the vocabulary with probability 1  p and from previously generated sentences with probability p . To avoid a collection of unrelated sentences, we set the probability of using previously used values to p = 0 . 7 . An example passage is shown in Table 3. Question generation After generating a passage, the world state holds information about all containers in the passage and the number of entities they hold. In Table 3, the state will include the number of families and rebels of different nationalities in each container (the commander, the householder, and the countries). Based on this world state, numerical reasoning questions can be asked. To create questions, we craft 13 question templates that are instantiated with objects from the world state. The questions teach the model to track events and perform numeric and discrete operations. Table 2 : Templates for generating synthetic numerical examples and the numerical operations required to answer them. Domains (defined in App. A.1): s i  { , + } , f i  R + , o  O : superlative words like longest , arg  { arg min , arg max }, w i  W : words from NTLK Words Corpus, d i  D : dates until Sep 2019, dsup  DSUP : superlative words like latest , prd  { days , months , years }, p i  (0 , 100) , pcent  { percent , percent not }. P : The commander recruited 1949 Polish families in Spain. The householder recruited 1996 Japanese families in Spain. There were 10913 white rebels and 77 Chinese families in Spain. 6641 British soldiers, 476 asian rebels, and 338 Germans families were recruited in Russia. Q : How many Japanese families were in Spain? A : 1996 Q : How many more Japanese families were in Spain than Polish families? A : 47 (1996-1949) Q : How many families of Spain were not Polish families? A : 2073 (4022-1949) Table 3 : An example synthetic passage (P) and questions. Questions (Q) were generated from templates and answers (A) were calculated based on the world state. Examples for generated questions are shown in Table 3, where answers are computed from the world state. Overall, we create 13 question templates for 7 different skills", provided in A.2. For pre-training on ND, we generated 1M examples for training and 10K for validation. For TD, we generated 2.5M examples for training and 10K for validation. For both synthetic datasets, we used the GENBERT model loss, L model , from 3. To ensure that the model does not lose its language understanding abilities, we employ a multi-task setup, and include a standard masked LM objective from BERT. Specifically, given a masked token sequence (cid:104) m (cid:105) , we compute the contextualized representations, L enc and pass them through a feed-forward network FF mlm . For each masked index i , it outputs the probability p ( a i | i, (cid:104) m (cid:105) ) of the original token a i . The MLM loss is computed as L mlm ( (cid:104) m (cid:105) ) = mean i  masked  log( p ( a i | i, (cid:104) m (cid:105) )) . During training, we sample mini-batches from the respective datasets, and minimize the weighted sum of the losses. Concretely, while pre-training on ND and TD, we sample mini-batches XND , XTD and XMLM and optimize the objective L model ( XND ) + L model ( XTD ) +   L mlm ( XMLM ) . Figure 4 : Progression of eval accuracy (EM) of GENBERT, for different pre-training settings listed in 5.1. We now evaluate our two pre-training steps and their applicability for numerical reasoning tasks. We consider the following variants, aiming to investigate the contributions of ND and TD, the importance of MLM loss, and techniques like DT and RS. In all cases, we initialize GENBERT with BERT-base-uncased, use DT and RS, and include the MLM loss, except where noted :  GENBERT +ND : trained on numerical data. GENBERT +ND-LM : trained on ND without the additional MLM loss. GENBERT +ND-LM-DT : trained on ND using wordpiece tokenization, without the MLM loss. GENBERT +ND-LM-RS : trained on ND without MLM loss and random shift (RS). GENBERT +TD : trained on textual data (TD). GENBERT +ND+TD : GENBERT +ND trained on both ND and TD. We first ask whether the pre-training procedure allows GENBERT to absorb the intended numerical skills. We observe that across various settings (ND, TD, ND+TD), GENBERT consistently achieves more than 96% accuracy in predicting the correct solution for both ND and TD. Thus, we conclude that indeed a pre-trained LM can learn the designed skills from generated data. Figure 4 shows the learning curves of GENBERT for the different variants. Note that in ND-LM-DT the model does not learn to solve the numerical data task. This demonstrates the utility of using DT over conventional wordpieces. The lower sample complexity in the case of ND+TD compared to the only-TD can be attributed to the fact that ND and TD share some numeric skills and hence a model already trained on ND converges faster on TD compared to GENBERT. After successfully injecting GENBERT with numeric skills, we test GENBERT guided by the following questions: (a) Are the injected skills robust and generalize to NRoT datasets like DROP? (b) Are the new skills learned at the expense of the model's ability to understand language? (c) Can the pre-trained weights be used with architectures other than GENBERT? For (a), we fine-tune GENBERT on DROP and further evaluate on MWP in a zero-shot setup . For (b), we evaluate GENBERT on a RC task that does not involve numerical reasoning, namely, SQUAD (Rajpurkar et al., 2016). For (c), we use GENBERT encoder as a drop-in replacement for BERT on two other architectures. Results on DROP We report results of GENBERT initialized by BERT-base and leave pretraining a larger model for future work. We compare GENBERT to MTMSN (Hu et al., 2019) initialized with BERT-base, as MTMSN initialized with BERT-large is a state-of-the-art model on DROP. 1 Table 4 presents fine-tuning results on DROP. Without pre-training, GENBERT performs poorly compared to current state of the art models like MTMSN, reporting an EM of only 46.1. Pretraining on each of the numerical data (ND) and textual data (TD) improves performance dramatically to 64.7 EM and 64.4 EM, respectively. Moreover, pre-training on both ND and TD leads to a performance of 68.8 EM, on par with MTMSN's 68.2 EM. This demonstrates that the skills that GENBERT learns from ND and TD are complementary. In addition, the lower performance of GENBERT +ND-LM and GENBERT +ND-LM-RS 1 Per ACL policy, we compare to models that were made public 3 months prior to submission. Table 4 : Performance of GENBERT and comparable models on the development and test sets of DROP. Table 5 : F 1 scores on DROP development per answer type. Breaking down performance by answer type (Ta-ble 5) highlights several points. First, pre-training on ND and TD improves performance mostly due to number answer types, as expected. Second, GENBERT +ND+TD outperforms MTMSNBASE on questions whose answer is a span . We argue a probable cause for this are span questions that require performing a numerical computation internally, as explained in 2. Third, MTMSNBASE substantially outperforms GENBERT on questions whose answer is a list of non-contiguous spans. This is expected, as MTMSN has a specialized head and procedure for handling such questions, while build on a simpler and more standard RC architecture. Generalization to MWP (zero-shot) The MAWPS repository is a collection of math word problem (MWP) datasets (Koncel-Kedziorski et al., 2016). To test the models on skills they were trained on, we picked datasets with addition and subtraction problems, and filtered out examples with other operations (e.g., multiplication and division). All models that were fine-tuned on DROP were evaluated in a zero-shot setup on 395 examples from ADDSUB (Hosseini et al., 2014), 321 from SOP (Roy et al., 2015), and 305 from SEQ (Koncel-Kedziorski et al., 2015). Results are shown in Table 6. Overall, GENBERT +ND+TD dramatically improves performance compared to GENBERT. GENBERT +ND performs much better than GENBERT +TD , demonstrating the utility of ND when the context is short. # terms Figure 5 : Breakdown of model accuracy (EM) by the number of terms in the arithmetic expression, for the MWP datasets ADDSUB , SOP and SEQ . Last, MTMSN outperforms GENBERT +ND+TD . However, MTMSN uses a specialized architecture for addition and subtraction, suitable when calculations are done outside of the model. GENBERT, on the other hand, is a general-purpose generative model, that can also return span answers when the computation is done internally. Next, we break down performance by the number of terms in the arithmetic expression (Figure 5). The plot shows that all models struggle to generalize to more complex problems, and completely fail when the calculation involves more than 3 terms. Interestingly, the drop in performance of GENBERT +ND+TD between 2 and 3 terms is sig-nificantly smaller than that of GENBERT +ND and GENBERT +TD . This suggests that both ND and TD are useful for improving robustness. Error analysis To understand the limitations of our method, we analyze the errors of GENBERT +ND+TD on the development set of DROP, excluding questions with a multi-span answer which are not supported by the model. We sample 100 random examples for which GENBERT +ND+TD fails to predict the correct answer and manually analyze the types of questions and mistakes done by the model. We find that in almost half of the cases (43%), the example requires reasoning skills that are either not covered by the pre-training tasks (e.g. sorting), or not numerical. Another common case (23%) is inaccurate predictions, such as spans that are too EM F 1 BERT 81.1 88.6 GENBERT +ND-LM 78.1 85.8 GENBERT +ND 80.7 88.1 GENBERT +TD 80.7 88.2 GENBERT +ND+TD 81.3 88.6 Table 7 : Performance on SQuAD v1 development set. long and numbers with partial digit match to the gold answer. We note that many of these errors can be addressed by extending the pre-training tasks to cover additional numerical skills and a larger number range. We leave such extensions for future work. Further details and example failure cases are provided in A.5. Having shown that our models successfully learned to perform NRoT, we investigate if this improvement comes at the expense of performance on RC datasets. We initialize the RC model from Devlin et al. (2019) with GENBERT weights (encoder only) and fine-tune it on SQUAD v1. As shown in Table 7, the performance of GENBERT +ND+TD is almost identical to the original BERT. Moreover, GENBERT +ND-LM reported a loss of 3 EM points highlighting the importance of using the MLM loss. To further establish the utility of GENBERT, we used the weights of GENBERT +ND+TD to initialize the encoder of NABERT+ and MS-TAG, a recent multi-span tagging model of Efrat et al. (2019). Fine-tuning on DROP shows an improvement of  2 EM points compared to the originally reported performance: 63 . 0  65 . 1 EM for NABERT+, and 67 . 3  69 . 3 EM for MS-TAG. This shows that GENBERT can be used as a drop-in replacement for BERT, when numerical reasoning is needed. To summarize, we have empirically shown that one can inject numerical reasoning skills into a pre-trained LM, resulting in good performance on DROP, generalization to MWP, while maintaining high performance on standard RC datasets. Moreover, the resulting weights can be used for initializing numerical reasoning models. Most NRoT models designed for DROP are extractive QA models augmented with specialized modules (2). Two recent work (Andor et al., 2019; Chen et al., 2020) take a more symbolic approach and output a symbolic program augmented with operations over text. In our work, numerical computations are latent and performed internally by the model. A related line of work has been analyzing the mathematical reasoning abilities of neural models over text (Wallace et al., 2019; Rozen et al., 2019; Ravichander et al., 2019), and on arithmetic problems (Saxton et al., 2019; Amini et al., 2019; Lample and Charton, 2020). Designing pre-training tasks to teach LMs additional skills has been applied by Huang et al. (2019), who designed cross-lingual pre-training tasks to teach better mappings between languages, and Lee et al. (2019), who introduced the Inverse Cloze Task to pre-train an information retriever. Large pre-trained LMs lack high-level skills such as numerical reasoning. Consequently, current models that perform numerical reasoning over a pre-trained LM resorted to customized modules with limited flexibility. In this work, we propose a general method for injecting additional skills into LMs, assuming automatic data generation is possible. We apply our approach to the task of numerical reasoning over text, using a general-purpose model called GENBERT, and a simple framework for generating large amounts of synthetic examples. Our experiments demonstrate the effectiveness of our method, showing that GENBERT successfully learns the numerical skills, and performs on par with state-of-the-art NRoT models of the same size. We thank Daniel Andor and Thang Luong for helpful discussions, and Shimi Salant for constructive suggestions. This research was partially supported by The Israel Science Foundation grant 942/16, The Yandex Initiative for Machine Learning, and the European Research Council (ERC) under the European Union Horizons 2020 research and innovation programme (grant ERC DELPHI 802800).
abstain abstain abstain result objective abstain method abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain objective abstain abstain method objective abstain method abstain abstain abstain abstain abstain abstain objective objective objective abstain objective objective objective other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain other other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method method abstain method abstain abstain abstain method method method method abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain method abstain abstain method abstain method abstain method method abstain abstain abstain method abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain method method abstain abstain abstain abstain abstain method method method method method abstain method abstain abstain abstain abstain abstain method abstain abstain other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method method method method abstain method abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain other other method other other abstain abstain objective objective objective other other