SufiSent - Universal Sentence Representations Using Suffix Encodings

Siddhartha BrahmaWorkshops @ ICLR 2018

Introduction

In Natural Language Processing (NLP), "universal" representations are highly sought after. Just as Word2Vec or GloVe provide general-purpose vectors for individual words, researchers aim to develop a single model capable of encoding an entire sentence into a fixed-length vector. Ideally, this vector should be robust enough to transfer across diverse tasks—such as sentiment analysis, paraphrase detection, and logical entailment—without requiring task-specific architectural redesigns.

The standard approach for generating these embeddings has heavily relied on Bidirectional LSTMs (BiLSTMs). While a BiLSTM captures suffix information by reading a sentence backward, this is fundamentally different from reading a suffix in its natural, forward order. SufiSent introduces a novel method for creating universal sentence embeddings by explicitly encoding word sequence suffixes in the forward direction. By combining these suffix encodings with traditional prefix encodings, the model outperforms standard BiLSTM-based approaches across a variety of downstream NLP transfer tasks.

Methodology

The core innovation of SufiSent lies in how it manages the hidden states of a Recurrent Neural Network (RNN) to better capture semantic nuances.

  1. Prefix vs. Suffix Encodings: In a standard LSTM, the hidden state at word $i$ represents an encoding of the prefix (all words from the start of the sentence up to $i$). SufiSent introduces a secondary LSTM that encodes the suffix (all words from $i$ to the end of the sentence).
  2. The Forward Twist: Unlike a BiLSTM, which reads the sentence in reverse to gather "backward" context, SufiSent’s suffix encoder reads the words in their original, forward order, simply starting from different points in the sentence. This preserves the natural flow of the language.
  3. Max-Pooling: To generate the final sentence vector, the model applies max-pooling over all the prefix hidden states and all the suffix hidden states. This extracts the most salient features from every possible sub-segment of the sentence.

The authors experimented with four architectural variants:

  • SufiSent: Independent prefix and suffix LSTMs.
  • SufiSent-Tied: The prefix and suffix LSTMs share the same weights.
  • SufiSent-Cat: Concatenates prefix and suffix encodings from both forward and backward directions (resulting in a larger vector).
  • SufiSent-Cat-Tied: The concatenated version with shared weights.

Experimental Setup

The models were trained on the Stanford Natural Language Inference (SNLI) dataset, a supervised task where the model determines if a "hypothesis" sentence entails, contradicts, or is neutral toward a "premise" sentence.

To evaluate the "universality" of the learned embeddings, the authors used the SentEval benchmark, which includes 10 diverse transfer tasks ranging from classification (e.g., movie reviews, sentiment, subjectivity) to entailment and semantic similarity.

Key Insights and Results

Directionality and Weight Tying

The primary insight of SufiSent is that a suffix processed forward contains different, and often more useful, information than a reversed prefix. Furthermore, the "Tied" models (where the same LSTM weights are used for both prefixes and suffixes) generally performed better than the untied versions. This suggests that learning a single, robust mechanism for encoding sequences is more effective than training two specialized encoders.

Scaling with Dimension

The performance of SufiSent improves consistently as the hidden dimension increases, demonstrating that the architecture can effectively utilize higher-capacity vectors (up to 4096 dimensions).

Performance of SufiSent variants across different encoding dimensions.

Outperforming the Baseline

SufiSent demonstrated strong empirical results, particularly in sentiment and opinion tasks. For instance, on the Movie Review (MR) task, SufiSent achieved 80.6% accuracy compared to InferSent's 79.9%. Overall, SufiSent improved upon or matched existing supervised approaches on 7 out of the 10 SentEval tasks when trained on the same SNLI data.

Most notably, the SufiSent-Tied model (at dimension 4096) achieved a micro-average accuracy of 86.6% across transfer tasks, significantly outperforming the 85.2% achieved by the standard BiLSTM-Max (InferSent) baseline.

Comparison of SufiSent models against baselines on SNLI and transfer tasks.

Limitations and Future Work

While highly effective, SufiSent comes with computational trade-offs. Computing $n$ suffixes for a sentence of length $n$ requires multiple passes over progressively smaller segments of the data. This makes it computationally more expensive than a standard single-pass BiLSTM.

Future work could involve training the model on the larger AllNLI dataset to see if the performance gap widens further. Additionally, the authors suggest exploring SufiSent as a foundational representation primitive for more complex NLP tasks, such as machine translation or document summarization, moving beyond simple sentence embeddings.

Summary updated

BibTeX
@inproceedings{brahma2018sufisent,
  author = {Siddhartha Brahma},
  title = {{SufiSent - Universal Sentence Representations Using Suffix Encodings}},
  booktitle = {Workshops @ ICLR},
  year = {2018},
}
Figure