Source-linked AI summary

Evaluating Compositionality in Sentence Embeddings

Ishita Dasgupta, Demi Guo, Andreas Stuhlmüller, Samuel J. Gershman, Noah D. Goodman

arXiv:1802.04302v2cs.CLstat.ML

TL;DR

The paper asks whether sentence embeddings capture compositional meaning beyond word-level information. It tests InferSent on a new NLI Comparisons dataset and finds poor performance alongside word-driven heuristics consistent with SNLI biases; adding comparison examples improves performance on that dataset without reducing SNLI performance.

  • Problem

    It is unclear what compositional information sentence embeddings capture beyond lexical meaning, despite their strong transfer-task performance.

    Source: Introduction · p. 1
  • Method

    The authors construct NLI sentence pairs whose relations change with word order and analyze InferSent’s behavior on this Comparisons dataset.

    Source: Compositional comparisons dataset · p. 2
  • Results

    InferSent performs poorly on the compositional dataset, with word-driven heuristics explaining many errors, while adding comparison examples improves Comparisons performance without reducing SNLI performance.

    Source: Introduction · p. 1, Summary of heuristics · p. 5, Discussion · p. 6
  • Takeaways & Limitations

    Structured diagnostic examples can expose model blind spots and, in this case, improve performance when included in training.

    Source: Discussion · p. 6

    The Comparisons dataset is limited to comparison-type sentences, and whether findings transfer to broader compositionality remains open.

    Source: Future Directions · p. 6

Abstract

from arXiv · show

