Analyzing Compositionality-Sensitivity of NLI Models

Yixin Nie, Yicheng Wang, Mohit Bansal

Introduction

Natural Language Inference (NLI) is often considered the "litmus test" for true language understanding. It requires a model to determine if a hypothesis is an entailment, contradiction, or neutral relative to a given premise. While modern neural networks achieve near-human performance on standard benchmarks like SNLI and MNLI, this research investigates whether these models are truly learning the compositional structure of language or merely exploiting word-level statistical shortcuts.

Methodology

The authors propose that current models are "compositionality-blind," relying on a "bag-of-words" approach rather than syntax. To prove this, they developed a three-pronged investigative framework:

1. Rule-Based Adversarial Sets

The researchers created two targeted datasets to test sensitivity to word order and modification:

  • SOSWAP: Swapping the subject and object (e.g., "A woman is pulling a child" vs. "A child is pulling a woman").
  • ADDAMOD: Moving an adjective modifier to a different noun (e.g., "A yellow cat sits in grass" vs. "A cat sits in yellow grass").
Examples of the SOSWAP and ADDAMOD adversarial datasets, which test a model's ability to recognize how structural changes alter sentence meaning.

2. Lexically-Misleading Score (LMS)

The paper's primary contribution is the Lexically-Misleading Score (LMS). By training a simple Bag-of-Words (BoW) model, the authors identified examples where lexical cues (like the presence of the word "not") strongly suggest a label that is actually incorrect. These "hard" examples form the Compositionality-Sensitivity (CS) subsets, which require structural understanding to solve.

An example of a lexically misleading instance where a simple model predicts 'contradiction' due to the presence of 'not' and 'standing', despite the true label being 'entailment'.

3. Ablation and Shuffling

The authors tested model resilience by training on shuffled input words. They found that shuffling only caused a 2-3% drop in performance on standard benchmarks, confirming that these datasets can be largely solved without considering word order.

Key Results

  • The Compositionality Gap: On the $CS_{0.7}$ subset—where lexical clues are intentionally misleading—human performance remained high (80-86%), but state-of-the-art model performance plummeted to 50-57%.
  • Total Failure on Swaps: On the SOSWAP test, models that scored 88% on standard SNLI dropped to nearly 0% accuracy on the correct label. Because the word overlap was 100%, models biased toward lexical similarity incorrectly classified contradictions as entailments.
  • Architecture Matters: While most models perform similarly on standard tests, the CS evaluation revealed that tree-based models (like S-TLSTM) handle structural changes significantly better than simple sequential RNNs.

Conclusion

The study concludes that current NLI benchmarks are "lexically easy" and do not sufficiently penalize models for ignoring compositionality. The authors call for the development of "lexically-balanced" datasets that force models to move beyond keyword matching and toward a genuine understanding of linguistic structure.

Summary updated

Abstract

Success in natural language inference (NLI) should require a model to understand both lexical and compositional semantics. However, through adversarial evaluation, we find that several state-of-the-art models with diverse architectures are over-relying on the former and fail to use the latter. Further, this compositionality unawareness is not reflected via standard evaluation on current datasets. We show that removing RNNs in existing models or shuffling input words during training does not induce large performance loss despite the explicit removal of compositional information. Therefore, we propose a compositionality-sensitivity testing setup that analyzes models on natural examples from existing datasets that cannot be solved via lexical features alone (i.e., on which a bag-of-words model gives a high probability to one wrong label), hence revealing the models' actual compositionality awareness. We show that this setup not only highlights the limited compositional ability of current NLI models, but also differentiates model performance based on design, e.g., separating shallow bag-of-words models from deeper, linguistically-grounded tree-based models. Our evaluation setup is an important analysis tool: complementing currently existing adversarial and linguistically driven diagnostic evaluations, and exposing opportunities for future work on evaluating models' compositional understanding.
BibTeX
@inproceedings{nie2019analyzing,
  author = {Yixin Nie and Yicheng Wang and Mohit Bansal},
  title = {{Analyzing Compositionality-Sensitivity of NLI Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  url = {https://openreview.net/forum?id=1gKu_OK5_c},
}
Figure