Diagnosing the First-Order Logical Reasoning Ability Through LogicNLI

Jidong Tian, Yitian Li, Wenqing Chen, Liqiang Xiao, Hao He, Yaohui Jin

Abstract

Recent advancements in Large Language Models (LLMs) have led to impressive performance on Natural Language Understanding benchmarks. However, it remains unclear whether these models possess genuine logical reasoning capabilities or merely exploit statistical patterns. We introduce LogicNLI, a diagnostic benchmark designed to evaluate systematic first-order logical (FOL) reasoning by stripping away commonsense shortcuts. Our analysis reveals that while models like RoBERTa outperform others, they still struggle with complex rules, negation, and multi-hop generalization, often relying on template-based patterns rather than formal logic.

Introduction

The dominance of LLMs in NLU tasks has sparked debate over their reasoning depth. Many existing datasets are "polluted" with commonsense cues, allowing models to predict entailment based on world knowledge (e.g., "eagles are birds") rather than logical deduction. To address this, we propose a framework to disentangle FOL—involving operators like "and," "or," "not," and quantifiers—from linguistic and world-knowledge biases.

Methodology: The LogicNLI Framework

LogicNLI is a Natural Language Inference (NLI) dataset that isolates logic using simple propositions and rules. A key innovation is the introduction of the Paradox label. While standard NLI uses Entailment, Contradiction, and Neutral, Paradox identifies instances where conflicting rules allow for the proof of both a statement and its negation. This forces models to explore all possible reasoning paths.

Mapping Natural Language to First-Order Logic and the introduction of the Paradox label.

The framework evaluates models across four diagnostic dimensions:

  1. Robustness: Ability to ignore irrelevant facts.
  2. Generalization: Performance on reasoning depths beyond those seen in training.
  3. Traceability: Verification of the model's underlying proof path.
  4. Logic Types: Performance on universal (∀) vs. existential (∃) logic.

Experimental Setup

The LogicNLI dataset contains over 30,000 instances, each comprising facts, rules, a hypothesis statement, and the underlying proof paths. We also utilize d-LogicNLI, a version without the Paradox label, to measure the impact of complex logical constraints on suppressing spurious correlations. We evaluated three prominent architectures: BERT, RoBERTa, and XLNet.

Results and Discussion

The Generalization Cliff

A critical finding is the "generalization cliff." Models perform adequately on reasoning depths encountered during training but experience a sharp performance decline when required to perform even one additional hop of reasoning. This suggests that models learn proof templates rather than the fundamental rules of logic.

Generalization test results showing accuracy dropping as the number of reasoning hops increases.

Robustness and Traceability

All models exhibited decreased accuracy as the number of irrelevant "noise" sentences in the premise increased. Furthermore, a significant "traceability gap" exists: even when RoBERTa predicted the correct label, it could only provide a valid reasoning path approximately 53% of the time. BERT and XLNet performed significantly worse, with traceability scores below 30%.

The Role of the Paradox Label

The Paradox label acts as a "bias-breaker." Models trained with this label demonstrated superior traceability and generalization compared to those trained on d-LogicNLI. This indicates that more complex logical labels compel models to develop more robust internal representations.

Conclusion

Current Transformer-based models are not yet "logical engines." They struggle significantly with negation and universal quantifiers—the "logic traps" of modern AI. Future progress likely requires neuro-symbolic architectures that combine neural pattern recognition with the formal rigor of symbolic logic.

Summary updated

BibTeX
@inproceedings{tian2021diagnosing,
  author = {Jidong Tian and Yitian Li and Wenqing Chen and Liqiang Xiao and Hao He and Yaohui Jin},
  title = {{Diagnosing the First-Order Logical Reasoning Ability Through LogicNLI}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.303},
}
Figure