L ogic NMR : Probing the Non-monotonic Reasoning Ability of Pre-trained Language Models (2022)

Abstract: The logical reasoning capabilities of pre-trained language models have recently received much attention. As one of the vital reasoning paradigms, non-monotonic reasoning refers to the fact that conclusions may be invalidated with new information. Existing work has constructed a non-monotonic inference dataset \delta -NLI and explored the performance of language models on it. However, the \delta -NLI dataset is entangled with commonsense reasoning. In this paper, we explore the pure non-monotonic reasoning ability of pre-trained language models. We build a non-monotonic reasoning benchmark, named LogicNMR, with explicit default rules and iterative updates. In the experimental part, the performance of popular language models on LogicNMR is explored from the perspectives of accuracy, generalization, proof-based traceability and robustness. The experimental results show that even though the fine-tuned language models achieve an accuracy of more than 94.4% on LogicNMR, they perform unsatisfactorily, with a significant drop, in generalization and proof-based traceability.

## introduction non-monotonic reasoning, also called defeasible reasoning, is one of the important reasoning modes in logic, which has been extensively studied in classical ai. the term non-monotonic reasoning was first introduced by @xcite . generally, non-monotonic reasoning refers to the fact that conclusions may be invalidated with new information @xcite . the research on non-monotonic reasoning in traditional ai mainly focuses on formalizing nonmonotonic reasoning via different logics, such as default logic @xcite , circumscription @xcite , and autoepistemic logic @xcite . non-monotonic reasoning is widespread in everyday life and plays a crucial role in both daily decision-making @xcite and legal reasoning @xcite . most of what we learn about the world is in terms of generics, properties that hold "in general", but with exceptional cases. when we say "birds can fly", we mean "birds can usually fly", and there are exceptional cases such as ostrich or wounded birds. such rules are called default rules. figure 1 shows a typical example of non-monotonic reasoning. suppose we desire to find john on saturday evening and know he usually visits his club every saturday evening. we thus infer that he will be at his club. however, if we are told john had a car accident yesterday, we would conclude he will likely be in a hospital. then if we get to know john was not injured, we redraw the conclusion he visits his club. this example illustrates the dynamic nature that a context is constantly updated with new information and queried. recently, whether pre-trained language models truly have logical reasoning abilities has received extensive attention. although pretrained language models have made significant progress on many natural language understanding tasks, such as knowledge-based question answering @xcite and com- old man crafting something in his workshop. hypothes: an old man is working. the man is wearing pajamas and is chuckling. type: strengthener / weakener [answer: w] monsense reasoning @xcite , etc, some research has shown that the prediction of pre-trained language models is easily affected by spurious correlations @xcite , so it is difficult to judge the logical reasoning abilities of the evaluated models. it is still in the preliminary research stage to probe whether pre-trained language models have non-monotonic reasoning mechanisms. @xcite construct a non-monotonic inference dataset δ-nli through crowdsourcing based on three existing datasets. for δ-nli, the authors develop a classification and generation task, and demonstrate that the classification task is easily solved by pretrained language models, but the generation task is much more challenging. to disentangle deductive reasoning from commonsense reasoning, and explore pure deductive reasoning capabilities of pre-trained language models, @xcite introduce a synthetic dataset with explicit rules and facts, and show that fine-tuned language models perform well on this dataset. ## related work many benchmarks involve logical reasoning, but entangled with commonsense reasoning, on one hand, natural language inference (nli) is to determine the inference relation between two texts, including entailment, contradiction, or neutral. for example, @xcite present a significant nli benchmark snli, a collection of 570k english sentence pairs. @xcite explore the symbolic reasoning and monotonic reasoning abilities in pre-trained language models through semantic fragments. on the other hand, in machine reading comprehension, logicqa @xcite and reclor @xcite are two popular multiple-choice datasets involving complex logical reasoning, such as deductive reasoning and abductive reasoning. @xcite and @xcite construct relationship graphs by extracting the basic units in the context, and then combine pre-trained language models and graph neural networks to solve logicqa and reclor. following @xcite , several other works focus on non-monotonic reasoning. to further explain why the updated information can cause the credibility of the original conclusion to change, @xcite use distant supervision to generate reasons for δ-nli. @xcite generate influence graphs through transfer learning to effectively improve performance on defeasible reasoning tasks. @xcite propose a model that can simulate thinking about question scenarios based on influence graphs to enhance the performance of defeasible reasoning tasks. the work of @xcite initiated a line of research to explore logical reasoning capabilities in language models. @xcite present the logicnli benchmark for first-order logical reasoning and propose proof-based traceability to more effectively evaluate the logical reasoning abilities of language models. @xcite propose a dataset rulebert with rules with probability in order to teach pre-trained language models to reason on soft horn rules. @xcite introduce a dataset entailmentbank with explanations in the form of entailment trees. ## default logic and asp in this work, we choose reiter (1980)'s default logic, one of the major formalisms for non-monotonic reasoning, as the logic underlying logicnmr. a default rule is in the form of α : β 1 , β 2 , . . . , β m /γ, where α, β i and γ are formulas in first-order logic, α is called the prerequisite, β 1 , β 2 , • • • , β m the justifications, and γ the conclusion. the interpretation of the default rule is that if you can infer α, and β 1 , β 2 , • • • , β m are consistent, then infer γ. a default theory is a pair @xmath0, d⟩, where w is a set of facts, which are firstorder sentences, and d is a set of default rules. for example, a default theory t 0 consists of w 0 = {f resh(a), af raid(a)} and here |= denotes the logic entailment relation for first-order logic. for example, in this paper, to reduce the complexity of the default theory, we make a set of restrictions. variables and constants are terms, and p (t 1 , ..., t n ) is an atom when p is an n-ary predicate symbol and t 1 , .., t n are terms. a literal is an atom or the negation of an atom. w is restricted to be a set of literals. α is the conjunction of at most two literals, there are at most two justifications, each justification is a literal, and γ is a literal. in addition, we require that: for each default theory, for any justification of any default rule, its negation does not appear as the conclusion of any other default rule. it is easy to show that under the above restrictions, each theory t has a unique extension, written e(t ). then for any sentence ϕ, we write t ⊢ ϕ if ϕ ∈ e(t ). we define ans(t, ϕ) as follows: @xcite show that in the propositional case, each default theory is equivalent to an answer set program. answer set programming (asp) @xcite is an approach to declarative programming with efficient solvers, such as clyngor foot_0 . under our restrictions, a default theory t can be converted to an equivalent answer set program δ(t ) as follows: each default rule α : β 1 , β 2 , ..., β m /γ is converted to an asp rule then the unique extension for t can be computed by computing the answer set for δ(t ) by resolving to an asp solver such as clyngor. ## logicnmr benchmark to probe pure non-monotonic reasoning abilities in language models, we generate a nonmonotonic reasoning benchmark logicnmr with explicit facts and default rules and iterative updates and queries. our dataset is available at https://github.com/sysulic/logicnmr . overview of dataset generation. figure 2 gives an overview of the generation process for a sample in logicnmr. first, we generate an initial knowledge base (kb) containing default rules and facts. then, we generate the iterative updates and queries. next, we generate the label and associated proof for each update and query. finally, we convert the initial kb, updates, queries and proofs into synthetic english using simple templates. the predicate pool for logicnmr includes unary and binary predicates, where the unary ones are 529 adjective words from @xcite , and the binary ones are 46 adjective words that describe relationships between subjects. each sample is restricted to a subject, which is a name. figure 3 shows a logicnmr sample represented with formulas. here, t refers to the initial kb where there is a single fact and multiple default rules. u i is the new fact for the i-th update, and q i is the query for the i-th update. for each query, when the label is t or f, a proof is a sequence of intermediate necessary conclusions during the reasoning process for the query. in the following, we give detailed descriptions for each step of figure 2 . ## experiments in this section, by following @xcite , we explore the non-monotonic reasoning ability of pre-trained language models in terms of accuracy, generalization, proof-based traceability, and robustness, respectively, based on logicnmr. ## conclusions in this paper, we construct a synthetic nonmonotonic reasoning benchmark, logicnmr, with explicit facts and rules, to capture the iterative update on the knowledge base. we probe whether the pre-trained language models have truly mastered the non-monotonic reasoning ability. the experimental results show that even though the fine-tuned language models all achieve a high accuracy, they perform worse on generalization, proof-based traceability and robustness to irrelevant information. consequently, we cannot give a positive answer to the research problem whether the language models master the non-monotonic reasoning ability. it suggests us to explore a better approach to take advantage of the language models to conduct non-monotonic reasoning tasks.