Towards Robust Numerical Question Answering: Diagnosing Numerical Capabilities of NLP Systems (2022)

Abstract: Numerical Question Answering is the task of answering questions that require numerical capabilities. Previous works introduce general adversarial attacks to Numerical Question Answering, while not systematically exploring numerical capabilities specific to the topic. In this paper, we propose to conduct numerical capability diagnosis on a series of Numerical Question Answering systems and datasets. A series of numerical capabilities are highlighted, and corresponding dataset perturbations are designed. Empirical results indicate that existing systems are severely challenged by these perturbations. E.g., Graph2Tree experienced a 53.83% absolute accuracy drop against the “Extra” perturbation on ASDiv-a, and BART experienced 13.80% accuracy drop against the “Language” perturbation on the numerical subset of DROP. As a counteracting approach, we also investigate the effectiveness of applying perturbations as data augmentation to relieve systems’ lack of robust numerical capabilities. With experiment analysis and empirical studies, it is demonstrated that Numerical Question Answering with robust numerical capabilities is still to a large extent an open question. We discuss future directions of Numerical Question Answering and summarize guidelines on future dataset collection and system design.

## introduction numeracy is an essential part for real-world nlp applications @xcite @xcite . numerical qa (question answering) is one representative group of such number-dependent nlp tasks. e.g., math word problem solving @xcite @xcite , discrete reasoning @xcite @xcite , tabular question answering @xcite @xcite . these numerical qa tasks require nlp systems to arrive at a numerical answer from the numbers in the question and context. by studying how existing nlp systems perform in these numerical qa tasks, we could take a glimpse at what capabilities are required for building nlp systems in the future. in an ad-hoc manner, a line of work revealed robustness issues of handling numerical qa in existing nlp systems. through adversarial attacks with designed dataset perturbations, numberrelated limitations were exposed: e.g., utilizing spurious correlation in datasets @xcite @xcite , incorrectly representing numbers @xcite and failing to extrapolate @xcite . this line of work inspires us to ask following questions: 1) what is the overall landscape of robustness issues of numerical capabilities in existing nlp systems? can we find a more systematic way to investigate the number-related limitations? 2) how to diagnose each numerical capability and evaluate the severity of it not being captured in a system? can we further develop new adversarial perturbation methods on numerical qa for diagnosis and evaluation? 3) how to address the numerical robustness issues? how do existing solutions work and what are possible future directions? to answer the above questions, in this paper we propose the dnc (diagnosing numerical capbilities) framework foot_0 as shown in figure 1 . most existing numerical qa systems (see §2.1) take a two-stage approach to extract and manipulate numbers. as shown in the qa stages part of figure 1 , systems usually first recognize numbers four capabilities are required to complete the stages, each maps to two perturbations. perturbations can be applied to appropriate train / validation / test splits of numerical qa datasets under attack or defense setting. models of the nlp systems are trained and then evaluated on the perturbed datasets as a diagnosis of their numerical capabilities. in the context and question and treat them as candidate operands. then, with the understanding of the question semantics, they select corresponding operands, and explicitly generate logical forms or implicitly execute operations to get the final result. the above two stages correspond to the two groups of numerical capabilities (see §4.1) covered by our dnc framework (as shown in figure 1 ). in stage 1, we focus on a system's capabilities to recognize different forms of numbers ("number detection"), and to parse and represent number values correctly ("number value understanding"). in stage 2, we focus on the capabilities to correctly choose operands ("operand selection") and operations ("operation reasoning") by understanding context and question. for each of these four capabilities, two perturbations (see §4.2) are proposed by us to diagnose the capability. each perturbation is designed to be trivial to humans and thus cannot easily fool humans, but it could bring down existing nlp systems (under the "attack" setting), and therefore expose the robustness issue of lacking its corresponding capability. by applying the above diagnosis to various nlp systems and numerical qa datasets (as shown in figure 1 ), in §5 we find that existing systems experience significant performance drops, which verifies their lack of robust numerical capabilities. e.g., graph2tree experienced a 53.83% absolute accuracy drop against the "extra" perturbation on asdiv-a, and bart experienced 13.80% accuracy drop against the "language" perturbation on the numerical subset of drop. from another point of view, the perturbations are also applicable for data augmentation. under the "defense" setting (see §4.3), perturbations are applied to all splits of the dataset. a system's performance of the same perturbation under both "attack" and "defense" settings are compared (in §5.2) to show if the corresponding robustness issue could be relieved by augmenting the training data. empirical results indicate that despite the recovery in most cases, the performance still fall lower than the original level. finally, based on the "attack" and "defense" results in §5 and additional experiments, in §6 we compare some existing design choices in numerical qa, such as: is it better to generate logical forms (and then execute the program/expression) or predict answers directly in an end-to-end way? shall we break numbers into subword tokens or substitute them with a placeholder that can be later re-substituted? we also discuss the open questions and future directions on the robust numerical capa-bilities of nlp systems, including recent relevant development such as neural program execution and numerical data synthesizing. in summary, our major contributions are: ## preliminaries a numerical question answering problem is defined to consist of a problem prompt (question) p and a problem body (context) b. depending on the task type, the problem body takes the form of either a paragraph or a mixture of free-form text paragraphs and structured data such as tables. let v be the vocabulary of the textual words, q be the set of the numerical values in p ∪ b, and q + be the numerical values that can be arithmetically computed with q, then the problem prompt and body can be formulated as here ⊕ denotes the concatenation operation, p • and b • are prompt and body textual words, and τ •,• are the body tabular cells. the target output t of the problem is either a numerical value t ans that is an element in q + or a mathematical expression t eq that consists of elements in the concerned numerical values q and the simple operators @xmath0, -, ×, ÷}. i.e. @xmath1: @xmath2: i t i , t @xmath3. with p and b as input and t as output, a trained numerical qa system can be regarded as a mapping f such that f : (p, b) → t note that this expression not only describes the numerical qa tasks, but also generalizes to other numeracy-related nlp tasks such as tabular entailment @xcite and timeseries-based fraudulent detection @xcite . in this paper, we design and apply perturbations to the samples in the dataset to form perturbed prompt p ⋆ , perturbed body b ⋆ and perturbed ground truth target t ⋆ . we show that existing systems are fragile against numerical pertubation by showing that on a large portion of the dataset, the previous mapping fails to generate correct perturbed target, i.e.: ## dnc framework our approach aims at diagnosing the numerical weakness of existing numerical question answering models. we list out and explain a series of numerical capabilities that are critical to solving numerical question answering problems in §4.1. we then design numerical perturbations targeting these capabilities in §4.2. with the designed perturbations, we examine the weaknesses under two different perturbations settings in §4.3. these three sections are represented in figure 1 . as the "capabilities" stripe, the "perturbs" stripe, and the "attack setting" and " defense setting". ## guidelines and open directions in this section, phenomena observed on different systems and datasets were summarized to provide comparison for existing methods. also, recent related efforts corresponding to these phenomena were discussed to point open directions in the domain of numerical qa. ## conclusion in this paper we aim at diagnosing numerical capabilities in existing nlp systems. we list out a series of numerical capabilities and design corresponding dataset perturbations. empirical results show that existing systems still lack numerical capabilities to a large extent, and this lack cannot be eliminated in a trivial manner. analysis into the empirical results, discussion of the the existing practices, and insights for future directions of numerical qa dataset collection and system design are also provided.