Source-linked AI summary
Investigating the Effect of Natural Language Explanations on Out-of-Distribution Generalization in Few-shot NLI
Yangqiaoyu Zhou, Chenhao Tan
TL;DR
NLI models often fail to generalize out of distribution, motivating this study of natural language explanations in few-shot learning. The authors build templated explanations for HANS and evaluate EXPLAINTHENPREDICT, finding that high BLEU does not translate into better prediction because generated explanations miss label-relevant information and hallucinate entities.
Problem
NLI models achieve high accuracy on standard datasets but show poor OOD generalization, including near-chance performance on HANS.
Source: §1 · p. 1Method
Results
High BLEU scores do not improve predictive performance, while generated explanations miss important phrases and often hallucinate entities.
Source: §1 · p. 1, §4.2 · pp. 3–4, §5 · p. 5Takeaways & Limitations
Abstract
from arXiv · showhide
Although neural models have shown strong performance in datasets such as SNLI, they lack the ability to generalize out-of-distribution (OOD). In this work, we formulate a few-shot learning setup and examine the effects of natural language explanations on OOD generalization. We leverage the templates in the HANS dataset and construct templated natural language explanations for each template. Although generated explanations show competitive BLEU scores against groundtruth explanations, they fail to improve prediction performance. We further show that generated explanations often hallucinate information and miss key elements that indicate the label.
1 Introduction
NLI models achieve high in-distribution accuracy but often generalize poorly to out-of-distribution data. This work studies whether natural language explanations can improve few-shot OOD generalization.
- NLI models can exceed 90% accuracy yet perform about at chance on the templated HANS dataset.Source: §1 · p. 1
- The study examines natural language explanations as an additional source of information for improving OOD robustness in a few-shot setting.The few-shot focus reflects limited access to annotated OOD examples.Source: §1 · p. 1
- The authors construct E-HANS by pairing HANS templates with manually written natural language explanations.Source: §1 · p. 1
- Under EXPLAINTHENPREDICT, a generator produces an explanation that a classifier uses with the input, but generated explanations do not improve predictive performance.They contain words from true explanations while missing important phrases and often hallucinating entities.Source: §1 · p. 1
2 Building Natural Language Explanations for HANS
The paper builds E-HANS by augmenting HANS templates with manually authored explanations and expanded vocabulary. This creates a controlled resource for studying explanation-based robustness under unseen words and templates.
- E-HANS augments HANS with templated natural language explanations and evaluates their effect on few-shot NLI robustness.The dataset builds on HANS for OOD examples and E-SNLI for explanation-related pretraining.Source: §2 · p. 1
Existing Datasets
- HANS targets models that rely on spurious patterns through three heuristics, each containing ten subcases supported by templates.Source: §2.1 · pp. 1–2
- E-SNLI supplies crowdsourced self-contained explanations for SNLI, and its validation explanations are used for pretraining without using its test set.Source: §2.1 · p. 2
Building Explanations
- The authors manually write explanations for HANS templates to express the reasons for labels in human language while avoiding crowdsourcing challenges.Source: §2.2 · p. 2
- The original HANS vocabulary is expanded across nouns, verbs, adjectives, and adverbs to test the effect of unseen words.Source: §2.2 · p. 2
3 Experiments
The experiments test explanation-based learning in few-shot NLI across matched and unseen vocabulary and templates. They compare EXPLAINTHENPREDICT with label-only and other baselines while measuring explanation quality and model behavior.
Few-Shot Learning Set-up
- The setup uses five-fold splits of 118 templates and generates k samples per training template, with k ranging from 1 to 16.Development sets contain 0.2k samples per training template and exclude unseen templates.Source: §3.1 · p. 2, §3.3 · p. 3
- Evaluation separates IND vocabulary/templates, OOD vocabulary with IND templates, and IND vocabulary with OOD templates.These conditions isolate challenges involving unseen words and unseen templates.Source: §3.1 · p. 2
Models
- EXPLAINTHENPREDICT generates an explanation from each premise-hypothesis pair and feeds that explanation with the original input to a classifier.Source: §3.2 · p. 2
- The generator reaches 33.15 BLEU on eSNLI versus 33.7 for WT5, while Figure 1 measures BLEU across sample counts and distribution conditions.Source: §3.2 · p. 3, Figure 1 · p. 3
- Comparisons include label-only, no-training, majority, vanilla BERT, and E-SNLI-pretrained BERT models.Source: §3.3 · p. 3
4 Results
Generated explanations matched groundtruth explanations well by BLEU, but incorporating them consistently reduced classification performance rather than improving in-distribution or out-of-distribution prediction. Analysis attributes this gap to hallucinated entities, missing label-indicating phrases, and difficulty learning templates.
4.1 Quality of Explanations based on BLEU
- Generated explanations achieve high BLEU scores, including above 90 for in-distribution vocabulary and templates and close to 20 for out-of-distribution vocabulary.Performance grows steadily as the number of samples per template increases, while unseen vocabulary and templates remain difficult.Source: §4.1 · p. 3
4.2 Predictive Performance
- Learning with generated explanations consistently performs worse than the label-only baseline under both in-distribution and out-of-distribution testing.Pretraining on E-SNLI does not change this observation, although it improves results relative to plain BERT.Source: §4.2 · pp. 3–4, Figure 2 · p. 4
- Testing with groundtruth explanations boosts performance drastically, indicating that they contain label clues not captured by generated explanations.This contrast motivates examining hallucinations and missing predictive phrases in generated outputs.Source: §4.2 · p. 4, §4.3 · p. 4
4.3 Why Explanations Do Not Help?
- For out-of-distribution vocabulary, BERT hallucinates nonexistent entities in 99% of explanations, while the E-SNLI-pretrained model still hallucinates in around 60%.Hallucination is much lower for many in-distribution cases, and E-SNLI pretraining lowers hallucination rates across test cases.Source: §4.3 · p. 4
- The phrase “we do not know” has 100% precision but imperfect recall, with recall declining on harder cases and OOD templates hurting more than OOD vocabulary.Because the phrase appears only in non-entailment examples, failing to generate it removes a direct label indicator.Source: §4.3 · p. 4
- Models struggle to learn explanation templates: even with 16 samples, they fail to select the correct template when vocabulary is out of distribution.With only 4 samples, wrong templates can occur even for in-distribution vocabulary and templates.Source: §4.3 · pp. 4–5, Table 2 · p. 4
5 Conclusion
The paper concludes that natural language explanations do not help few-shot NLI generalize out of domain. Despite high BLEU scores, generated explanations miss information crucial for classification and can remain nonsensical.
- Natural language explanations do not help few-shot NLI generate out-of-domain.Source: §5 · p. 5
- High BLEU scores do not indicate that generated explanations learn information crucial for downstream classification.Source: §5 · p. 5
- The generation model remains close to the state-of-the-art model yet still produces nonsensical explanations.Source: §5 · p. 5
- Better explanation evaluation metrics and generation models are identified as key requirements for effective learning with natural language explanations.Source: §5 · p. 5
A Replicability Details
The replicability details describe training schedules for the E-SNLI-pretrained model, generation model, explain-then-predict classifier, and label-only classifier. They also report approximate training times on a four-GPU machine.
- The BERT model is pretrained on E-SNLI for 5 epochs, with the best development-performing model retained as the initial few-shot model.Source: A Replicability Details · p. 6
- The E-HANS generation model is trained for 2000 steps, with evaluation every 200 steps because development performance usually peaks within that range.Source: A Replicability Details · p. 6
- The explain-then-predict classifier is trained for 200 steps, whereas the label-only classifier is trained for 1000 steps.Source: A Replicability Details · p. 6
- Training takes approximately 30 minutes for a generation model and 10 minutes for a classification model on the authors' four-GPU machine.Source: A Replicability Details · p. 6
B Samples from E-HANS
Table 3 presents examples from the E-HANS dataset.
- Table 3 provides examples from E-HANS.Source: Table 3 · p. 7
- The table is part of the paper's presentation of the E-HANS examples.Source: Table 3 · p. 7
- The section directs readers to sample instances from E-HANS.Source: Table 3 · p. 7
C Example Generated Explanations
The paper provides example generated explanations for test cases. Tables 4 and 5 show examples produced by BERT models trained with k = 4 and k = 16, respectively.
- The paper includes examples of generated explanations across different test types.Source: C Example Generated Explanations · p. 7
- Table 4 presents example explanations for all test cases generated by BERT trained with k = 4.Source: Table 4 · p. 7
- Table 5 presents example explanations for all test cases generated by BERT trained with k = 16.Source: Table 5 · p. 8