Abstract
Standard evaluations of deep learning models for semantics using naturalistic corpora are limited in what they can tell us about the fidelity of the learned representations, because the corpora rarely come with good measures of semantic complexity. To overcome this limitation, we present a method for generating data sets of multiply-quantified natural language inference (NLI) examples in which semantic complexity can be precisely characterized, and we use this method to show that a variety of common architectures for NLI inevitably fail to encode crucial information; only a model with forced lexical alignments avoids this damaging information loss.
Introduction
Natural Language Inference (NLI) serves as a primary benchmark for evaluating a model's ability to "understand" language. While modern neural networks achieve high accuracy on naturalistic datasets, these results are often confounded by statistical shortcuts or "artifacts" within the data. This research investigates whether these models can truly handle semantic complexity, specifically sentences involving multiple quantifiers (e.g., every, some, no), negations, and modifiers. The central question is whether a model can distinguish between logically distinct but structurally similar sentences, such as "Every baker sells a cake" versus "Every chef sells a cake."
Methodology
To isolate logical reasoning from statistical noise, the researchers constructed a synthetic benchmark using a formal grammar. Sentences followed a strict template: [Quantifier] [Adjective] [Noun] [Negation] [Adverb] [Verb] [Quantifier] [Adjective] [Noun]. Ground-truth labels (Entailment, Contradiction, or Neutral) were determined by translating sentences into First-Order Logic and using the Prover9 theorem prover.
The study compared five architectures:
- CBoW: A simple bag-of-words average.
- LSTM: A standard sequential recurrent network.
- TreeNN: A network processing sentences via grammatical tree structures.
- Attention LSTM: An LSTM with a mechanism to attend to specific premise words.
- CompTreeNN: A specialized architecture that processes the premise and hypothesis as a single aligned tree, comparing them node-by-node.
Results and the "Information Bottleneck"
The experimental results revealed a fundamental flaw in standard encoding architectures. While models like the LSTM and TreeNN achieved high overall test accuracy (above 95%), their performance collapsed on the Informative Open-class Subset. In this subset, the logical relationship depends entirely on whether specific nouns or verbs match between the premise and hypothesis.
This failure stems from an information bottleneck. Standard encoders attempt to compress an entire sentence into a single fixed-length vector. During this process, the models prioritize high-signal "function words" (like quantifiers and negations) but "forget" the specific identity of "content words" (like nouns and verbs). Consequently, they treat "Every baker..." and "Every dancer..." as functionally identical.
Key Insights
- Alignment is the Antidote: The CompTreeNN was the only model to achieve near-perfect accuracy (99.85%) on both the full test set and the Informative Subset. By comparing the premise and hypothesis word-by-word and phrase-by-phrase before final compression, it avoids the identity collapse seen in other models.
- Attention Isn't Enough: Surprisingly, the Attention LSTM failed to solve the Informative Subset. This suggests that standard attention mechanisms are insufficient for learning the precise, structured lexical alignments necessary for complex logical reasoning.
Conclusion
The study demonstrates that high performance on standard NLI benchmarks can mask significant deficiencies in semantic representation. For neural models to truly master linguistic logic, they require architectures that can preserve fine-grained lexical information through local, structured comparisons rather than relying on global vector compression. Future work should explore how to scale these "forced alignment" techniques to the fluid and diverse structures of natural language.
Summary updated