Investigating Transformer-Guided Chaining for Interpretable Natural Logic Reasoning (2023)

Abstract: Natural logic reasoning has received increasing attention lately, with several datasets and neural models proposed, though with limited success. More recently, a new class of works have emerged adopting a Neuro-Symbolic approach, called transformer guided chaining, whereby the idea is to iteratively perform 1-step neural inferences and chain together the results to generate a multi-step reasoning trace. Several works have adapted variants of this central idea and reported significantly high accuracies compared to vanilla LLM’s. In this paper, we perform a critical empirical investigation of the chaining approach on a multi-hop First-Order Logic (FOL) reasoning benchmark. In particular, we develop a reference implementation, called Chainformer, and conduct several experiments to analyze the accuracy, generalization, interpretability, and performance over FOLs. Our findings highlight key strengths and possible current limitations and suggest potential areas for future research in logic reasoning.

## introduction we consider deductive reasoning over natural logic @xcite , i.e., reasoning over statements expressed in language. natural logic reasoning has received increasing attention lately, with several datasets @xcite @xcite and neural models proposed @xcite @xcite @xcite @xcite . most of the traditional neural approaches tackled multi-step reasoning as a single pass 'all-at-once' inference. for reasoning problems that are inherently multi-step, it is more natural to consider a symbolic machinery in tandem with the neural model. taking inspiration from this philosophy, a new class of works have emerged recently by combining neural models (popularly using transformers @xcite ) with symbolic chaining. the central idea is to iteratively perform 1-step neural inferences and chain together the results to generate a multi-step reasoning trace. proofwriter @xcite ) was one of the first to explore this idea, and @xmath0. @xcite and @xcite reported similar results. recently, several works @xcite @xcite @xcite applied variants of this approach on entailmentbank @xcite and showed superior performance. the iterative approach is attractive because i) it is faithful in that it naturally reflects the internal reasoning process, and is inherently interpretable, ii) it has been shown to be easily adapted for multiple choice q&a @xcite and open-ended q&a @xcite , besides natural language inference (nli), iii) it enables teachable reasoning @xcite . while the above results are promising, we argue that an unbiased third-party investigation is important to facilitate a better understanding of the strengths and weaknesses. this is the main goal of this paper. towards this, we develop a reference implementation, called chainformer that captures ## problem definition we consider the nli setting @xcite . let @xmath1,f2,••• ,fn}, be n simple sentences, called facts; @xmath2,r2,••• ,rm}, a set of m compound sentences, called rules. then, given the tuple @xmath3, r), called the premise, and a statement h, called the hypothesis; the inference problem is to determine i) the inference relation of h, and ii) a reasoning chain x, where 𝑋 = {𝑋 1 , 𝑋 2 , … , 𝑋 𝑖 , … , 𝑋 𝑘 } is a sequence such that 𝑋 𝑖 = (𝑟 𝑖 , 𝐹 𝑖 ) , where 𝑟 𝑖 ∈ 𝑅 and 𝐹 𝑖 is a set of intermediate facts, with members not necessarily from f. the inference relations can be entailment, contradiction, neutral, or paradox, as defined in it is easy to see that the complexity of the problem varies based on the constraints imposed on f, r, x and the target inference labels of h. for example, ruletaker @xcite .) considers h to be 'true or 'false'. additionally, r is restricted to be implication rules with conjunctions and negations. proofwriter @xcite ) adopts a similar setting but allows h also to be undetermined ('neutral'), in this paper we consider a more general nli problem following @xcite , where i) r is expressed using a rich class of fols with universal ∀ and existential ∃ quantifiers, logic connectives such as disjunctions ∨, implications →, equivalence ≡ and negations ¬..ii) h can take any of the 4 inference labels ( ## logic reasoning method logic reasoning using chaining strategy can be implemented in several ways, e.g. with fact selection @xcite , rule selection @xcite , inference verification @xcite , etc. we aim to adopt a minimalist implementation, as we believe it facilitates better examination of the strengths and weaknesses of the central methodology,. we consider the forward chaining algorithm from sec 9.3.2 of @xcite , which is known to be sound and complete for a rich class of fols. basically, the algorithm starts with the known facts and applies rules whose preconditions are satisfied, to infer new facts repeatedly until the hypothesis can be verified. to extend to natural language, our idea is to employ a transformer ## experiments and results we perform several experiments using the multihop fol reasoning dataset logicnli, @xcite . the dataset includes 16k/2k/2k train/dev/test instances, with each instance consisting of over 12 facts and 12 rules, along with labeled statements and reasoning chains (called proof paths). a sample instance is in figure a-4 . the results are presented in the following subsections. in all the tabulated results, the performance metrics are averaged over 10 runs and quoted in % for easier interpretation, unless stated otherwise. details about the implementation, hyper-parameter settings and machine configuration are provided in appendix a. ## discussion and conclusions we considered the recently emerging neurosymbolic approach for addressing multi-step natural logic reasoning, called the transformer guided chaining. the approach adopts an iterative reasoning strategy in contrast to the traditional neural approaches that tackle multi-step reasoning as a single pass 'all-at-once' inference. the iterative approach is attractive as it offers several advantages such as i) it is faithful in that it naturally reflects the internal reasoning process, ii) it is inherently interpretable, iii) it can be applied to multiple choice q&a and open-ended q&a, besides natural language inference. we performed a detailed empirical investigation of this approach, using a challenging fol reasoning dataset. our key findings are: 1) human level performance is achieved on multi-hop fol reasoning task with a minimalist implementation (80.4% machine vs 77.5% human), and even with a base model (80.4% base vs 84.5% large). this provides support for the potential of chaining strategy and encourages possible applications on real life texts; 2) fols with simple conjunctions and existential quantifiers are easier to handle, whereas fols with equivalence are harder especially with universal quantifiers and disjunctions, suggesting scope for further research; 3) the predicted reasoning chains are correct 78% of the time, but could be more than twice longer than the optimal chains. the latter implies that two or more correct reasoning chains are possible, and iterative reasoning strategy might return one of them (though sub-optimal). this underscores the importance of human validation in interpretability evaluation, as automating it, say by scoring exact match, is likely to underestimate the true performance, a key observation is that the approach hinges on how accurately the 1-step inferences can be performed, as small errors can propagate over multiple iterations and get magnified. for example, if the rule inference step results in false positives/negatives, it is unclear how the chaining performance will be impacted. in addition, if facts are incomplete or even inconsistent, how effective will the reasoning be? these are interesting research questions for further investigation. @xcite ) are steps along this direction. on another direction, most of the chaining-based works have considered mainly 'entailment' as the inference relation. to handle real-life texts, it is important to go beyond simple entailment relations, and consider more sophisticated ones, e.g. necessity, possibility and rebuttal @xcite . to, cover such relations, new models and approaches are required, and they could facilitate enhancing the scope of current faithful reasoning approaches towards addressing advanced multihop reasoning scenarios.