An important challenge for human-like AI is compositional semantics. Recent research has attempted to address this by using deep neural networks to learn vector space embeddings of sentences, which then serve as input to other tasks. We present a new dataset for one such task, `natural language inference' (NLI), that cannot be solved using only word-level knowledge and requires some compositionality. We find that the performance of state of the art sentence embeddings (InferSent; Conneau et al., 2017) on our new dataset is poor. We analyze the decision rules learned by InferSent and find that they are consistent with simple heuristics that are ecologically valid in its training dataset. Further, we find that augmenting training with our dataset improves test performance on our dataset without loss of performance on the original training dataset. This highlights the importance of structured datasets in better understanding and improving AI systems.

Introduction

The paper tests whether sentence embeddings capture compositional meaning, using NLI cases that require more than word-level information. It also examines whether training-data biases explain model failures and whether structured examples can improve performance.

Introduction

  • The authors create minimal NLI cases that require compositional information, providing a stringent test of sentence-level understanding.They ask whether a state-of-the-art system exhibits genuinely compositional understanding.Source: Introduction · p. 1
  • Diagnostic benchmarks can expose systems that perform only slightly better than naive baselines on large corpora.The paper motivates benchmark design partly by noting that training and evaluation corpora can be gamed by simple heuristics.Source: Introduction · p. 1
  • The authors argue that cognitive science can help design benchmarks that probe AI systems’ competences.They draw a parallel with cognitive scientists’ probes of human competences.Source: Introduction · p. 1
  • InferSent performs poorly on the compositional test set, and much of its failure can be traced to training-data biases.The authors also report that the system can exhibit some compositionality with appropriate training data.Source: Introduction · p. 1

Background

The paper studies whether sentence embeddings capture relations among words, focusing on InferSent and defining compositionality as generalization of abstract combination rules to novel words and phrases.

Sentence Embeddings

  • Sentence-vector models can perform well on transfer tasks, but what compositional information their representations capture beyond lexical meaning is unclear.The paper frames this as a challenge because language allows far more sentences than there are words.Source: Sentence Embeddings · p. 1

Natural Language Inference classifiers

  • InferSent embeddings are trained end-to-end on SNLI to classify sentence pairs as entailment, contradiction, or neutral.The paper selects InferSent as a state-of-the-art transfer model; its test accuracy is 84.84% on SNLI, compared with 53.99% for BOW-MLP.Source: Natural Language Inference classifiers · pp. 1–2

SNLI dataset

  • SNLI is a large crowdsourced NLI corpus in which workers write entailment, neutral, and contradiction sentences for image-caption descriptions.The freedom to generate novel sentences also introduces biases discussed later in the paper.Source: SNLI dataset · p. 2

Notion of Compositionality

  • The paper defines compositionality as understanding how words combine in abstract rules that generalize to previously unseen words and phrases.The intended generalization can extend to X, Y, and Z that have never been encountered before, including in combination.Source: Notion of Compositionality · p. 2

Compositional comparisons dataset

The Comparisons dataset uses sentence pairs whose NLI relation can change when word order changes, making word-level information insufficient to distinguish the pairs.

Compositional comparisons dataset

  • The dataset varies word order within sentence pairs to change their NLI relation while keeping the words involved unchanged.The examples use comparisons, which provide simple cases where entity order matters and can be generated automatically.Source: Compositional comparisons dataset · p. 2
  • BOW models perform at chance on the permuted pairs, so the authors propose testing whether sentence-vector models classify those sets differently.They caution that beating an averaged-word-vector baseline alone does not prove compositionality because that baseline loses lexical information.Source: Compositional comparisons dataset · p. 2

Same type

  • In same-type pairs, reversing the entities can change an entailment relation to contradiction.For example, “The woman is more cheerful than the man” contrasts with “The man is more cheerful than the woman.”Source: Same type · p. 2

More-Less type

  • More-Less pairs vary the comparative word, with the examples distinguishing contradiction from entailment through word order and the comparison term.The examples use “more” and “less” in sentences about the same entities.Source: More-Less type · p. 2

Not type

  • Not-type pairs differ by whether they contain “not,” and the dataset’s vocabulary distribution is kept similar to SNLI’s training distribution.Only a few words differ from their SNLI occurrence rates by more than 1%, including “not,” “than,” “less,” and “more.”Source: Not type · p. 3

Classification Analysis

InferSent performs poorly on compositional comparisons, and its errors are consistent with lexical heuristics that also fit patterns in SNLI. The analyses suggest these heuristics rely disproportionately on word overlap, antonyms, and negation rather than compositional meaning.

BOW-MLP

  • BOW-MLP’s classifications are symmetric across the two true categories, capping performance at 50% because it cannot distinguish permuted sentence pairs.Asymmetry would indicate use of information beyond word-level content.Source: BOW-MLP · p. 3, Figure 2 · p. 3

All same words

  • 91.5% of SNLI pairs in the top 1,000 by maximum word overlap were entailments or neutral, supporting an overlap heuristic for same-word comparisons.InferSent largely classified same-word pairs as entailments despite half being true contradictions.Source: Table 3 · p. 3, All same words · p. 3

InferSent

  • InferSent is slightly asymmetric, indicating some use of information beyond words, yet remains extremely poor and fails to fully exhibit the needed compositionality.Its same-word comparisons are largely classified as entailments, including true contradictions.Source: InferSent · p. 3, All same words · p. 3, Figure 3 · p. 4

Difference of one word

  • 61.2% of SNLI pairs with an antonym were contradictions, versus 33.3% chance; contradictions contained antonyms more often than entailments (12.2% vs 3.5%).These statistics support the hypothesis that antonym differences prompt contradiction judgments regardless of word order.Source: Difference of one word · p. 4, Table 4 · p. 4
  • In high-overlap SNLI pairs, contradictions predicted antonym presence more than entailments (43.7% vs 8.7%), but antonym presence no longer strongly predicted contradiction.The authors attribute this qualification likely to the subset’s very low contradiction base rate relative to entailments.Source: Difference of one word · p. 4, Table 5 · p. 4

Negations

  • Negation presence predicted contradiction in SNLI at 58.4% versus 33.3% chance, and predicted it even more strongly in the top 10,000 high-overlap pairs.The stronger high-overlap result held despite lower contradiction base rates in that subset.Source: Table 6 · p. 4, Negations · p. 4, Table 7 · p. 5

Summary of heuristics

  • InferSent’s errors are consistent with SNLI-supported lexical heuristics: overlap suggests entailment, while antonyms or negation suggest contradiction irrespective of word order.Together, these patterns indicate disproportionate reliance on lexical rather than compositional meaning.Source: Summary of heuristics · p. 5
  • A word-order heuristic is suggested but not proven; systematically testing its effects and ecological validity is difficult because possible patterns grow combinatorially.For ‘not’-type comparisons, greater word-order differences coincided with more true contradictions classified as entailments than true entailments (p = 0.2e−11).Source: Summary of heuristics · p. 5

Augmented training

The authors test whether InferSent can generalize compositional rules to unseen combinations, first through fine-tuning and then through training on SNLI and Comparisons together. Combined training preserves SNLI performance while substantially improving Comparisons performance.

Augmented training

  • The experiment tests whether training on rules from Table 1 enables generalization to unseen combinations of X, Y, and Z.The Comparisons training subset contains 40k pairs, or 7% of the 550k-pair SNLI training set; validation and test each contain 2,000 pairs, with no overlap among sets.Source: Augmented training · p. 5

Fine-tuning

  • 99.8% Comparisons test accuracy followed fine-tuning, while SNLI test accuracy fell from 84.84% to 56.37%.The authors say high test and validation performance indicates that the model learned compositional rules rather than simply memorizing Comparisons training examples.Source: Table 8 · p. 5, Fine-tuning · p. 5

Retraining

  • 84.96% SNLI test accuracy is comparable to 84.84% for SNLI-only training, while Comparisons reaches 99.55% versus 45.36% for SNLI-only training.The authors conclude that high performance on the designed edge cases is possible without losing performance on SNLI.Source: Table 9 · p. 5, Retraining · p. 5

Discussion

InferSent performs well on SNLI but fails on the Comparisons dataset, where its behavior is consistent with word-driven heuristics found in SNLI. The authors argue that carefully designed datasets can diagnose these blind spots and help improve performance through training-data changes.

Discussion

  • InferSent’s strong SNLI performance does not establish compositional representation: it fails on Comparisons, and its word-driven heuristics have ecological validity in SNLI.The controlled dataset’s behavior allowed the authors to conjecture heuristics that help explain how the model succeeds on SNLI.Source: Discussion · p. 6
  • Carefully designed datasets can test models’ representational abilities and reveal what they learn, particularly when heuristics explain much of training-data variance.The authors highlight this utility for models with large parameter spaces and many local minima.Source: Discussion · p. 6
  • Including part of Comparisons in training improves InferSent on that dataset without reducing SNLI performance, implicating training-data poverty and biases rather than architecture in this case.The authors present debiasing corpora and adding minimal contrasting examples as a path toward more compositional language encoding.Source: Discussion · p. 6

Future Directions

The authors identify limits in the Comparisons dataset and in the evidence for augmented training, and outline directions for broader evaluation.

Future Directions

  • The Comparisons dataset is restricted to comparison-type sentences; a broader dataset that still requires more than word-level information remains a research direction.The authors also propose evaluating other models, including SkipThought, and using interpretable explanations to examine their heuristics.Source: Future Directions · p. 6
  • Further augmented-training work is needed to isolate the benefits of specially designed data and determine whether results transfer to related compositional tasks or more distant understanding.The authors leave transfer beyond the reported setting as an open question.Source: Future Directions · p. 6
Loading 1802.04302v2…