Investigating Transformer-Guided Chaining for Interpretable Natural Logic Reasoning

Kanagasabai Rajaraman, Saravanan Rajamanickam, Wei ShiACL 2023 · DOI

Introduction

Standard Large Language Models (LLMs) typically approach reasoning as a "single-pass" task, generating answers in an "all-at-once" fashion. While effective for many tasks, this approach often functions as a black box, making it difficult to discern whether a model is truly reasoning or merely performing statistical pattern matching. Furthermore, these models frequently struggle with complex multi-hop reasoning, where a conclusion depends on a long chain of intermediate facts. This paper investigates "transformer-guided chaining," a neuro-symbolic approach that breaks down complex logical reasoning into iterative, single-step neural inferences.

Methodology

The researchers developed Chainformer, a minimalist neuro-symbolic framework designed for forward chaining. The process is divided into two distinct neural components:

  1. Rule Inference (The "Thinker"): Utilizing a T5 transformer, the model treats rule application as an abstractive Q&A task. Given a set of known facts and a specific logic rule, the model generates new intermediate facts.
  2. Fact Checking (The "Verifier"): A RoBERTa-based model performs a 2-class Natural Language Inference (NLI) task to check if the current pool of facts entails the hypothesis or its negation.

By iterating through these steps, the system builds a discrete, verifiable reasoning trace until the hypothesis is proven or no new facts can be generated.

Experimental Setup

The approach was evaluated using LogicNLI, a diagnostic dataset designed to test first-order logic (FOL) capabilities. LogicNLI includes universal (∀) and existential (∃) quantifiers, as well as logical connectives like disjunction (∨), implication (→), and equivalence (≡). The dataset is non-trivial, featuring 16,000 training instances and a reported human reasoning accuracy of 77.5%.

Discussion of Logical Challenges

The study revealed several key insights into the behavior of neural models in formal logic contexts. A primary finding was the "Neural Unification" hurdle: models found existential quantifiers (∃) significantly easier to handle than universal quantifiers (∀).

Performance analysis across different logical quantifiers.

The authors hypothesize that neural architectures find it easier to match a single relevant fact (existential) than to ensure a condition holds for all relevant facts (universal). Additionally, logical equivalence (≡) proved to be the most difficult connective, likely due to its role as a bidirectional implication. While the model was highly accurate, its reasoning chains were often "wordy," averaging 2.3 times the length of optimal gold-standard chains, though they remained logically sound 78.8% of the time.

Key Results

Chainformer demonstrated state-of-the-art performance, significantly outperforming traditional "all-at-once" models and exceeding the human baseline.

Accuracy comparison of Chainformer against baselines and human performance on LogicNLI.

Chainformer (using T5-large) achieved 84.5% accuracy on the LogicNLI test set, comfortably beating the human baseline of 77.5%. In contrast, standard transformer models struggled; RoBERTa-large reached only 68.3%, and BERT-base barely outperformed random chance. Beyond raw accuracy, the model's iterative nature provides a transparent reasoning trace, allowing for human verification and debugging of the logic path.

Conclusion and Future Work

While Chainformer shows great promise on synthetic benchmarks, the authors acknowledge that performance on "real-world," messy text remains an open question. Future research will focus on improving negation handling and extending the framework to more nuanced logical relations like necessity and possibility to better capture the complexities of natural language.

Summary updated

BibTeX
@inproceedings{rajaraman2023investigating,
  author = {Kanagasabai Rajaraman and Saravanan Rajamanickam and Wei Shi},
  title = {{Investigating Transformer-Guided Chaining for Interpretable Natural Logic Reasoning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.588},
}
Figure