R obust LR : A Diagnostic Benchmark for Evaluating Logical Robustness of Deductive Reasoners (2022)

Abstract: Transformers have been shown to be able to perform deductive reasoning on inputs containing rules and statements written in the English natural language. However, it is unclear if these models indeed follow rigorous logical reasoning to arrive at the prediction or rely on spurious correlation patterns in making decisions. A strong deductive reasoning model should consistently understand the semantics of different logical operators. To this end, we present RobustLR, a diagnostic benchmark that evaluates the robustness of language models to minimal logical edits in the inputs and different logical equivalence conditions. In our experiments with RoBERTa, T5, and GPT3 we show that the models trained on deductive reasoning datasets do not perform consistently on the RobustLR test set, thus showing that the models are not robust to our proposed logical perturbations. Further, we observe that the models find it especially hard to learn logical negation operators. Our results demonstrate the shortcomings of current language models in logical reasoning and call for the development of better inductive biases to teach the logical semantics to language models. All the datasets and code base have been made publicly available.

## introduction building systems that can automatically reason over a given context to generate valid logical inferences is a long pursued goal within the field of ai @xcite @xcite . recently, @xcite have shown that language models @xcite are able to emulate deductive reasoning on a logical rulebase (theory) containing rules and declarative statements written in natural language. while this is impressive, it is unclear if these models are able to perform logical ## deductive reasoning in deductive reasoning, we predict whether a given theory t supports a statement s or not. we define a theory t as a set of facts @xmath0, f2, . . . , fn} and rules @xmath1, r2, . . . , rm} expressed in natural language (see figure 3 for an example). for a given theory, a statement can be either provably supported, provably unsupported (i.e., the negation of the statement is provable), or not provable at all. this is a 3-class classification problem, with the labels true, false, and unknown, respectively. in this work, we focus on this task, where we expect the model to correctly predict the entailment of a statement for a given theory. in figure 3 (a), 3(c), and 3(d), the statement is entailed by the theory, leading to the label true while in figure 3 (b), the statement is not provable given the facts and rules. it can be proved by simply using fact f 1 and rule r 1 to derive the statement. formally, we define the proof set of a statement s, denoted by g(t, s), as the set of rules and facts that are required to obtain the statement s from the theory. ## the robustlr dataset in this section, we describe details about the ro-bustlr dataset domains, sampling, and filtering procedure. ## experimental setup training data details we use four different training datasets to fine-tune baselines, described as follows: not: in this dataset, we allow negations in both facts and rules, but restrict to only using simple rules. note that it is not possible to create a dataset without any operators (i.e., no negation, conjunction, and disjunction) as it would not be possible to have the false label in that dataset. and+not: here, we restrict the connector for compound rules to and (∧). as before, we allow negations in facts and rules. or+not: similar to and+not, we restrict the connector of the compound rules to or (∨). we allow negations in facts and rules as before. all: this dataset has all the three logical operators (and, or, not) present. the dataset all contains all the logical operators we consider in the logical contrast set. thus, instances from the all dataset cover all forms of rules seen in these test sets. we aim to understand the effect of these training datasets on the evaluation sets by fine-tuning the model on each dataset separately. please refer to appendix c for more details on the training and evaluation data statistics. models and experiment details following prior works @xcite @xcite , we evaluate the performance of three language models: roberta @xcite , t5 @xcite , and gpt-3 @xcite . specifically, we evaluate the model checkpoints roberta-large, t5-large, t5-3b, t5-11b, and gpt-3. to evaluate a model, we first fine-tune it on one of the training dataset mentioned above, and then evaluate on the logical contrast (section 6.2) and logical equivalence (section 6.3) evaluation sets. for t5-11b, we only finetune it on the all dataset due to compute constraints. for gpt-3, we evaluate its performance on a subset of the test sets using demonstrations. please refer to appendix a for details on the input formats for each model and appendix b for the hyperparameter settings and other implementation details. ## related works reasoning in natural language has been a prevalent problem in nlp. there are multiple reasoning datasets, studying different aspects of reasoning over textual inputs. natural language inference (nli) @xcite is a prominent dataset that requires reasoning over text to answer if a statement is entailed, contradicted, or neutral given a hypothesis. hotpotqa @xcite tests multi-hop reasoning abilities that require comparisons and inferring missing bridge between sentences. clutrr @xcite tests whether models can infer biological relationships between entities in a context. rica @xcite requires the model to employ commonsense reasoning to answer questions based on a context. recently, there has been an increasing focus on evaluating the logical reasoning abilities of lms. reclor @xcite and logiqa @xcite are logical reasoning datasets derived from examinations. ruletaker @xcite proposes synthetic deductive reasoning datasets that uses only the knowledge in the context. there are very limited works that probe the logical reasoning abilities of language models (lms). fairr @xcite tests the robustness of logical reasoning models when the subjects and attributes in the context are altered to out-of-distribution terms. in a contemporary work, @xcite show that language models can learn to use statistical features that can be present in deductive reasoning datasets. to the best of our knowledge, robustlr is the first dataset that tests how robust these lms are to different logical perturbations. ## conclusion in this paper, we proposed robustlr, a diagnostic benchmark to test the logical robustness of deductive reasoning models. in robustlr, we propose two evaluation sets, logical contrast and logical equivalence, each probing different logical reasoning abilities. overall, we find that fine-tuning lms such as roberta and t5 on deductive reasoning datasets is not sufficient to learn the semantics of the logical operators conjunction, disjunction, and negation. although well-aligned training dataset improves model performance, the models still find it challenging to understand negations, both in logical contrast and logical equivalence sets. we demonstrate some interesting shortcoming of lms designed for logical reasoning, that can eventually enable building better reasoning models.