Linguistically-Informed Transformations (LIT): A Method for Automatically Generating Contrast Sets

Chuanrong Li, Lin Shengshuo, Zeyu Liu, Xinyi Wu, Xuhui Zhou, Shane Steinert-Threlkeld

TL;DR

This paper introduces Linguistically-Informed Transformations (LIT), a novel method for automatically generating "contrast sets" – challenging test cases designed to probe the linguistic understanding of NLP models. LIT reveals that even state-of-the-art models struggle with basic linguistic perturbations, but also demonstrates that augmenting training data with these contrast sets can significantly improve model robustness without sacrificing performance on original data.

What Problem Does This Paper Address?

Large language models (LLMs) like BERT and RoBERTa have achieved impressive results on many NLP tasks. However, their performance often relies on superficial cues and heuristics present in training data, leading to brittle behavior on "out-of-distribution" (OOD) test sets, such as contrast sets. Creating these contrast sets manually is labor-intensive and difficult to scale. This paper addresses the need for an automated method to generate linguistically-informed contrast sets that can effectively evaluate and improve the robustness and generalization capabilities of NLP models, particularly in Natural Language Inference (NLI).

Methods

The core of the paper is the Linguistically-Informed Transformations (LIT) system. LIT operates in several stages:

  1. Parsing: It uses the English Resource Grammar (ERG) and the ACE parser to obtain detailed syntactic and semantic representations (specifically, Minimal Recursion Semantics or MRS) of input sentences.
  2. Transformation: LIT applies a set of pre-defined, phenomenon-specific transformation rules to these semantic representations. These rules are designed to alter specific linguistic aspects like tense, modality, negation, passivization, and it-cleft constructions.
  3. Generation: The transformed representations are then used by the ERG to generate grammatically correct surface sentences.
  4. Surface Sentence Selection: Since ERG can sometimes generate multiple valid surface sentences for a single representation, LIT uses GPT-2 to rank these candidates based on perplexity and selects the most plausible one.

A key feature of LIT is its modularity and extensibility. New linguistic phenomena can be added by defining new transformation rules, and the system supports compositional transformations, allowing multiple rules to be applied in sequence to create more complex perturbations.

Datasets

The paper uses two widely-used NLI datasets for their experiments:

  • SNLI (Stanford Natural Language Inference): A dataset of premise-hypothesis pairs with entailment, neutral, or contradiction labels.
  • MNLI (Multi-Genre Natural Language Inference): Similar to SNLI but with a broader range of genres.

LIT is used to generate contrast sets from these datasets. The paper also uses augmented training data generated by LIT to retrain models.

Key Insights and Ideas

  • LLMs are brittle: Even advanced models like BERT and RoBERTa fail on simple linguistic perturbations (e.g., changing tense or introducing modality with "may"), indicating they rely on superficial cues rather than deep linguistic understanding.
  • Linguistic phenomena matter: Specific linguistic phenomena pose different challenges. For instance, label-changing transformations (like modality) are harder than label-preserving ones (like passivization).
  • Data augmentation is effective: Fine-tuning models on LIT-generated contrast sets significantly improves performance on these challenging OOD examples without degrading performance on the original, in-distribution data.
  • Compositionality is key: While models can learn simple transformations, composing them reveals deeper systematicity. The paper explores how well models generalize to combinations of linguistic phenomena.
  • ERG as a powerful backbone: The use of a robust, linguistically-grounded grammar like ERG ensures the generated contrast sets are grammatically sound and semantically plausible, avoiding the pitfalls of purely template-based methods.

Key Results

  • Model Performance Degradation: On automatically generated contrast sets, accuracy for models like RoBERTa-large dropped significantly. For example, on the f;p (future premise, past hypothesis) transformation for MNLI, accuracy dropped from ~90% on the original data to ~15% on the contrast set.
  • Data Augmentation Improvement: After fine-tuning on LIT-augmented data, models showed substantial improvements on contrast sets. For instance, RoBERTa-large's accuracy on the f;p contrast set in MNLI increased from ~15% to ~76% (ORI vs. AUG in Table 8).
  • Consistency: Models often showed low consistency on contrast sets, meaning their predictions on original and transformed pairs differed, highlighting their lack of robust understanding. Augmentation improved consistency as well.
  • Phenomenon Difficulty: The paper quantifies the difficulty of various linguistic phenomena, showing that label-changing transformations (e.g., modality) are generally harder than label-preserving ones.
  • Coverage: LIT successfully transformed 21.0% of MNLI and 19.7% of SNLI sentence pairs.

Limitations and Future Work

  • ERG Dependency: LIT's reliance on ERG, a hand-crafted grammar for English, limits its direct applicability to other languages. The authors suggest that data-driven parsers could be an alternative, though this might reintroduce model bias.
  • Coverage Limitations: While LIT can generate contrast sets for many phenomena, its coverage is limited by the ERG grammar's ability to parse sentences. Complex sentences or rare phenomena might not be transformable.
  • Future Work: The authors propose expanding LIT with more transformation rules (e.g., control and raising verbs), exploring data-driven parsers for broader language support, and further investigating the systematic understanding gained by models through augmentation. They also suggest using LIT to analyze dataset biases more broadly.

Summary updated

BibTeX
@inproceedings{li2020linguistically,
  author = {Chuanrong Li and Lin Shengshuo and Zeyu Liu and Xinyi Wu and Xuhui Zhou and Shane Steinert-Threlkeld},
  title = {{Linguistically-Informed Transformations (LIT): A Method for Automatically Generating Contrast Sets}},
  booktitle = {BlackboxNLP @ EMNLP},
  year = {2020},
  url = {https://openreview.net/forum?id=8VKAqTMOVmj},
}
Figure