Source-linked AI summary
Probing Natural Language Inference Models through Semantic Fragments
Kyle Richardson, Hai Hu, Lawrence S. Moss, Ashish Sabharwal
TL;DR
The paper asks whether NLI models capture complex reasoning phenomena and introduces semantic fragments as controlled probes and adaptation datasets. Across eight logic and monotonicity fragments, pretrained models perform poorly, while lossless inoculation can quickly improve fragment mastery, with some risks to original-task performance.
Problem
It is unclear whether benchmark-trained NLI models learn and extrapolate complex reasoning abilities such as logic and monotonicity, or whether benchmarks adequately capture them.
Method
The paper uses eight synthetically generated semantic fragments with formally controlled complexity to probe and fine-tune NLI models.
Results
Pretrained NLI models perform poorly on the fragments, while many models can be quickly retuned to master them using lossless inoculation.
Takeaways & Limitations
Synthetic fragment data can help identify linguistic holes and improve model robustness, but the effect on original NLI performance should be evaluated for each phenomenon and model.
Takeaways & Limitations
The study leaves open whether more challenging linguistic fragments exist beyond those examined.
Abstract
from arXiv · showhide
Do state-of-the-art models for language understanding already have, or can they easily learn, abilities such as boolean coordination, quantification, conditionals, comparatives, and monotonicity reasoning (i.e., reasoning about word substitutions in sentential contexts)? While such phenomena are involved in natural language inference (NLI) and go beyond basic linguistic understanding, it is unclear the extent to which they are captured in existing NLI benchmarks and effectively learned by models. To investigate this, we propose the use of semantic fragments---systematically generated datasets that each target a different semantic phenomenon---for probing, and efficiently improving, such capabilities of linguistic models. This approach to creating challenge datasets allows direct control over the semantic diversity and complexity of the targeted linguistic phenomena, and results in a more precise characterization of a model's linguistic behavior. Our experiments, using a library of 8 such semantic fragments, reveal two remarkable findings: (a) State-of-the-art models, including BERT, that are pre-trained on existing NLI benchmark datasets perform poorly on these new fragments, even though the phenomena probed here are central to the NLI task. (b) On the other hand, with only a few minutes of additional fine-tuning---with a carefully selected learning rate and a novel variation of "inoculation"---a BERT-based model can master all of these logic and monotonicity fragments while retaining its performance on established NLI benchmarks.
Introduction
The paper proposes semantic fragments as controlled probes for whether NLI models learn complex reasoning phenomena. It finds that pretrained models perform poorly, while targeted fine-tuning can improve their capabilities, sometimes with trade-offs.
- Introduction: Semantic fragments are controlled challenge datasets designed to measure models’ competence on specific linguistic and reasoning phenomena.They are systematically generated from formal specifications, enabling control over semantic complexity.
- Introduction: The study targets eight fragments covering basic logic and monotonicity reasoning, both central to NLI but extending beyond basic linguistic understanding.The motivating phenomena include boolean coordination, quantification, conditionals, comparatives, and word substitution in context.
- Introduction: The proposed evaluation asks whether fragments are learnable from scratch, whether pretrained models solve them, and whether they can adapt quickly without losing original-task performance.The framework emphasizes efficient adaptation because a broad-coverage NLI model may encounter many linguistic phenomena.
- Introduction: Pretrained NLI models perform poorly on the eight semantic fragments, revealing weaknesses in generalizing reasoning abilities learned from benchmark tasks.Existing NLI architectures can learn the phenomena from scratch, but pretrained models do not perform well on the probes.
- Introduction: Fine-tuning with a novel inoculation strategy produces mixed outcomes: retraining can degrade original-task performance for some phenomena but is more stable for monotonicity.The approach is intended to identify which phenomena stress particular benchmark-trained models.
Related Work
The paper extends prior probing and challenge-dataset work by using naturalistic, formally controlled semantic fragments. Its methodology evaluates both fragment mastery and preservation of performance on established NLI tasks.
- Related Work: Semantic fragments draw on traditions in logical semantics and translate controlled subsets of language into formal systems such as first-order logic.The approach emphasizes complex cases to measure competence rather than only observed performance.
- Related Work: Unlike artificial fragments in some prior probing studies, these fragments aim to test naturalistic subsets of English while retaining automatic construction.The work also addresses limitations in the linguistic complexity of existing inference datasets.
- Related Work: The paper introduces challenge test sets for monotonicity and repurposes prior logic-fragment data to evaluate multiple specific inference phenomena.This contrasts with earlier work that mainly used training-data augmentation for monotonicity reasoning.
- Related Work: Its inoculation method explicitly balances mastering a new fragment against maintaining performance on the model’s original NLI benchmarks.The method optimizes aggregate performance across original and challenge tasks, using pretrained BERT as well as task-specific models.
Some Semantic Fragments
The semantic-fragment suite combines formally specified logic and monotonicity datasets with controlled linguistic complexity. The fragments vary in reasoning type, sentence structure, and generation difficulty.
- Construction: Formal specifications or template grammars are sampled to automatically generate challenge sets for targeted linguistic phenomena.The framework is intended to support construction of arbitrary fragments of interest.
- The Logic Fragments: The logic fragments probe boolean coordination, negation, quantification and scope, comparatives, set counting, and conditionals.They use a fixed vocabulary of people and places with traveling and height relations.
- The Logic Fragments: Most logic fragments adapt Salvatore, Finger, and Hirata Jr.’s templates from two-way to three-way NLI classification and add inference rules.Each fragment used 3,000 training examples and 1,000 test examples.
- Dataset Properties: Synthetic-data construction was checked against annotation artifacts, and strong baselines’ failures indicated that the fragments were not trivially learnable.Some fragments also produce longer sentences because their rules can generate productive lists, especially for comparatives.
- The Monotonicity Fragments: The monotonicity fragments encode polarity information in a regular grammar, including determiner-specific upward and downward entailment behavior.The example assigns polarity directions to the arguments of “every,” and lexical monotonicity facts are manually encoded.
- The Monotonicity Fragments: Monotonicity is split into simple and hard datasets, differing in relative-clause depth and the number of quantifiers and substitutions.The simple version allows one relative clause and five quantifiers; the hard version allows up to three relative clauses and fourteen quantifiers.
Experimental Setup and Methodology
The experiments evaluate NLI architectures and pretrained models on controlled fragments, then test whether limited fine-tuning improves fragment performance without sacrificing original-task performance.
- Models: The study evaluates ESIM, decomposable attention, and BERT-based NLI models, using BERT-base uncased in all experiments.Pretrained models include BERT trained on SNLI and MNLI, plus ESIM and decomposable-attention models trained on MNLI.
- Dataset construction: Fragment datasets are generated as controlled entailment, neutral, and contradiction examples from formal rules and lexical knowledge.The generation process uses substitutions and depth-first search to expand inference sets, while also generating neutral and contradiction examples.
- Evaluation design: Models trained from scratch are evaluated directly on fragments, whereas pretrained models are tested after training on established NLI datasets.The evaluation separates learnability from scratch from pretrained-model performance on individual fragments.
- Fine-tuning: Inoculation fine-tuning continues training pretrained models with between 50 and 3,000 fragment examples.The procedure tests whether small amounts of fragment data can improve performance without requiring full retraining.
- Fine-tuning: Lossless inoculation selects among hyperparameter variations using an aggregate of fragment and original-task scores.For each fragment-data size, candidate models are compared using fragment and original-task performance, with the best aggregate selected.
Results and Findings
Models trained from scratch can generally master the semantic fragments, but pre-trained NLI models perform poorly on them. Inoculation improves fragment performance, with BERT retaining benchmark accuracy while other architectures face trade-offs, especially on comparatives.
- Pre-trained state-of-the-art NLI models perform poorly on the semantic fragments, revealing limited generalization beyond existing benchmarks.This result is reported across the challenge sets and is consistent with findings from other challenge datasets.
- Retraining outcomes depend on careful hyperparameter selection because models are sensitive to learning rate and poorly selected settings can cause catastrophic forgetting.The aggregate objective balances original benchmark and challenge-set performance.
- Models trained from scratch can master nearly all fragments, although counting is the hardest, while their benchmark performance remains below random chance.Thus, fragment-specific learnability does not by itself produce generally useful NLI models.
- BERT masters monotonicity reasoning after inoculation while retaining original benchmark accuracy, including under systematic lexical variation.The lexical-variation development set paraphrases nouns and verbs to make them disjoint from training.
- Comparatives are harder for non-BERT models: they lose substantial benchmark accuracy during retraining, and Decomp-Attn does not fully master the logic fragments.The results suggest varied but largely stable trends across the remaining fragments.
- BERT learns the fragments with minimal benchmark loss, averaging about 1.3% accuracy loss on the original MNLI development set after retraining.The reported result depends on selecting the model with optimal aggregate performance.
Discussion and Conclusion
The study finds that pre-trained NLI models perform poorly on controlled logic and monotonicity fragments, but can often be quickly retuned with lossless inoculation while largely preserving original-task performance.
- Pre-trained NLI models perform poorly on the eight semantic fragments, exposing weaknesses in their generalization.
- Many models, especially BERT, can be quickly retuned to master the fragments using lossless inoculation.
- Synthetic fragment data can address particular linguistic gaps, although retraining may trade off performance on the model’s original tasks.
- Future work may develop more complicated fragments covering commonsense reasoning and broader linguistic phenomena.
- The approach is motivated by imperfect benchmark annotations and the need to probe the specific flavor of NLI captured by each benchmark.
- A remaining question is whether models trained on narrow fragments generalize beyond those fragments.
- Lossless inoculation balances learning new tasks against loss on the original task, but the study leaves open whether harder fragments would reveal greater limitations.
Appendix
The appendix describes how monotonicity fragments are generated from a formal grammar and lexicon, sentence polarization, and polarity-guided substitutions that produce entailments, neutral pairs, and contradictions.
- Monotonicity premises are generated from a specified grammar and lexicon containing determiners, adjectives, nouns, and sentence structures.
- Generated sentences are polarized with arrows marking the polarity of each constituent, as in every↑ dog↓ slept↑.
- The substitution procedure expands a premise into entailments, neutral inferences, and contradictions by replacing constituents according to their polarity.
- Algorithm 1 takes a sentence, knowledge base, and depth as input and returns lists of generated inferences.
- For upward-polarity constituents, greater replacements yield inferences and lesser replacements yield neutrals; downward polarity reverses these assignments.
- Negation replacements are added to the contradiction set, and the search recursively generates further inferences up to a chosen depth.