Logical Reasoning with Span Predictions: Span-level Logical Atoms for Interpretable and Robust NLI Models

Joe Stacey, Pasquale Minervini, Haim Dubossarsky, Marek Rei

Introduction

Natural Language Inference (NLI) is a fundamental task in Natural Language Processing, requiring a model to determine if a "premise" sentence entails, contradicts, or is neutral toward a "hypothesis" sentence. While modern transformer-based models like BERT achieve high accuracy on standard benchmarks, they are often criticized as "black boxes." Research suggests these models frequently rely on annotation artifacts—shallow statistical shortcuts in the training data—rather than genuine logical reasoning. For instance, a model might learn to associate the presence of the word "not" with contradiction, regardless of the actual semantic relationship between the sentences.

Previous attempts to introduce logical transparency into NLI often suffer from an "interpretability tax," where model accuracy drops significantly in exchange for transparency. This paper introduces SLR-NLI (Span Logical Reasoning for NLI), a framework that bridges this gap. SLR-NLI provides human-readable explanations by identifying specific hypothesis spans responsible for a prediction, all while maintaining state-of-the-art performance and demonstrating superior robustness in low-data settings.

The SLR-NLI Framework

The core innovation of SLR-NLI is treating segments of a hypothesis as "logical atoms." Instead of predicting a label for the entire sentence pair in one step, the model decomposes the hypothesis and evaluates its components individually.

1. Span Selection and Modeling

The hypothesis is first segmented into discrete spans based on noun phrases using the spaCy library. To capture broader context, the model also considers combinations of consecutive spans. Each span is then paired with the full premise and encoded using a BERT model.

2. Dual Attention and Logical Rules

The framework employs two separate attention mechanisms: one dedicated to detecting "neutral" relationships and another for "contradiction." These layers identify which specific spans trigger these labels. The final sentence-level classification is then determined by a strict logical hierarchy:

  • Contradiction: If any individual span is found to contradict the premise.
  • Neutral: If no span contradicts the premise, but at least one span is "neutral" (i.e., its information is not implied by the premise).
  • Entailment: If all spans are entailed by the premise (no neutral or contradictory spans are detected).

3. Training and Supervision

SLR-NLI is trained using standard sentence-level labels but is guided by auxiliary losses that encourage the attention layers to isolate the correct spans. The model can also be optionally supervised using human-provided rationales from the e-SNLI dataset, further aligning the model's "reasoning" with human logic.

Experimental Results

Performance Retention

One of the most significant findings is that interpretability does not have to come at the cost of accuracy. On the SNLI test set, SLR-NLI achieved 90.33% accuracy, nearly matching the standard BERT baseline of 90.77%. This negligible drop is a major improvement over previous logic-based models, which often see performance decreases of 5-10%.

Zero-Shot Explanations and Span Accuracy

Even without being explicitly trained on human explanations, SLR-NLI's span-level decisions align with human rationales 84.75% of the time. When supervised with e-SNLI rationales, this span-level accuracy increases to 88.29%. This suggests that the logical structure of the framework forces the model to identify the correct evidence for its predictions rather than relying on dataset biases.

Robustness in Low-Data Regimes

The logical constraints of SLR-NLI act as a powerful regularizer. In experiments where training data was limited to only 1,000 examples, SLR-NLI significantly outperformed the baseline. Specifically, its out-of-distribution performance on the MNLI matched and mismatched validation sets improved by 13% and 16% relative to the baseline, respectively. This indicates that the span-level logic prevents the model from overfitting to shallow sentence-level artifacts when data is scarce.

Discussion and Limitations

While SLR-NLI represents a significant step toward transparent NLI, some challenges remain:

  • Syntactic Heuristics: The model performed slightly worse than the baseline on the HANS diagnostic dataset, suggesting that while span-level logic addresses lexical biases, it does not fully solve issues related to complex syntactic heuristics (like word-order tricks).
  • Complexity: The current framework is optimized for hypotheses that consist of a single sentence. It may require further adaptation for multi-sentence tasks or more complex compositional reasoning found in datasets like Adversarial NLI (ANLI).
  • Span-Level Opacity: While the model identifies which span caused a prediction, the internal neural processing of that individual span remains a "black box."

Conclusion

SLR-NLI demonstrates that it is possible to build NLI models that are both highly accurate and inherently interpretable. By decomposing hypotheses into logical atoms, the framework provides clear evidence for its decisions and shows remarkable robustness when training data is limited. Future work will explore applying this span-level logic to more complex linguistic structures and other NLP tasks beyond inference.

Summary updated

BibTeX
@inproceedings{stacey2022logical,
  author = {Joe Stacey and Pasquale Minervini and Haim Dubossarsky and Marek Rei},
  title = {{Logical Reasoning with Span Predictions: Span-level Logical Atoms for Interpretable and Robust NLI Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=P6igczSJjOj},
}
Figure