On the Paradox of Learning to Reason from Data

Honghua Zhang, Liunian Harold Li, Tao Meng, Kai-Wei Chang, Guy Van den Broeck

Abstract

Recent advancements in Transformer-based models have led to impressive performance on logical reasoning benchmarks, with models like BERT achieving near-perfect accuracy. However, a fundamental question remains: are these models truly reasoning, or are they exploiting statistical shortcuts? This paper investigates this paradox using a controlled environment called SimpleLogic. We demonstrate that while models like BERT possess the theoretical capacity to simulate reasoning, they often fail to generalize when the underlying data distribution changes. Our findings reveal that statistical shortcuts are often inherent to logical structures, making them nearly impossible to fully remove through data cleaning alone.

Introduction

The NLP community is currently divided on whether Large Language Models (LLMs) can genuinely "learn to reason" through scale or if they are simply "stochastic parrots." While models achieve near-perfect accuracy on many logic tests, their performance often collapses when faced with slight distributional shifts. This suggests a fundamental gap between learning a reasoning function—the universal rules of logic—and learning to achieve high performance on a specific test by gaming its statistical properties.

This paper, presented at IJCAI-23, explores this gap by introducing a controlled "sandbox" for deductive reasoning. The authors tackle the "paradox" of high in-distribution performance coupled with out-of-distribution failure, arguing that the learning process naturally favors statistical shortcuts over logical derivation.

Methodology: The SimpleLogic Sandbox

To isolate reasoning from linguistic complexity and ambiguity, the authors developed SimpleLogic, a synthetic environment for propositional logic. SimpleLogic uses a confined problem space with 150 adjectives (atoms) and reasoning depths ranging from 0 to 6. By using templated language, the researchers removed "language variance," ensuring that the model's performance reflects its underlying reasoning (or lack thereof) rather than its ability to parse complex syntax.

An example of the SimpleLogic environment, showing facts, rules, and queries used to test deductive reasoning.

Theoretical Capacity

A key contribution of this work is Theorem 1, which provides a constructive proof that standard Transformer architectures like BERT have the mathematical capacity to perfectly simulate forward-chaining reasoning algorithms. By stacking layers that correspond to reasoning steps, the model can theoretically derive all facts reachable from a given set of premises.

The proposed architecture demonstrating how multiple reasoning layers can simulate the iterative process of forward-chaining logic.

Sampling Strategies

The study employs two distinct data generation strategies to test generalization:

  1. Rule-Priority (RP): Rules and facts are generated randomly, and conclusions are derived. This mimics a "forward" generation process.
  2. Label-Priority (LP): Conclusions are pre-selected, and rules/facts are constructed backward to support them. This ensures a balanced distribution of "True" and "False" labels but creates a different statistical profile.

Results and Discussion

The experimental results highlight a significant "Capacity vs. Learning Gap." Just because a model can represent a logic function doesn't mean the training process (Stochastic Gradient Descent) will find it.

In-Distribution vs. Out-of-Distribution Performance

When trained and tested on the same distribution (e.g., RP to RP), BERT achieves ~99% accuracy across all reasoning depths. However, when trained on RP and tested on LP, accuracy for depth-6 problems drops to ~57%—barely better than a random guess. Similar results were observed for the T5 model, suggesting that this is a systemic issue with the Transformer architecture or the current learning paradigm.

Inherent Statistical Shortcuts

The authors argue that statistical shortcuts are not just "bugs" or annotator biases; they are often inherent to the nature of logic itself. For instance, due to the Monotonicity of Entailment, the more rules present in a problem, the more likely the answer is "True." A model can achieve high accuracy simply by counting the rules rather than following them.

The "Whack-a-Mole" Challenge

Efforts to "balance" datasets by removing obvious shortcuts (like rule counts) often fail. When one shortcut is removed, the model immediately identifies a new, more complex statistical feature, such as the "branching factor" of the proof tree. This combinatorial explosion of potential shortcuts makes it computationally infeasible to manually "clean" data enough to force a model to learn the underlying logical rules.

Conclusion

The findings suggest that simply scaling up data or "cleaning" datasets might never be enough to teach a neural model to reason. The "path of least resistance" taken by gradient descent favors statistical correlation over logical derivation. The authors conclude that future work may need to look toward neuro-symbolic approaches—architectures that explicitly bake logical structures into the model rather than hoping the model "discovers" them through statistics.

Summary updated

BibTeX
@inproceedings{zhang2023paradox,
  author = {Honghua Zhang and Liunian Harold Li and Tao Meng and Kai-Wei Chang and Guy Van den Broeck},
  title = {{On the Paradox of Learning to Reason from Data}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.24963/ijcai.2023/375},
}
Figure