ParaNMT-50M: Pushing the Limits of Paraphrastic Sentence Embeddings with Millions of Machine Translations
John Wieting, Kevin Gimpel
Introduction
While many approaches have been developed for generating or finding paraphrases Barzilay and McKeown (2001); Dolan et al. (2004); Lan et al. (2017), there do not exist any freely-available datasets with millions of sentential paraphrase pairs. The closest such resource is the Paraphrase Database (PPDB; Ganitkevitch et al., 2013), which was created automatically from bilingual text by pivoting over the non-English language (Bannard and Callison-Burch, 2005). PPDB has been used to improve word embeddings (Faruqui et al., 2015; Mrkšić et al., 2016). However, PPDB is less useful for learning sentence embeddings Wieting and Gimpel (2017).
In this paper, we describe the creation of a dataset containing more than 50 million sentential paraphrase pairs. We create it automatically by scaling up the approach of Wieting et al. (2017). We use neural machine translation (NMT) to translate the Czech side of a large Czech-English parallel corpus. We pair the English translations with the English references to form paraphrase pairs. We call this dataset ParaNMT-50M. It contains examples illustrating a broad range of paraphrase phenomena; we show examples in Section 3. ParaNMT-50M has the potential to be useful for many tasks, from linguistically controlled paraphrase generation, style transfer, and sentence simplification to core NLP problems like machine translation.
We show the utility of ParaNMT-50M by using it to train paraphrastic sentence embeddings using the learning framework of Wieting et al. (2016b). We primarily evaluate our sentence embeddings on the SemEval semantic textual similarity (STS) competitions from 2012-2016. Since so many domains are covered in these datasets, they form a demanding evaluation for a general purpose sentence embedding model.
Our sentence embeddings learned from ParaNMT-50M outperform all systems in every STS competition from 2012 to 2016. These tasks have drawn substantial participation; in 2016, for example, the competition attracted 43 teams and had 119 submissions. Most STS systems use curated lexical resources, the provided supervised training data with manually-annotated similarities, and joint modeling of the sentence pair. We use none of these, simply encoding each sentence independently using our models and computing cosine similarity between their embeddings.
We experiment with several compositional architectures and find them all to work well. We also find benefit from making a simple change to learning to better leverage the large training set, namely, increasing the search space of negative examples. We additionally evaluate on general-purpose sentence embedding tasks used in past work (Kiros et al., 2015; Conneau et al., 2017), finding our embeddings to perform competitively.
Lastly, we show that ParaNMT-50M is able to be used in paraphrase generation. Recent work Iyyer et al. (2018) used ParaNMT-50M to generate paraphrases that have a specific syntactic form. In their model, a sentence and its target form (represented as the top two levels of a linearized parse tree) are transformed by the model into a paraphrase with this target structure. We also explore paraphrase generation in this paper, finding that a basic encoder-decoder model trained on ParaNMT-50M has a canonicalization effect and is able to correct grammar and standardize the input sentence.
We release the ParaNMT-50M dataset, our trained sentence embeddings, and our code. ParaNMT-50M is the largest collection of sentential paraphrases released to date. We hope it can motivate new research directions and be used to create powerful NLP models, while adding a robustness to existing ones by incorporating paraphrase knowledge. Our paraphrastic sentence embeddings are state-of-the-art by a significant margin, and we hope they can be useful for many applications both as a sentence representation function and as a general similarity metric.
Related Work
We discuss work in automatically building paraphrase corpora, learning general-purpose sentence embeddings, and using parallel text for learning embeddings and similarity functions.
Many methods have been developed for generating or finding paraphrases, including using multiple translations of the same source material Barzilay and McKeown (2001), using comparable articles from multiple news sources Dolan et al. (2004); Dolan and Brockett (2005); Quirk et al. (2004), aligning sentences between standard and Simple English Wikipedia Coster and Kauchak (2011), crowdsourcing Xu et al. (2014, 2015); Jiang et al. (2017), using diverse MT systems to translate a single source sentence Suzuki et al. (2017), and using tweets with matching URLs Lan et al. (2017).
The most relevant prior work uses bilingual corpora. Bannard and Callison-Burch (2005) used methods from statistical machine translation to find lexical and phrasal paraphrases in parallel text. Ganitkevitch et al. (2013) scaled up these techniques to produce the Paraphrase Database (PPDB). Our goals are similar to those of PPDB, which has likewise been generated for many languages Ganitkevitch and Callison-Burch (2014) since it only needs parallel text. In particular, we follow the approach of Wieting et al. (2017), who used NMT to translate the non-English side of parallel text to get English-English paraphrase pairs. We scale up the method to a larger dataset, produce state-of-the-art paraphrastic sentence embeddings, and release all of our resources.
Our learning and evaluation setting is the same as that in recent work which seeks to learn paraphrastic sentence embeddings that can be used for downstream tasks Wieting et al. (2016b, a); Wieting and Gimpel (2017); Wieting et al. (2017). They trained models on noisy paraphrase pairs and evaluated them primarily on semantic textual similarity (STS) tasks. Prior work in learning general sentence embeddings has used autoencoders Socher et al. (2011); Hill et al. (2016), encoder-decoder architectures Kiros et al. (2015); Gan et al. (2017), and other learning frameworks Le and Mikolov (2014); Pham et al. (2015); Arora et al. (2017); Pagliardini et al. (2017); Conneau et al. (2017).
Prior work has shown that parallel text, and resources built from parallel text like NMT systems and PPDB, can be used for learning embeddings for words and sentences. Several have used PPDB as a knowledge resource for training or improving embeddings Faruqui et al. (2015); Wieting et al. (2015); Mrkšić et al. (2016). Several have used NMT architectures and training settings to obtain better embeddings for words Hill et al. (2014a, b) and words-in-context McCann et al. (2017). Hill et al. (2016) evaluated the encoders of English-to-X NMT systems as sentence representations. Mallinson et al. (2017) adapted trained NMT models to produce sentence similarity scores in semantic evaluations.
The ParaNMT-50M Dataset
To create our dataset, we used back-translation (Wieting et al., 2017). We used a Czech-English NMT system to translate Czech sentences from the training data into English. We paired the translations with the English references to form English-English paraphrase pairs.
We used the pretrained Czech-English model from the NMT system of Sennrich et al. (2017). Its training data includes four sources: Common Crawl, CzEng 1.6 Bojar et al. (2016), Europarl, and News Commentary. We next discuss how we chose the CzEng corpus from among these to create our dataset. We did not choose Czech due to any particular linguistic properties. Wieting et al. (2017) found little difference among Czech, German, and French as source languages for back-translation. There were much larger differences due to data domain, so we focus on the question of domain in this section. We leave the question of investigating properties of back-translation of different languages to future work.
To assess characteristics that yield useful data, we randomly sampled 100K English reference translations from each data source and computed statistics. Table 1 shows the average sentence length, the average inverse document frequency (IDF) where IDFs are computed using Wikipedia sentences, and the average paraphrase score for the two sentences. The paraphrase score is calculated by averaging paragram-phrase embeddings Wieting et al. (2016b) for the two sentences in each pair and then computing their cosine similarity. The table also shows the entropies of the vocabularies and constituent parses obtained using the Stanford Parser Manning et al. (2014).To mitigate sparsity in the parse entropy, we used only the top two levels of each parse tree.
Europarl exhibits the least diversity in terms of rare word usage, vocabulary entropy, and parse entropy. This is unsurprising given its formulaic and repetitive nature. CzEng has shorter sentences than the other corpora and more diverse sentence structures, as shown by its high parse entropy. In terms of vocabulary use, CzEng is not particularly more diverse than Common Crawl and News Commentary, though this could be due to the prevalence of named entities in the latter two.
In Section 5.3, we empirically compare these data sources as training data for sentence embeddings. The CzEng corpus yields the strongest performance when controlling for training data size. Since its sentences are short, we suspect this helps ensure high-quality back-translations. A large portion of it is movie subtitles which tend to use a wide vocabulary and have a diversity of sentence structures; however, other domains are included as well. It is also the largest corpus, containing over 51 million sentence pairs. In addition to providing a large number of training examples for downstream tasks, this means that the NMT system should be able to produce quality translations for this subset of its training data.
For all of these reasons, we chose the CzEng corpus to create ParaNMT-50M. When doing so, we used beam search with a beam size of 12 and selected the highest scoring translation from the beam. It took over 10,000 GPU hours to back-translate the CzEng corpus. We show illustrative examples in Table 2.
2 Manual Evaluation
We conducted a manual analysis of our dataset in order to quantify its noise level, and how the noise can be ameliorated with filtering. Two domain experts annotated a sample of 100 examples from each of five ranges of the Paraphrase Score.Since the range of values is constrained to be , and most values are positive, we split it up into 5 evenly spaced segments as shown in Table 3. They annotated both the strength of the paraphrase relationship and the fluency of the back-translation.
To annotate paraphrase strength, we adopted the annotation guidelines used by Agirre et al. (2012). The original guidelines specify 6 classes, which we reduce to 3 for simplicity. We collapse the top two into one category, leave the next alone, and collapse the bottom 3 into our lowest category. Therefore, for a sentence pair to have a rating of 3, the sentences must have the same meaning, but some unimportant details can differ. To have a rating of 2, the sentences are roughly equivalent, with some important information missing or that differs slightly. For a rating of 1, the sentences are not equivalent, even if they share minor details.
For fluency of the back-translation, we use the following: A rating of 3 means it has no grammatical errors, 2 means it has one to two errors, and 1 means it has more than two grammatical errors or is not a natural English sentence.
Table 3 summarizes the annotations. For each score range, we report the number of pairs, the mean trigram overlap score, and the number of times each paraphrase/fluency label was present in the sample of 100 pairs. There is noise in the dataset but it is largely confined in the bottom two ranges which together comprise only 16% of the entire dataset. In the highest paraphrase score range, 86% of the pairs possess a strong paraphrase relationship. The annotations suggest that ParaNMT-50M contains approximately 30 million strong paraphrase pairs, and that the paraphrase score is a good indicator of quality. With regards to fluency, the vast majority of the back-translations are fluent, even at the low end of the paraphrase score range. At the low ranges, we inspected the data and found there to be many errors in the sentence alignment in the original bitext.
Learning Sentence Embeddings
To show the usefulness of the ParaNMT-50M dataset, we will use it to train sentence embeddings. We adopt the learning framework from Wieting et al. (2016b), which was developed to train sentence embeddings from pairs in PPDB. We first describe the compositional sentence embedding models we will experiment with, then discuss training and our modification (“mega-batching”).
We want to embed a word sequence into a fixed-length vector. We denote the th word in as , and we denote its word embedding by . We focus on three model families, though we also experiment with combining them in various ways. The first, which we call Word, simply averages the embeddings of all words in . This model was found by Wieting et al. (2016b) to perform strongly for semantic similarity tasks.
The second is similar to Word, but instead of word embeddings, we average character trigram embeddings (Huang et al., 2013). We call this Trigram. Wieting et al. (2016a) found this to work well for sentence embeddings compared to other -gram orders and to word averaging.
The third family includes long short-term memory (LSTM) architectures (Hochreiter and Schmidhuber, 1997). We average the hidden states to produce the final sentence embedding. For regularization during training, we scramble words with a small probability (Wieting and Gimpel, 2017). We also experiment with bidirectional LSTMs (BLSTM), averaging the forward and backward hidden states with no concatenation.Unlike Conneau et al. (2017), we found this to outperform max-pooling for both semantic similarity and general sentence embedding tasks.
where is the model (Word, Trigram, etc.), is the margin, and is a “negative example” taken from a mini-batch during optimization. The intuition is that we want the two texts to be more similar to each other than to their negative examples. To select we choose the most similar sentence in some set. For simplicity we use the mini-batch for this set, i.e.,
where is the current mini-batch.
By using the mini-batch to select negative examples, we may be limiting the learning procedure. That is, if all potential negative examples in the mini-batch are highly dissimilar from , the loss will be too easy to minimize. Stronger negative examples can be obtained by using larger mini-batches, but large mini-batches are sub-optimal for optimization.
Therefore, we propose a procedure we call “mega-batching.” We aggregate mini-batches to create one mega-batch and select negative examples from the mega-batch. Once each pair in the mega-batch has a negative example, the mega-batch is split back up into mini-batches and training proceeds. We found that this provides more challenging negative examples during learning as shown in Section 5.5. Table 6 shows results for different values of , showing consistently higher correlations with larger values.
Experiments
We now investigate how best to use our generated paraphrase data for training paraphrastic sentence embeddings.
We evaluate sentence embeddings using the SemEval semantic textual similarity (STS) tasks from 2012 to 2016 Agirre et al. (2012, 2013, 2014, 2015, 2016) and the STS Benchmark Cer et al. (2017). Given two sentences, the aim of the STS tasks is to predict their similarity on a 0-5 scale, where 0 indicates the sentences are on different topics and 5 means they are completely equivalent. As our test set, we report the average Pearson’s over each year of the STS tasks from 2012-2016. We use the small (250-example) English dataset from SemEval 2017 Cer et al. (2017) as a development set, which we call STS2017 below.
Section A.1 in the appendix contains a description of a method to obtain a paraphrase lexicon from ParaNMT-50M that is on par with that provided by PPDB. In Section A.2 in the appendix, we also evaluate our sentence embeddings on a range of tasks that have previously been used for evaluating sentence representations (Kiros et al., 2015).
2 Experimental Setup
For training sentence embeddings on ParaNMT-50M, we follow the experimental procedure of Wieting et al. (2016b). We use paragram-sl999 embeddings Wieting et al. (2015) to initialize the word embedding matrix for all models that use word embeddings. We fix the mini-batch size to 100 and the margin to 0.4. We train all models for 5 epochs. For optimization we use Adam Kingma and Ba (2014) with a learning rate of 0.001. For the LSTM and BLSTM, we fixed the scrambling rate to 0.3.Like Wieting and Gimpel (2017), we found that scrambling significantly improves results, even though we use much more training data than they used. But while they used a scrambling rate of 0.5, we found that a smaller rate of 0.3 worked better, presumably due to the larger training set.
3 Dataset Comparison
We first compare parallel data sources. We evaluate the quality of a data source by using its back-translations paired with its English references as training data for paraphrastic sentence embeddings. We compare the four data sources described in Section 3. We use 100K samples from each corpus and trained 3 different models on each: Word, Trigram, and LSTM. Table 4 shows that CzEng provides the best training data for all models, so we use it to create ParaNMT-50M and in all remaining experiments.
CzEng is diverse in terms of vocabulary and has highly-diverse sentence structures. It has significantly shorter sentences than the other corpora, and has much more training data, so its translations are expected to be better than those in the other corpora. Wieting et al. (2017) found that sentence length was the most important factor in filtering quality training data, presumably due to how NMT quality deteriorates with longer sentences. We suspect that better translations yield better data for training sentence embeddings.
4 Data Filtering
Since the ParaNMT-50M dataset is so large, it is computationally demanding to train sentence embeddings on it in its entirety. So, we filter the data to create a training set for sentence embeddings.
We experiment with three simple methods. We first try using the length-normalized translation score from decoding. Second, we use trigram overlap filtering as done by Wieting et al. (2017).Trigram overlap is calculated by counting trigrams in the reference and translation, then dividing the number of shared trigrams by the total number in the reference or translation, whichever has fewer. Third, we use the paraphrase score from Section 3.
We filtered the back-translated CzEng data using these three strategies. We ranked all 51M+ paraphrase pairs in the dataset by the filtering measure under consideration and then split the data into tenths (so the first tenth contains the bottom 10% under the filtering criterion, the second contains those in the bottom 10-20%, etc.).
We trained Word, Trigram, and LSTM models for a single epoch on 1M examples sampled from each of the ten folds for each filtering criterion. We averaged the correlation on the STS2017 data across models for each fold. Table 5 shows the results of the filtering methods. Filtering based on paragram-phrase similarity produces the best data for training sentence embeddings.
We randomly selected 5M examples from the top two scoring folds using paragram-phrase filtering, ensuring that we only selected examples in which both sentences have a maximum length of 30 tokens.Wieting et al. (2017) investigated methods to filter back-translated parallel text. They found that sentence length cutoffs were effective for filtering. These resulting 5M examples form the training data for the rest of our experiments. Note that many more than 5M pairs from the dataset are useful, as suggested by our human evaluations in Section 3.2. We have experimented with doubling the training data when training our best sentence similarity model and found the correlation increased by more than half a percentage point on average across all datasets.
5 Effect of Mega-Batching
Table 6 shows the impact of varying the mega-batch size when training for 5 epochs on our 5M-example training set. For all models, larger mega-batches improve performance. There is a smaller gain when moving from 20 to 40, but all models show clear gains over .
Table 7 shows negative examples with different mega-batch sizes . We use the BLSTM model and show the negative examples (nearest neighbors from the mega-batch excluding the current training example) for three sentences. Using larger mega-batches improves performance, presumably by producing more compelling negative examples for the learning procedure. This is likely more important when training on sentences than prior work on learning from text snippets Wieting et al. (2015, 2016b); Pham et al. (2015).
6 Model Comparison
Table 8 shows the results on the STS tasks from 2012-2016, and Table 9 shows results on the STS Benchmark.Baseline results are from http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark, except for the unsupervised InferSent result which we computed. Our best models outperform all STS competition systems and all related work of which we are aware on the STS datasets. Note that the large improvement over BLEU and METEOR implies that our embeddings could be useful for evaluating machine translation output.
Overall, our individual models (Word, Trigram, LSTM) perform similarly. Using 300 dimensions appears to be sufficient; increasing dimensionality does not necessarily improve correlation. When examining particular STS tasks, we found that our individual models showed marked differences on certain tasks. Table 10 shows the mean absolute difference in Pearson’s over all 25 datasets. The Trigram model shows the largest differences from the other two, both of which use word embeddings. This suggests that Trigram may be able to complement the other two by providing information about words that are unknown to models that rely on word embeddings.
We experiment with two ways of combining models. The first is to define additive architectures that form the embedding for a sentence by adding the embeddings computed by two (or more) individual models. All parameters are trained jointly just like when we train individual models; that is, we do not first train two simple models and add their embeddings. The second way is to define concatenative architectures that form a sentence embedding by concatenating the embeddings computed by individual models, and again to train all parameters jointly.
In Table 8 and Table 9, these combinations show consistent improvement over the individual models as well as the larger LSTM and BLSTM. Concatenating Word and Trigram results in the best performance on average across STS tasks, outperforming the best supervised systems from each year. We will release the pretrained model for these “Word , Trigram” embeddings upon publication. In addition to providing a strong baseline for future STS tasks, our embeddings offer the advantages of being extremely efficient to compute and being robust to unknown words.
We show the usefulness of ParaNMT by also reporting the results of training the “Word , Trigram” model on SimpWiki, a dataset of aligned sentences from Simple English and standard English Wikipedia (Coster and Kauchak, 2011). It has been shown useful for training sentence embeddings in past work (Wieting and Gimpel, 2017). However, Table 8 shows that training on ParaNMT leads to gains in correlation of 3 to 6 points.
Paraphrase Generation
Besides creating state-of-the-art paraphrastic sentence embeddings, our dataset is useful for paraphrase generation for purposes of augmenting data and creating adversarial examples. The work is described fully in Iyyer et al. (2018), where their model, the Syntactically Controlled Paraphrase Network (SCPN), is trained to generate a paraphrase of a sentence whose constituent structure follows a provided parse template. These parse templates are the top two levels of the linearized parse tree (the level immediately below the root along with the root).
We have also found that training an encoder-decoder model on ParaNMT-50M can lead to a model that canonicalizes text. For this experiment, we used a bidirectional LSTM Hochreiter and Schmidhuber (1997) encoder and a two-layer LSTM decoder with soft attention over the encoded states!Bahdanau et al. (2014). The attention computation consists of a bilinear product with a learned parameter matrix.
Table 11, shows two examples from each of these models. Notice how the for the SCPN, the transformation preserves the semantics of the sentence while changing its syntax to fit the templates. The latter two examples show the canonicalization effect where the model is able to correct grammatical errors and standardize the output. This canonicalization would be interesting to explore for automatic grammar correction as it does so without any direct supervision. Future work could also use this canonicalization to improve performance of models by standardizing inputs and removing noise from data.
These were the first studies using ParaNMT-50M to generate paraphrases, and we believe that ParaNMT-50M and future datasets like it, can be used to generate rich paraphrases that improve the performance and robustness of models on a multitude of NLP tasks and leave this future exploration.
Conclusion
We described the creation of ParaNMT-50M, a dataset of more than 50M English sentential paraphrase pairs. We showed how to use ParaNMT-50M to train paraphrastic sentence embeddings that outperform supervised systems on STS tasks, as well as how it can be used for generating paraphrases for purposes of data augmentation, robustness, and even grammar correction.
The key advantage of our approach is that it only requires parallel text. There are hundreds of millions of parallel sentence pairs, and more are being generated continually. Our procedure is immediately applicable to the wide range of languages for which we have parallel text.
We release ParaNMT-50M, our code, and pretrained sentence embeddings, which also exhibit strong performance as general-purpose representations for a multitude of tasks.We will release code and embeddings under the permissive MIT and CC BY 4.0 licenses. We will work with the CzEng developers to release ParaNMT-50M under the most permissive license possible, but as CzEng is only available for non-commercial research purposes, we may be restricted to release ParaNMT-50M under the same license as CzEng. We hope that ParaNMT-50M, along with our embeddings, can impart a notion of meaning equivalence to improve NLP systems for a variety of tasks. We are actively investigating ways to apply these two new resources to downstream applications, including machine translation, question answering, and paraphrase generation for data augmentation and finding adversarial examples.
Acknowledgments
We thank the developers of Theano Theano Development Team (2016), the developers of PyTorch Paszke et al. (2017), and NVIDIA Corporation for donating GPUs used in this research.
References
Appendix A Appendix
While ParaNMT-50M consists of sentence pairs, we demonstrate how a paraphrase lexicon can be extracted from it. One simple approach is to extract and rank word pairs using the cross-sentence pointwise mutual information (PMI):
where joint counts are incremented when appears in a sentence and appears in its paraphrase. The marginal counts (e.g., ) are computed based on single-sentence counts, as in ordinary PMI. This works reasonably well but is not able to differentiate words that frequently occur in paraphrase pairs from words that simply occur frequently together in the same sentence. For example, “Hong” and “Kong” have high cross-sentence PMI. We can improve the score by subtracting the ordinary PMI that computes joint counts based on single-sentence co-occurrences. We call the result the adjusted PMI:
Before computing these PMIs from ParaNMT-50M, we removed sentence pairs with a paraphrase score less than 0.35 and where either sentence is longer than 30 tokens. When computing the ordinary PMI with single-sentence context, we actually compute separate versions of this PMI score for translations and references in each ParaNMT-50M pair, then we average them together. We did this because the two sentences in each pair have highly correlated information, so computing PMI on each half of the data would correspond to capturing natural corpus statistics in a standard application of PMI.
Table 13 shows an evaluation of the resulting score functions on the SimLex-999 word similarity dataset (Hill et al., 2015). As a baseline, we use the lexical portion of PPDB 2.0 (Pavlick et al., 2015), evaluating its ranking score as a similarity score and assigning a similarity of 0 to unseen word pairs.If both orderings for a SimLex word pair appear in PPDB, we average their PPDB 2.0 scores. If multiple lexical entries are found with different POS tags, we take the first instance. Our adjusted PMI computed from ParaNMT-50M is on par with the best PPDB lexicon.
Table 12 shows examples from PPDB and our paraphrase lexicon computed from ParaNMT-50M. Paraphrases from PPDB are ordered by the PPDB 2.0 scoring function. Paraphrases from our lexicon are ordered using our adjusted PMI scoring function; we only show paraphrases that appeared at least 10 times in ParaNMT-50M.
A.2 General-Purpose Sentence Embedding Evaluations
We evaluate our sentence embeddings on a range of tasks that have previously been used for evaluating sentence representations (Kiros et al., 2015). These include sentiment analysis (MR, Pang and Lee, 2005; CR, Hu and Liu, 2004; SST, Socher et al., 2013), subjectivity classification (SUBJ; Pang and Lee, 2004), opinion polarity (MPQA; Wiebe et al., 2005), question classification (TREC; Li and Roth, 2002), paraphrase detection (MRPC; Dolan et al., 2004), semantic relatedness (SICK-R; Marelli et al., 2014), and textual entailment (SICK-E). We use the SentEval package from Conneau et al. (2017) to train models on our fixed sentence embeddings for each task.Available at https://github.com/facebookresearch/SentEval.
Table 14 shows results on the general sentence embedding tasks. Each of our individual models produces 300-dimensional sentence embeddings, which is far fewer than the several thousands (often 2400-4800) of dimensions used in most prior work. While using higher dimensionality does not improve correlation on the STS tasks, it does help on the general sentence embedding tasks. Using higher dimensionality leads to more trainable parameters in the subsequent classifiers, increasing their ability to linearly separate the data.
To enlarge the dimensionality, we concatenate the forward and backward states prior to averaging. This is similar to Conneau et al. (2017), though they used max pooling. We experimented with both averaging (“BLSTM (Avg., concatenation)”) and max pooling (“BLSTM (Max, concatenation)”) using recurrent networks with 2048-dimensional hidden states, so concatenating them yields a 4096-dimension embedding. These high-dimensional models outperform SkipThought (Kiros et al., 2015) on all tasks except SUBJ and TREC. Nonetheless, the InferSent Conneau et al. (2017) embeddings trained on AllNLI still outperform our embeddings on nearly all of these general-purpose tasks.
We also note that on five tasks (SUBJ, MPQA, SST, TREC, and MRPC), all sentence embedding methods are outperformed by supervised baselines. These baselines use the same amount of supervision as the general sentence embedding methods; the latter actually use far more data overall than the supervised baselines. This suggests that the pretrained sentence representations are not capturing the features learned by the models engineered for those tasks.
We take a closer look of how our embeddings compare to InferSent (Conneau et al., 2017). InferSent is a supervised model trained on a large textual entailment dataset (the SNLI and MultiNLI corpora Bowman et al. (2015); Williams et al. (2017), which consist of nearly 1 million human-labeled examples).
While InferSent has strong performance across all downstream tasks, our model obtains better results on semantic similarity tasks. It consistently reach correlations approximately 10 points higher than those of InferSent.
Regarding the general-purpose tasks, we note that some result trends appear to be influenced by the domain of the data. InferSent is trained on a dataset of mostly captions, especially the model trained on just SNLI. Therefore, the datasets for the SICK relatedness and entailment evaluations are similar in domain to the training data of InferSent. Further, the training task of natural language inference is aligned to the SICK entailment task. Our results on MRPC and entailment are significantly better than SkipThought, and on a paraphrase task that does not consist of caption data (MRPC), our embeddings are competitive with InferSent. To quantify these domain effects, we performed additional experiments that are described in Section A.2.1.
There are many ways to train sentence embeddings, each with its own strengths. InferSent, our models, and the BYTE mLSTM of Radford et al. (2017) each excel in particular classes of downstream tasks. Ours are specialized for semantic similarity. BYTE mLSTM is trained on review data and therefore is best at the MR and CR tasks. Since the InferSent models are trained using entailment supervision and on caption data, they excel on the SICK tasks. Future work will be needed to combine multiple supervision signals to generate embeddings that perform well across all tasks.
We performed additional experiments to investigate the impact of training domain on downstream tasks. We first compare the performance of our “Word , Trigram (concatenation)” model to the InferSent SNLI and AllNLI models on all STS tasks from 2012-2016. We then compare the overall mean with that of the three caption STS datasets within the collection. The results are shown in Table 15. The InferSent models are much closer to our Word , Trigram model on the caption datasets than overall, and InferSent trained on SNLI shows the largest difference between its overall performance and its performance on caption data.
We also compare the performance of these models on the STS Benchmark under several conditions (Table 16). We first compare unsupervised results on the entire test set, the subset consisting of captions (3,250 of the 8,628 examples in the test set), and the remainder. We include analogous results in the supervised setting, where we filter the respective training and development sets in addition to the test sets. Compared to our model, InferSent shows a much larger gap between captions and non-captions, providing evidence of a bias. Note that this bias is smaller for the model trained on AllNLI, as its training data includes other domains.