Can Pretrained Language Models (Yet) Reason Deductively? (2023)

Abstract: Acquiring factual knowledge with Pretrained Language Models (PLMs) has attracted increasing attention, showing promising performance in many knowledge-intensive tasks. Their good performance has led the community to believe that the models do possess a modicum of reasoning competence rather than merely memorising the knowledge. In this paper, we conduct a comprehensive evaluation of the learnable deductive (also known as explicit) reasoning capability of PLMs. Through a series of controlled experiments, we posit two main findings. 1) PLMs inadequately generalise learned logic rules and perform inconsistently against simple adversarial surface form edits. 2) While the deductive reasoning fine-tuning of PLMs does improve their performance on reasoning over unseen knowledge facts, it results in catastrophically forgetting the previously learnt knowledge. Our main results suggest that PLMs cannot yet perform reliable deductive reasoning, demonstrating the importance of controlled examinations and probing of PLMs’ deductive reasoning abilities; we reach beyond (misleading) task performance, revealing that PLMs are still far from robust reasoning capabilities, even for simple deductive tasks.

## introduction pretrained language models (plms) such as bert @xcite and roberta @xcite have orchestrated tremendous progress in nlp across a large variety of downstream applications. for knowledge-intensive tasks in particular, these large-scale plms are surprisingly good at memorising factual knowledge presented in pretraining corpora @xcite and infusing knowledge from external sources @xcite , demonstrating their effectiveness in learning and capturing knowledge. bert training a raven can fly. original bird bird bird prediction inference a bird can fly. a raven is a bird. a [mask] can fly. a [mask] can fly. a [mask] cannot fly. the [mask] species is decreasing. r-bert bert raven raven raven r-bert negation query neutral (a) (b) figure 1 : training and inference for deductive reasoning. given the explicit premises (a), the input bert model is trained to get transformed into a reasoner r-bert model by deductively predicting a previously unseen conclusion (b). this inference process requires r-bert to understand factual knowledge and interpret rules (e.g. taxonomic relations), intervening directly in the deduction process. automatic reasoning, a systematic process of deriving previously unknown conclusions from given formal representations of knowledge @xcite , has been a longstanding goal of ai research. in the nlp community, a modern view of this problem @xcite , where the formal representations of knowledge are substituted by the natural language statements, has recently received increasing attention, foot_0 yielding multiple exploratory research directions: mathematical reasoning @xcite , symbolic reasoning @xcite , and com-monsense reasoning @xcite . impressive signs of progress have been reported in teaching plms to gain reasoning ability rather than just memorising knowledge facts @xcite , suggesting that plms could serve as effective reasoners for identifying analogies and inferring facts not explicitly/directly seen in the data @xcite . in particular, deductive reasoning foot_1 is one of the most promising directions @xcite @xcite . by definition, deduction yields valid conclusions, which must be true given that their premises are true @xcite . in the nlp community, given all the premises in natural language statements, some large-scale plms have shown to be able to deductively draw appropriate conclusions under proper training schemes @xcite . figure 1 shows an example of the training and inference processes of deductive reasoning. despite promising applications of plms, some recent studies have pointed out that they could only perform a shallow level of reasoning on textual data @xcite . indeed, plms can be easily affected by mispriming @xcite and still hardly differentiate between positive and negative statements (i.e., the so-called negation issue) @xcite . however, given that some evidence suggests that plms can learn factual knowledge beyond mere rote memorisation @xcite and their limitations @xcite , it is natural to ask, "can the current plms potentially serve as reliable deductive reasoners over factual knowledge?" to answer it, as the main contribution of this work, we conduct a comprehensive experimental study on testing the learnable deductive reasoning capability of the plms. in particular, we test various reasoning training approaches on two knowledge reasoning datasets. our experimental results indicate that such deductive reasoning training of the plms (e.g., bert and roberta) yields strong results on the standard benchmarks, but it inadequately generalises learned logic rules to unseen cases. that is, they perform inconsistently against simple surface form perturbations (e.g., simple synonym substitution, paraphrasing or negation insertion), advocating a careful rethinking of the details behind the seemingly flawless empirical performance of deduc-tive reasoning using the plms. we hope our work will inspire further research on probing and improving the deductive reasoning capabilities of the plms. our code and data are available online at https://github.com/cambridgeltl/ deductive_reasoning_probing . knowledge reasoning with plms. in recent years, plms have also achieved impressive progress in knowledge reasoning @xcite . for example, plms can infer a conclusion from a set of knowledge statements and rules @xcite , with both the knowledge and the rules being mentioned explicitly and linguistically in the model input. some generative plms, such as t5 @xcite , are even able to generate natural language proofs that support implications over logical rules expressed in natural language @xcite . in particular, some large plms, such as lamda @xcite , have been shown to be able to conduct multi-step reasoning under the chain of thought prompting @xcite or proper simple prompting template @xcite . although the generated 'reasoning' statements potentially benefit some downstream tasks, there is currently no evidence that the statements are generated via deductive reasoning, rather than obtained via pure memorisation. generative reasoning models are difficult to evaluate since this requires huge effort of manual assessment @xcite . although some research has demonstrated that plms can learn to effectively perform inference which involves taxonomic and world knowledge, chaining, and counting @xcite , preliminary experiments on a single test set in more recent research have revealed that fine-tuning plms for editing knowledge might negatively affect the previously acquired knowledge @xcite . our work performs systematic and controlled examinations of the deductive reasoning capabilities of plms and reaches beyond (sometimes misleading) task performance. ## deductive reasoning what is deductive reasoning? psychologists define reasoning as a process of thought that yields a conclusion from precepts, thoughts, or assertions @xcite . three main schools describe what people may compute to derive this conclusion: relying on factual knowledge @xcite , formal rules @xcite , mental models @xcite , or some mixture of them @xcite . our experimental study focuses on a 'computational' aspect of reasoning -namely, whether computational plms for reasoning inadequately generalise learned logic rules and perform inconsistently against simple adversarial reasoning examples. we investigate deductive reasoning in the context of nlp and neural plms. in particular, the goal of this deductive reasoning task is to train a plm (e.g. bert) over some reasoning examples (each with a set of premises and a conclusion) to become a potential reasoner (e.g. r-bert as illustrated in figure 1 ). then, the trained reasoner can be used to infer deductive conclusions consistently over explicit premises, where the derived conclusions are usually unseen during the plm pretraining/training. this inference process requires the underlying plms to understand factual knowledge and interpret rules intervening in the deduction pro- bert bert a bird [mask] fly. a raven is a bird. a raven can [mask] . a bird can fly. a raven is a bird. a [mask] can fly. [can] softmax softmax ## experiments and results recent plms have shown surprisingly near-perfect performance in deductive reasoning @xcite . however, we argue that high performance does not mean plms have mastered reasoning skills. to validate this, we run controlled experiments to examine whether plm-based reasoners genuinely understand the natural language context, produce conclusions robustly against lexical and syntactic variance in surface forms, and apply learned rules to unseen cases. ## results and discussion we evaluate the impact of reasoning training on the plms and investigate their robustness against three well-known issues of plms: utilising artefacts from data, incapability of modelling negation, and catastrophic forgetting. we further conduct qualitative analysis to understand the inference errors introduced by deductive reasoning training. ## conclusion in this paper, we probed into the deductive reasoning capabilities of plms and conducted comprehensive controlled experiments to examine and compare various deductive reasoning training approaches. our experimental results showed that current plm-based deductive reasoners suffer from several issues: 1) they rely on artefacts from the training data, 2) they are incapable of modelling negation in deductive reasoning, and 3) they forget knowledge acquired during pretraining when they get specialised into deductive reasoners. in particular, our experimental study demonstrated that models are vulnerable to multiple adversarial methods, including simple surface form perturbations such as synonym substitution or paraphrasing. while the plms trained for deductive reasoning achieve seemingly perfect empirical results in different reasoning datasets, they cannot yet systematically generalise to other deductive reasoning examples. consequently, our study also calls for further, more rigorous examinations of future plm-based models' deductive reasoning abilities.