Learning Semantic Sentence Embeddings using Sequential Pair-wise Discriminator

Badri Narayana Patro, Vinod Kumar Kurmi, Sandeep Kumar, Vinay P. Namboodiri

TL;DR

This paper introduces a novel method for learning semantic sentence embeddings by combining a sequential encoder-decoder architecture with a pairwise discriminator. This approach, trained on paraphrase generation, results in embeddings that significantly improve performance on both paraphrase generation and sentiment analysis tasks, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

Representing the meaning of sentences in a way that captures semantic similarity is a fundamental challenge in Natural Language Processing (NLP). While word-level embeddings are well-studied, creating effective sentence-level embeddings that accurately reflect meaning remains an open problem. Existing methods often struggle to capture the global semantic coherence of a sentence, focusing more on local word order or simple averaging. This paper aims to bridge this gap by developing sentence embeddings that ensure semantically related sentences are close in the embedding space and unrelated ones are far apart.

Methods

The core of the proposed method is a sequential encoder-decoder architecture, commonly used in tasks like machine translation. However, this paper enhances it with a pairwise discriminator. The encoder processes the input sentence, and the decoder generates a paraphrase. The novelty lies in the discriminator, which is trained to distinguish between "true" paraphrases (semantically similar) and "candidate" paraphrases (semantically dissimilar).

Crucially, the discriminator shares weights with the encoder. This shared architecture allows the discriminator to learn embeddings that are not only locally coherent (ensured by the standard encoder-decoder loss) but also globally meaningful. The training objective combines a "local loss" (cross-entropy for generating the correct paraphrase) with a "global loss" that explicitly pushes embeddings of true paraphrases closer and those of unrelated sentences further apart. This "global" loss is a key innovation for learning robust sentence representations.

Datasets

The paper utilizes two primary datasets:

  • Quora Question Pairs Dataset: This dataset, containing approximately 149K question pairs labeled as paraphrases, is used for training and evaluating the paraphrase generation task.
  • Stanford Sentiment Treebank (SST) Dataset: This dataset, with movie reviews labeled at the phrase level, is used to evaluate the learned sentence embeddings on a sentiment analysis task.

Key Insights and Ideas

  • Global vs. Local Loss: The paper highlights the importance of a "global" loss function, in addition to the standard "local" loss, for learning truly semantic sentence embeddings. The global loss directly enforces semantic relationships between sentence representations.
  • Shared Encoder-Discriminator: Sharing weights between the encoder and discriminator is a critical design choice. It allows the discriminator to leverage the encoder's learned representations and vice-versa, leading to more effective and jointly optimized embeddings.
  • Paraphrase Generation as a Proxy: The authors cleverly use paraphrase generation as a task to learn sentence embeddings. The intuition is that if a model can generate a good paraphrase, its internal representation of the original sentence must capture its core meaning.
  • Transferability of Embeddings: The research demonstrates that embeddings learned for paraphrase generation can be effectively transferred to a different task like sentiment analysis, showcasing their general semantic utility.

Key Results

The proposed method, referred to as EDD-LG(shared), consistently outperforms baselines and state-of-the-art methods on both tasks:

  • Paraphrase Generation: On the Quora dataset, EDD-LG(shared) achieved significant improvements in BLEU scores (up to 24% for 50K dataset and 22% for 100K dataset) and TER scores (lower is better, showing improvement). Statistical significance tests confirm these gains are not due to chance.
  • Sentiment Analysis: On the Stanford Sentiment Treebank dataset, the proposed method achieved an error rate of 35.6%, outperforming previous methods by an absolute margin of 15.7%.

Qualitative examples show the model's ability to capture nuances and higher-level semantics, even understanding abbreviations and generating semantically coherent paraphrases.

Limitations and Future Work

  • Generalization to Vision: The authors mention plans to generalize the idea to other domains, specifically mentioning the vision domain.
  • Other NLP Tasks: While the paper demonstrates effectiveness on paraphrase generation and sentiment analysis, it suggests extending the approach to other NLP tasks.
  • Dataset Size: While the Quora dataset is large, the paper uses subsets (50K, 100K) for training, and further exploration with the full dataset might yield even better results.
  • Computational Cost: Training with both local and global losses, and a discriminator, can be computationally intensive, though the paper does not explicitly detail this limitation.

Summary updated

BibTeX
@inproceedings{patro2018learning,
  author = {Badri Narayana Patro and Vinod Kumar Kurmi and Sandeep Kumar and Vinay P. Namboodiri},
  title = {{Learning Semantic Sentence Embeddings using Sequential Pair-wise Discriminator}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=V1SJuqFI93J},
}
Figure