Venue: NAACL 2018

# Unsupervised Learning of Sentence Embeddings

using Compositional n-Gram Features

Matteo Pagliardini*

Iprova SA, Switzerland

mpagliardini@iprova.com &Prakhar Gupta*

EPFL, Switzerland

prakhar.gupta@epfl.ch &Martin Jaggi

EPFL, Switzerland

martin.jaggi@epfl.ch

###### Abstract

The recent tremendous success of unsupervised word embeddings in a multitude of applications raises the obvious question if similar methods could be derived to improve embeddings (i.e. semantic representations) of word sequences as well. We present a simple but efficient unsupervised objective to train distributed representations of sentences. Our method outperforms the state-of-the-art unsupervised models on most benchmark tasks, highlighting the robustness of the produced general-purpose sentence embeddings.

+
Footnote †: indicates equal contribution

## 1 Introduction

Improving unsupervised learning is of key importance for advancing machine learning methods, as to unlock access to almost unlimited amounts of data to be used as training resources. The majority of recent success stories of deep learning does not fall into this category but instead relied on supervised training (in particular in the vision domain). A very notable exception comes from the text and natural language processing domain, in the form of semantic word embeddings trained unsupervised Mikolov et al. (2013b, a); Pennington et al. (2014). Within only a few years from their invention, such word representations - which are based on a simple matrix factorization model as we formalize below - are now routinely trained on very large amounts of raw text data, and have become ubiquitous building blocks of a majority of current state-of-the-art NLP applications.

While very useful semantic representations are available for words, it remains challenging to produce and learn such semantic embeddings for longer pieces of text, such as sentences, paragraphs or entire documents. Even more so, it remains a key goal to learn such general-purpose representations in an unsupervised way.

Currently, two contrary research trends have emerged in text representation learning: On one hand, a strong trend in deep-learning for NLP leads towards increasingly powerful and complex models, such as recurrent neural networks (RNNs), LSTMs, attention models and even Neural Turing Machine architectures. While extremely strong in expressiveness, the increased model complexity makes such models much slower to train on larger datasets. On the other end of the spectrum, simpler "shallow" models such as matrix factorizations (or bilinear models) can benefit from training on much larger sets of data, which can be a key advantage, especially in the unsupervised setting.

Surprisingly, for constructing sentence embeddings, naively using averaged word vectors was shown to outperform LSTMs (see Wieting et al. (2016b) for plain averaging, and Arora et al. (2017) for weighted averaging). This example shows potential in exploiting the trade-off between model complexity and ability to process huge amounts of text using scalable algorithms, towards the simpler side. In view of this tradeoff, our work here further advances unsupervised learning of sentence embeddings. Our proposed model can be seen as an extension of the C-BOW Mikolov et al. (2013b, a) training objective to train sentence instead of word embeddings. We demonstrate that the empirical performance of our resulting general-purpose sentence embeddings very significantly exceeds the state of the art, while keeping the model simplicity as well as training and inference complexity exactly as low as in averaging methods Wieting et al. (2016b); Arora et al. (2017), thereby also putting the work by Arora et al. (2017) in perspective.





**Contributions.** The main contributions in this work can be summarized as follows:

* **Model.** We propose **Sent2Vec1**, a simple unsupervised model allowing to compose sentence embeddings using word vectors along with n-gram embeddings, simultaneously training composition and the embedding vectors themselves. Footnote 1: All our code and pre-trained models will be made publicly available on [http://github.com/epfml/sent2vec](http://github.com/epfml/sent2vec)
* **Efficiency & Scalability.** The computational complexity of our embeddings is only \({\cal O}(1)\) vector operations per word processed, both during training and inference of the sentence embeddings. This strongly contrasts all neural network based approaches, and allows our model to learn from extremely large datasets, in a streaming fashion, which is a crucial advantage in the unsupervised setting. Fast inference is a key benefit in downstream tasks and industry applications.
* **Performance.** Our method shows significant performance improvements compared to the current state-of-the-art unsupervised and even semi-supervised models. The resulting general-purpose embeddings show strong robustness when transferred to a wide range of prediction benchmarks.

## 2 Model

Our model is inspired by simple matrix factor models (bilinear models) such as recently very successfully used in unsupervised learning of word embeddings Mikolov et al. (2013); Bahdanovic et al. (2014); Pennington et al. (2014); Bojanowski et al. (2017) as well as supervised of sentence classification Joulin et al. (2017). More precisely, these models can all be formalized as an optimization problem of the form

\[\min_{\mathbf{U},\mathbf{V}}~{}~{}\sum_{S\in\mathcal{C}}f_{S}(\mathbf{UV}\mathbf{\iota}_{S}) \tag{1}\]

for two parameter matrices \(\mathbf{U}\in\mathbb{R}^{k\times h}\) and \(\mathbf{V}\in\mathbb{R}^{h\times|\mathcal{V}|}\), where \(\mathcal{V}\) denotes the vocabulary. Here, the columns of the matrix \(\mathbf{V}\) represent the learnt source word vectors whereas those of \(\mathbf{U}\) represent the target word vectors. For a given sentence \(S\), which can be of arbitrary length, the indicator vector \(\mathbf{\iota}_{S}\in\{0,1\}^{|\mathcal{V}|}\) is a binary vector encoding \(S\) (bag of words encoding).

Fixed-length context windows \(S\) running over the corpus are used in word embedding methods as in C-BOW Mikolov et al. (2013); Bahdanovic et al. (2014); Cho et al. (2015) and GloVe Pennington et al. (2014). Here we have \(k=|\mathcal{V}|\) and each cost function \(f_{S}:\mathbb{R}^{k}\rightarrow\mathbb{R}\) only depends on a single row of its input, describing the observed target word for the given fixed-length context \(S\). In contrast, for sentence embeddings which are the focus of our paper here, \(S\) will be entire sentences or documents (therefore variable length). This property is shared with the supervised FastText classifier Joulin et al. (2017), which however uses soft-max with \(k\ll|\mathcal{V}|\) being the number of class labels.

### Proposed Unsupervised Model

We propose a new unsupervised model, **Sent2Vec**, for learning universal sentence embeddings. Conceptually, the model can be interpreted as a natural extension of the word-contexts from C-BOW Mikolov et al. (2013); Bahdanovic et al. (2014) to a larger sentence context, with the sentence words being specifically optimized towards additive combination over the sentence, by means of the unsupervised objective function.

Formally, we learn a source (or context) embedding \(\mathbf{v}_{w}\) and target embedding \(\mathbf{u}_{w}\) for each word \(w\) in the vocabulary, with embedding dimension \(h\) and \(k=|\mathcal{V}|\) as in (1). The sentence embedding is defined as the average of the source word embeddings of its constituent words, as in (2). We augment this model furthermore by also learning source embeddings for not only unigrams but also n-grams present in each sentence, and averaging the n-gram embeddings along with the words, i.e., the sentence embedding \(\mathbf{v}_{S}\) for \(S\) is modeled as

\[\mathbf{v}_{S}:=\tfrac{1}{|R(S)|}\mathbf{V}\mathbf{\iota}_{R(S)}=\tfrac{1}{|R(S)|}\sum_{w \in R(S)}\mathbf{v}_{w} \tag{2}\]

where \(R(S)\) is the list of n-grams (including unigrams) present in sentence \(S\). In order to predict a missing word from the context, our objective models the softmax output approximated by negative sampling following Mikolov et al. (2013). For the large number of output classes \(|\mathcal{V}|\) to be predicted, negative sampling is known to significantly improve training efficiency, see also Goldberg and Levy (2014). Given the binary logistic

loss function \(\ell:x\mapsto\log{(1+e^{-x})}\) coupled with negative sampling, our unsupervised training objective is formulated as follows:

where \(S\) corresponds to the current sentence and \(N_{w_{t}}\) is the set of words sampled negatively for the word \(w_{t}\in S\). The negatives are sampled2 following a multinomial distribution where each word \(w\) is associated with a probability \(q_{n}(w):=\sqrt{f_{w}}\big{/}\left(\sum_{w_{i}\in\mathcal{V}}\sqrt{f_{w_{i}}}\right)\), where \(f_{w}\) is the normalized frequency of \(w\) in the corpus.

Footnote 2: To efficiently sample negatives, a pre-processing table is constructed, containing the words corresponding to the square root of their corpora frequency. Then, the negatives \(N_{w_{t}}\) are sampled uniformly at random from the negatives table except the target \(w_{t}\) itself, following Joulin et al. (2017); Bojanowski et al. (2017).

To select the possible target unigrams (positives), we use subsampling as in Joulin et al. (2017); Bojanowski et al. (2017), each word \(w\) being discarded with probability \(1-q_{p}(w)\) where \(q_{p}(w):=\min\big{\{}1,\sqrt{t/f_{w}}+t/f_{w}\big{\}}\). Where \(t\) is the subsampling hyper-parameter. Subsampling prevents very frequent words of having too much influence in the learning as they would introduce strong biases in the prediction task. With positives subsampling and respecting the negative sampling distribution, the precise training objective function becomes

\[\underset{\boldsymbol{U},\boldsymbol{V}}{\text{min}}~{}~{}\sum_{ S\in\mathcal{C}}\sum_{w_{t}\in S}\bigg{(}q_{p}(w_{t})\ell\big{(}\mathbf{u}_{w_{ t}}^{\top}\mathbf{v}_{S\setminus\{w_{t}\}}\big{)}\] (3) \[~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~ {}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~ {}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~ {}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~ {}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~ {}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{ }~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{} ~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}  

sentence randomly from the dataset and then proceed to select all the possible target unigrams using subsampling. We update the weights using SGD with a linearly decaying learning rate.

Also, to prevent overfitting, for each sentence we use dropout on its list of n-grams \(R(S)\setminus\{U(S)\}\), where \(U(S)\) is the set of all unigrams contained in sentence \(S\). After empirically trying multiple dropout schemes, we find that dropping \(K\) n-grams (\(n>1\)) for each sentence is giving superior results compared to dropping each token with some fixed probability. This dropout mechanism would negatively impact shorter sentences. The regularization can be pushed further by applying L1 regularization to the word vectors. Encouraging sparsity in the embedding vectors is particularly beneficial for high dimension \(h\). The additional soft thresholding in every SGD step adds negligible computational cost. See also Appendix B. We train two models on each dataset, one with unigrams only and one with unigrams and bigrams. All training parameters for the models are provided in Table 5 in the appendix. Our C++ implementation builds upon the FastText library Joulin et al. (2017); Bojanowski et al. (2017). We will make our code and pre-trained models available open-source.

## 3 Related Work

We discuss existing models which have been proposed to construct sentence embeddings. While there is a large body of works in this direction - several among these using e.g. labelled datasets of paraphrase pairs to obtain sentence embeddings in a supervised manner Wieting et al. (2016a,b); Conneau et al. (2017) to learn sentence embeddings - we here focus on unsupervised, task-independent models. While some methods require ordered raw text i.e., a coherent corpus where the next sentence is a logical continuation of the previous sentence, others rely only on raw text i.e., an unordered collection of sentences. Finally, we also discuss alternative models built from structured data sources.

### Unsupervised Models Independent of Sentence Ordering

The **ParagraphVector DBOW** model Le and Mikolov (2014) is a log-linear model which is trained to learn sentence as well as word embeddings and then use a softmax distribution to predict words contained in the sentence given the sentence vector representation. They also propose a different model **ParagraphVector DM** where they use n-grams of consecutive words along with the sentence vector representation to predict the next word.

Lev et al. (2015) also presented an early approach to obtain compositional embeddings from word vectors. They use different compositional techniques including static averaging or Fisher vectors of a multivariate Gaussian to obtain sentence embeddings from word2vec models.

Hill et al. Hill et al. (2016a) propose a **Sequential (Denoising) Autoencoder, S(D)AE**. This model first introduces noise in the input data: Firstly each word is deleted with probability \(p_{0}\), then for each non-overlapping bigram, words are swapped with probability \(p_{x}\). The model then uses an LSTM-based architecture to retrieve the original sentence from the corrupted version. The model can then be used to encode new sentences into vector representations. In the case of \(p_{0}=p_{x}=0\), the model simply becomes a Sequential Autoencoder. Hill et al. Hill et al. (2016a) also propose a variant **(S(D)AE + embs.)** in which the words are represented by fixed pre-trained word vector embeddings.

Arora et al. Arora et al. (2017) propose a model in which sentences are represented as a weighted average of fixed (pre-trained) word vectors, followed by post-processing step of subtracting the principal component. Using the generative model of Arora et al. (2016), words are generated conditioned on a sentence "discourse" vector \(\mathbf{c}_{s}\):

\[Pr[w\,|\,\mathbf{c}_{s}]=\alpha f_{w}+(1-\alpha)\frac{\exp(\tilde{\mathbf{c}}^{\top} _{s}\mathbf{v}_{w})}{Z_{\tilde{\mathbf{c}}_{s}}},\]

where \(Z_{\tilde{\mathbf{c}}_{s}}:=\sum_{w\in\mathcal{V}}\exp(\tilde{\mathbf{c}}^{\top}_{s} \mathbf{v}_{w})\) and \(\tilde{\mathbf{c}}_{s}:=\beta\mathbf{c}_{0}+(1-\beta)\mathbf{c}_{s}\) and \(\alpha\), \(\beta\) are scalars. \(\mathbf{c}_{0}\) is the common discourse vector, representing a shared component among all discourses, mainly related to syntax. It allows the model to better generate syntactical features. The \(\alpha f_{w}\) term is here to enable the model to generate some frequent words even if their matching with the discourse vector \(\tilde{\mathbf{c}}_{s}\) is low.

Therefore, this model tries to generate sentences as a mixture of three type of words: words matching the sentence discourse vector \(\mathbf{c}_{s}\), syntactical words matching \(\mathbf{c}_{0}\), and words with high \(f_{w}\). Arora et al. (2017) demonstrated that for this model, the MLE of \(\tilde{\mathbf{c}}_{s}\) can be approximated by \(\sum_{w\in S}\frac{a}{f_{w}+a}\mathbf{v}_{w}\), where \(a\) is a scalar. The sentence 

discourse vector can hence be obtained by subtracting \({\mathbf{c}_{0}}\) estimated by the first principal component of \(\tilde{{\mathbf{c}}}_{s}\)'s on a set of sentences. In other words, the sentence embeddings are obtained by a weighted average of the word vectors stripping away the syntax by subtracting the common discourse vector and down-weighting frequent tokens. They generate sentence embeddings from diverse pre-trained word embeddings among which are unsupervised word embeddings such as GloVe Pennington et al. (2014) as well as supervised word embeddings such as paragramSL999 (PSL) Wieting et al. (2015) trained on the Paraphrase Database Ganitkevitch et al. (2013).

In a very different line of work, **C-PHRASE**Pham et al. (2015) relies on additional information from the syntactic parse tree of each sentence, which is incorporated into the C-BOW training objective.

Huang and Anandkumar (2016) show that single layer CNNs can be modeled using a tensor decomposition approach. While building on an unsupervised objective, the employed dictionary learning step for obtaining phrase templates is task-specific (for each use-case), not resulting in general-purpose embeddings.

### Unsupervised Models Depending on Sentence Ordering

The **SkipThought** model Kiros et al. (2015) combines sentence level models with recurrent neural networks. Given a sentence \(S_{i}\) from an ordered corpus, the model is trained to predict \(S_{i-1}\) and \(S_{i+1}\).

**FastSent**Hill et al. (2016a) is a sentence-level log-linear bag-of-words model. Like SkipThought, it uses adjacent sentences as the prediction target and is trained in an unsupervised fashion. Using word sequences allows the model to improve over the earlier work of paragraph2vec Le and Mikolov (2014). Hill et al. (2016a) augment FastSent further by training it to predict the constituent words of the sentence as well. This model is named **FastSent + AE** in our comparisons.

Compared to our approach, **Siamese C-BOW**Kenter et al. (2016) shares the idea of learning to average word embeddings over a sentence. However, it relies on a Siamese neural network architecture to predict surrounding sentences, contrasting our simpler unsupervised objective.

Note that on the character sequence level instead of word sequences, FastText Bojanowski et al. (2017) uses the same conceptual model to obtain better word embeddings. This is most similar to our proposed model, with two key differences: Firstly, we predict from source word sequences to target words, as opposed to character sequences to target words, and secondly, our model is averaging the source embeddings instead of summing them.

### Models requiring structured data

**DictRep**Hill et al. (2016b) is trained to map dictionary definitions of the words to the pre-trained word embeddings of these words. They use two different architectures, namely BOW and RNN (LSTM) with the choice of learning the input word embeddings or using them pre-trained. A similar architecture is used by the **CaptionRep** variant, but here the task is the mapping of given image captions to a pre-trained vector representation of these images.

## 4 Evaluation Tasks

We use a standard set of supervised as well as unsupervised benchmark tasks from the literature to evaluate our trained models, following Hill et al. (2016a). The breadth of tasks allows to fairly measure generalization to a wide area of different domains, testing the general-purpose quality (universality) of all competing sentence embeddings. For downstream supervised evaluations, sentence embeddings are combined with logistic regression to predict target labels. In the unsupervised evaluation for sentence similarity, correlation of the cosine similarity between two embeddings is compared to human annotators.

**Downstream Supervised Evaluation.** Sentence embeddings are evaluated for various supervised classification tasks as follows. We evaluate paraphrase identification (MSRP) Dolan et al. (2004), classification of movie review sentiment (MR) Pang and Lee (2005), product reviews (CR) Hu and Liu (2004), subjectivity classification (SUBJ) Pang and Lee (2004), opinion polarity (MPQA) Wiebe et al. (2005) and question type classification (TREC) Voorhees (2002). To classify, we use the code provided by Kiros et al. (2015) in the same manner as in Hill et al. (2016a). For the MSRP dataset, containing pairs of sentences \((S_{1},S_{2})\) with associated paraphrase label, we generate feature vectors by concatenating 

their Sent2Vec representations \(|{\mathbf{v}_{S_{1}}-\mathbf{v}_{S_{2}}}|\) with the component-wise product \({\mathbf{v}_{S_{1}}\odot\mathbf{v}_{S_{2}}}\). The pre-defined training split is used to tune the L2 penalty parameter using cross-validation and the accuracy and F1 scores are computed on the test set. For the remaining 5 datasets, Sent2Vec embeddings are inferred from input sentences and directly fed to a logistic regression classifier. Accuracy scores are obtained using 10-fold cross-validation for the MR, CR, SUBJ and MPQA datasets. For those datasets nested cross-validation is used to tune the L2 penalty. For the TREC dataset, as for the MRSP dataset, the L2 penalty is tuned on the pre-defined train split using 10-fold cross-validation, and the accuracy is computed on the test set.

**Unsupervised Similarity Evaluation.** We perform unsupervised evaluation of the learnt sentence embeddings using the sentence cosine similarity, on the STS 2014 Agirre et al. (2014) and SICK 2014 Marelli et al. (2014) datasets. These similarity scores are compared to the gold-standard human judgements using Pearson's \(r\)Pearson (1895) and Spearman's \(\rho\)Spearman (1904) correlation scores. The SICK dataset consists of about 10,000 sentence pairs along with relatedness scores of the pairs. The STS 2014 dataset contains 3,770 pairs, divided into six different categories on the basis of the origin of sentences/phrases, namely Twitter, headlines, news, forum, WordNet and images.

## 5 Results and Discussion

In Tables 1 and 2, we compare our results with those obtained by Hill et al. (2016a) on different models. Table 3 in the last column shows the dramatic improvement in training time of our models (and other C-BOW-inspired models) in contrast to neural network based models. All our Sent2Vec models are trained on a machine with 2x Intel Xeon E5\(-\)2680v3, 12 cores @2.5GHz. Along with the models discussed in Section 3, this also includes the sentence embedding baselines obtained by simple averaging of word embeddings over the sentence, in both the C-BOW and skipgram variants. TF-IDF BOW is a representation consisting of the counts of the 200,000 most common feature-words, weighed by their TF-IDF frequencies. To ensure coherence, we only include unsupervised models in the main paper. Performance of supervised and semi-supervised models on these evaluations can be observed in Tables 6 and 7 in the appendix.

**Downstream Supervised Evaluation Results.** On running supervised evaluations and observing the results in Table 1, we find that on an average our models are second only to SkipThought vectors. Also, both our models achieve state of the art results on the CR task. We also observe that on half of the supervised tasks, our unigrams + bigram model is the best model after SkipThought. Our models are weaker on the MSRP task (which consists of the identification of labelled paraphrases) compared to state-of-the-art methods. However, we observe that the models which perform very strongly on this task end up faring very poorly on the other tasks, indicating a lack of generalizability.

On rest of the tasks, our models perform extremely well. The SkipThought model is able to outperform our models on most of the tasks as it is trained to predict the previous and next sentences and a lot of tasks are able to make use of this contextual information missing in our Sent2Vec models. For example, the TREC task is a poor measure of how one predicts the content of the sentence (the question) but a good measure of how the next sentence in the sequence (the answer) is predicted.

**Unsupervised Similarity Evaluation Results.** In Table 2, we see that our Sent2Vec models are state-of-the-art on the majority of tasks when comparing to all the unsupervised models trained on the Toronto corpus, and clearly achieve the best averaged performance. Our Sent2Vec models also on average outperform or are at par with the C-PHRASE model, despite significantly lagging behind on the STS 2014 WordNet and News subtasks. This observation can be attributed to the fact that a big chunk of the data that the C-PHRASE model is trained on comes from English Wikipedia, helping it to perform well on datasets involving definition and news items. Also, C-PHRASE uses data three times the size of the Toronto book corpus. Interestingly, our model outperforms C-PHRASE when trained on Wikipedia, as shown in Table 3, despite the fact that we use no parse tree information.

**Official STS 2017 benchmark.** In the official results of the most recent edition of the STS 2017 benchmark Cer et al. (2017), our model also significantly outperforms C-PHRASE, and in fact delivers the best unsupervised baseline method.

 

Footnote 4: [https://github.com/cipr/2016-03](https://github.com/cipr/2016-03)

**Macro Average.** To summarize our contributions on both supervised and unsupervised tasks, in Table 3 we present the results in terms of the macro average over the averages of both supervised and unsupervised tasks along with the training times of the models5. For unsupervised tasks, averages are taken over both Spearman and Pearson scores. The comparison includes the best performing unsupervised and semi-supervised methods described in Section 3. For models trained on the Toronto books dataset, we report a 3.8 \(\%\) points improvement over the state of the art. Considering all supervised, semi-supervised methods and all datasets compared in Hill et al. (2016a), we report a 2.2 \(\%\) points improvement.

Footnote 5: time taken to train C-PHRASE models is unavailable

We also see a noticeable improvement in accuracy as we use larger datasets like Twitter and Wikipedia. We furthermore see that the Sent2Vec models are faster to train when compared to methods like SkipThought and DictRep, owing to the SGD optimizer allowing a high degree of parallelizability.

We can clearly see Sent2Vec outperforming other unsupervised and even semi-supervised methods. This can be attributed to the superior generalizability of our model across supervised and unsupervised tasks.

**Comparison with Arora et al. (2017).** We also compare our work with Arora et al. (2017) who also use additive compositionality to obtain sentence embeddings. However, in contrast to our

\begin{table}
\begin{tabular}{|l|l|p{29.9pt} p{29.9pt} p{29.9pt} p{29.9pt} p{29.9pt} p{29.9pt}|p{29.9pt}|} \hline Data & Model & MSRP & MR & CR & SUBJ & MPQA & TREC & Average \\ \hline  & SAE & **74.3** / 81.7 & 62.6 & 68.0 & 86.1 & 76.8 & 80.2 & 74.7 \\  & SAE + embs. & 70.6 / 77.9 & 73.2 & 75.3 & 89.8 & 86.2 & 80.4 & 79.3 \\ Unordered Sentences: & SDAE & **76.4** / **83.4** & 67.6 & 74.0 & 89.3 & 81.3 & 77.7 & 78.3 \\  & SDAE + embs. & **73.7** / 80.7 & 74.6 & 78.0 & 90.8 & **86.9** & 78.4 & 80.4 \\
70 million sentences. & ParagraphVec DBOW & 72.9 / 81.1 & 60.2 & 66.9 & 76.3 & 70.7 & 59.4 & 67.7 \\
0.9 Billion Words & PragraphVec DM & 73.6 / **81.9** & 61.5 & 68.6 & 76.4 & 78.1 & 55.8 & 69.0 \\  & Skiggram & 69.3 / 77.2 & 73.6 & 77.3 & 89.2 & 85.0 & 82.2 & 78.5 \\  & C-BOW & 67.6 / 76.1 & 73.6 & 77.3 & 89.1 & 85.0 & 82.2 & 79.1 \\  & Uniform TFIDF & 73.6 / 81.7 & 73.7 & 79.2 & 90.3 & 82.4 & **85.0** & 80.7 \\  & **Sent2vec uni.** & 72.2 / 80.3 & 75.1 & **80.2** & **90.6** & **86.3** & 83.8 & **81.4** \\  & **Sent2vec uni. + bi.** & 72.5 / 80.8 & **75.8** & **80.3** & **91.2** & 85.9 & **86.4** & **82.0** \\ \hline Ordered Sentences: & SkipThought & 73.0 / **82.0** & **76.5** & **80.1** & **93.6** & **87.1** & **92.2** & **83.8** \\ Toronto Books & FastSent & 72.2 / 80.3 & 70.8 & 78.4 & 88.7 & 80.6 & 76.8 & 77.9 \\  & FastSent+AE & 71.2 / 79.1 & 71.8 & 76.7 & 88.8 & 81.5 & 80.4 & 78.4 \\ \hline
2.8 Billion words & C-PHRASE & 72.2 / 79.6 & **75.7** & 78.8 & **91.1** & 86.2 & 78.8 & 80.5 \\ \hline \end{tabular}
\end{table}
Table 1: Comparison of the performance of different models on different **supervised evaluation** tasks. An underline indicates the best performance for the dataset. Top 3 performances in each data category are shown in bold. The average is calculated as the average of accuracy for each category (For MSRP, we take the accuracy.)

\begin{table}
\begin{tabular}{|l|c c c c c c|c|} \hline  & \multicolumn{6}{c|}{STS 2014} & SICK 2014 \\ Model & News & Forum & WordNet & Twitter & Images & Headlines & Test + Train & Average \\ \hline SAE & .17/.16 & .12/.12 & .30/.23 & .28/.22 & .49/.46 & .13/.11 & .32/.31 & .26/.23 \\ SAE + embs. & .52/.54 & .22/.23 & .60/.55 & .60/.60 & .64/.64 & .41/.41 & .47/.49 & .50/.49 \\ SDAE & .07/.01 & .11/.13 & .33/.24 & .44/.42 & .43/.38 & .36/.36 & .46/.46 & .31/.29 \\ SDAE + embs. & .51/.54 & .29/.29 & .56/.50 & .57/.58 & .59/.59 & .43/.44 & .46/.46 & .49/.49 \\ ParagraphVec DBOW & .31/.34 & .32/.32 & .53/.50 & .43/.46 & .46/.44 & .39/.41 & .42/.46 & .41/.42 \\ ParagraphVec DM & .42/.46 & .33/.34 & .51/.48 & .54/.57 & .32/.30 & .46/.47 & .44/.40 & .43/.43 \\ Skipgram & .56/.59 & .42/.42 & .73/.70 & **.71**/.45 & .65/.57 & .55/.58 & .60/.69 & .60/.63 \\ C-BOW & .57/.61 & **.43**/.44 & .72/.69 & **.71**/.75 & .71/.73 & .55/.59 & .60/.69 & .60/.65 \\ Unigram TF-IDF & .48/.48 & .40/.38 & .60/.59 & .63/.65 & .72/.74 & .49/.49 & .52/.58 & .55/.56 \\
**Sent2vec uni.** & **.62**/**.67** & **.49**/**.49** & **.75**/**.72** & **.70**/**.75** & **.78**/**.82** & **.61**/**.63** & **.61**/**.70** & **.65**/**.68** \\
* & **.62**/**.67*
* & **.51**/.51*
* & .71/.68 & .70/**.75*
* & **.75**/**.79*
* & .59/.62 & **.62**/**.70*
* & **.65**/**.67*
* \\ \hline SkyThought & .44/.45 & .14/.15 & .39/.34 & .42/.43 & .55/.60 & .43/.44 & .57/.60 & .42/.43 \\ FastSent & .58/.59 & .41/.36 & **.74**/**.70*
* & .63/.66 & .74/.78 & .57/.59 & .61/**.72*
* & .61/.63 \\ FastSent+AE & .56/.59 & .41/.40 & .69/.64 & .70/.74 & .63/.65 & .58/.60 & .60/.65 & .60/.61 \\ Siamese C-BOW4 [FOOTNOTE:4]Footnote 4: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark: *: footnotemark:
* footnotemark: *: footnotemark: *: footnotemark:
* footnotemark: *: footnotemark:
* footnotemark: *: footnotemark:
* footnotemark: *: footnotemark:
* footnotemark: *: footnotemark
 

model, they use fixed, pre-trained word embeddings to build a weighted average of these embeddings using unigram probabilities. While we couldn't find pre-trained state of the art word embeddings trained on the Toronto books corpus, we evaluated their method using GloVe embeddings obtained from the larger Common Crawl Corpus6, which is 42 times larger than our twitter corpus, greatly favoring their method over ours.

Footnote 6: [http://www.cs.toronto.edu/~mbweb/](http://www.cs.toronto.edu/~mbweb/)

In Table 4, we report an experimental comparison to their model on unsupervised tasks. In the table, the suffix W indicates that their downweighting scheme has been used, while the suffix R indicates the removal of the first principal component. They report values of \(a\in[10^{-4},10^{-3}]\) as giving the best results and used \(a=10^{-3}\) for all their experiments. We observe that our results are competitive with the embeddings of Arora et al. (2017) for purely unsupervised methods. It is important to note that the scores obtained from supervised task-specific PSL embeddings trained for the purpose of semantic similarity outperform our method on both SICK and average STS 2014, which is expected as our model is trained purely unsupervised.

In order to facilitate a more detailed comparison, we also evaluated the unsupervised Glove + WR embeddings on downstream supervised tasks and compared them to our twitter models. To use Arora et al. (2017)'s method in a supervised setup, we precomputed and stored the common discourse vector \(c_{0}\) using 2 million random Wikipedia sentences. On an average, our models outperform their unsupervised models by a significant margin, this despite the fact that they used GloVe embeddings trained on larger corpora than ours (42 times larger). Our models also outperform their semi-supervised PSL + WR model. This indicates our model learns a more precise weighing scheme than the static one proposed by Arora et al. (2017).

**The effect of datasets and n-grams.** Despite being trained on three very different datasets, all of our models generalize well to sometimes very

Figure 1: _Left figure: the profile of the word vector \(L_{2}\)-norm as a function of \(\log(f_{w})\) for each vocabulary word \(w\), as learnt by our unique model trained on Toronto books. Right figure: down-weighting scheme proposed by Arora et al. (2017): \(weight(w)=\frac{a}{a+f_{w}}\)._



specific domains. Models trained on Toronto Corpus are the state-of-the-art on the STS 2014 images dataset even beating the supervised Caption-Rep model trained on images. We also see that addition of bigrams to our models doesn't help much when it comes to unsupervised evaluations but gives a significant boost-up in accuracy on supervised tasks. We attribute this phenomenon to the ability of bigrams models to capture some non-compositional features missed by unigrams models. Having a single representation for _"not good"_ or _"very bad"_ can boost the supervised model's ability to infer relevant features for the corresponding classifier. For semantic similarity tasks however, the relative uniqueness of bigrams results in pushing sentence representations further apart, which can explain the average drop of scores for bigrams models on those tasks.

* by learning how to generate and compose word vectors
- has to learn both the direction of the word embeddings as well as their norm. Considering the norms of the used word vectors as by our averaging over the sentence, we observe an interesting distribution of the "importance" of each word. In Figure 1 we show the profile of the \(L_{2}\)-norm as a function of \(\log(f_{w})\) for each \(w\in\mathcal{V}\), and compare it to the static down-weighting mechanism of Arora et al. (2017). We can observe that our model is learning to down-weight frequent tokens by itself. It is also down-weighting rare tokens and the \(norm\) profile seems to roughly follow Luhn's hypothesis Luhn (1958), a well known information retrieval paradigm, stating that mid-rank terms are the most significant to discriminate content.

## 6 Conclusion

In this paper, we introduce a novel, computationally efficient, unsupervised, C-BOW-inspired method to train and infer sentence embeddings. On supervised evaluations, our method, on an average, achieves better performance than all other unsupervised competitors with the exception of SkipThought. However, SkipThought vectors show a very poor performance on sentence similarity tasks while our model is state-of-the-art for these evaluations on average. Also, our model is generalizable, extremely fast to train, simple to understand and easily interpretable, showing the relevance of simple and well-grounded representation models in contrast to the models using deep architectures. Future work could focus on augmenting the model to exploit data with ordered sentences. Furthermore, we would like to investigate the model's ability to use pre-trained embeddings for downstream transfer learning tasks.

#### Acknowledgments

We are indebted to Piotr Bojanowski and Armand Joulin for helpful discussions. This project was supported by a Google Faculty Research Award.

## References

* Agirre et al. (2014) Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Rada Mihalcea, German Rigau, and Janvee Wiebe. 2014. Semeval-2014 task 10: Multilingual semantic textual similarity. In _Proceedings of the 8th international workshop on semantic evaluation (SemEval 2014)_. Association for Computational Linguistics Dublin, Ireland, pages 81-91.
* Arora et al. (2016) Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. 2016. A Latent Variable Model Approach to PMI-based Word Embeddings. In _Transactions of the Association for Computational Linguistics_. pages 385-399.
* Arora et al. (2017) Sanjeev Arora, Yingyu Liang, and Tengyu Ma. 2017. A simple but tough-to-beat baseline for sentence embeddings. In _International Conference on Learning Representations (ICLR)_.
* Bird et al. (2009) Steven Bird, Ewan Klein, and Edward Lopez. 2009. _Natural language processing with Python: analyzing text with the natural language toolkit_. " O'Reilly Media, Inc.".
* Bojanowski et al. (2017) Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching Word Vectors with Subword Information. _Transactions of the Association for Computational Linguistics_ 5:135-146.
* Proceedings of the 11th International Workshop on Semantic Evaluations_. Association for Computational Linguistics, Vancouver, Canada, pages 1-14.
* Conneau et al. (2017) Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. 2017. Supervised learning of universal sentence representations from natural language inference data. _arXiv preprint arXiv:1705.02364_ .
* Dolan et al. (2004) Bill Dolan, Chris Quirk, and Chris Brockett. 2004. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In _Proceedings of the 20th international conference on 

Computational Linguistics_. Association for Computational Linguistics, page 350.
* Ganitkevitch et al. (2013) Juri Ganitkevitch, Benjamin Van Durme, and Chris Callison-Burch. 2013. Ppdb: The paraphrase database. In _HLT-NAACL_. pages 758-764.
* Goldberg and Levy (2014) Yoav Goldberg and Omer Levy. 2014. word2vec Explained: deriving Mikolov et al.'s negative-sampling word-embedding method. _arXiv_ .
* Hill et al. (2016a) Felix Hill, Kyunghyun Cho, and Anna Korhonen. 2016a. Learning Distributed Representations of Sentences from Unlabelled Data. In _Proceedings of NAACL-HLT_.
* Hill et al. (2016b) Felix Hill, KyungHyun Cho, Anna Korhonen, and Yoshua Bengio. 2016b. Learning to understand phrases by embedding the dictionary. _TACL_ 4:17-30.
* Hu and Liu (2004) Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In _Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining_. ACM, pages 168-177.
* Huang and Anandkumar (2016) Furong Huang and Animashree Anandkumar. 2016. Unsupervised Learning of Word-Sequence Representations from Scratch via Convolutional Tensor Decomposition. _arXiv_ .
* Joulin et al. (2017) Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. 2017. Bag of Tricks for Efficient Text Classification. In _Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics, Short Papers_. Valencia, Spain, pages 427-431.
* Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics_. Berlin, Germany, pages 941-951.
* Advances in Neural Information Processing Systems 28_. pages 3294-3302.
* Proceedings of the 31st International Conference on Machine Learning_. volume 14, pages 1188-1196.
* Lev et al. (2015) Guy Lev, Benjamin Klein, and Lior Wolf. 2015. In defense of word embedding for generic text representation. In _International Conference on Applications of Natural Language to Information Systems_. Springer, pages 35-50.
* Levy et al. (2015) Omer Levy, Yoav Goldberg, and Ido Dagan. 2015. Improving distributional similarity with lessons learned from word embeddings. _Transactions of the Association for Computational Linguistics_ 3:211-225.
* Luhn (1958) Hans Peter Luhn. 1958. The automatic creation of literature abstracts. _IBM Journal of research and development_ 2(2):159-165.
* Manning et al. (2014) Christopher D Manning, Mihai Surdeanu, John Bauer, Jenny Rose Finkel, Steven Bethard, and David McClosky. 2014. The stanford corenlp natural language processing toolkit. In _ACL (System Demonstrations)_. pages 55-60.
* Marelli et al. (2014) Marco Marelli, Stefano Menini, Marco Baroni, Luisa Bentivogli, Raffaella Bernardi, and Roberto Zamparelli. 2014. A sick cure for the evaluation of compositional distributional semantic models. In _LREC_. pages 216-223.
* Mikolov et al. (2013a) Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013a. Efficient estimation of word representations in vector space. _arXiv preprint arXiv:1301.3781_ .
* Advances in Neural Information Processing Systems 26_. pages 3111-3119.
* Pang and Lee (2004) Bo Pang and Lillian Lee. 2004. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In _Proceedings of the 42nd annual meeting on Association for Computational Linguistics_. Association for Computational Linguistics, page 271.
* Pang and Lee (2005) Bo Pang and Lillian Lee. 2005. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In _Proceedings of the 43rd annual meeting on association for computational linguistics_. Association for Computational Linguistics, pages 115-124.
* Pearson (1895) Karl Pearson. 1895. Note on regression and inheritance in the case of two parents. _Proceedings of the Royal Society of London_ 58:240-242.
* Pennington et al. (2014) Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In _EMNLP_. volume 14, pages 1532-1543.
* Pham et al. (2015) NT Pham, G Kruszewski, A Lazaridou, and M Baroni. 2015. Jointly optimizing word representations for lexical and sentential tasks with the c-phrase model. _ACL/IJCNLP_ .
* Rockafellar (1976) R Tyrrell Rockafellar. 1976. Monotone operators and the proximal point algorithm. _SIAM journal on control and optimization_ 14(5):877-898.
* Spearman (1904) Charles Spearman. 1904. The proof and measurement of association between two things. _The American journal of psychology_ 15(1):72-101 

* Voorhees (2002) Ellen M Voorhees. 2002. Overview of the trec 2001 question answering track. In _NIST special publication_. pages 42-51.
* Weinberger et al. (2009) Kilian Weinberger, Anirban Dasgupta, John Langford, Alex Smola, and Josh Attenberg. 2009. Feature hashing for large scale multitask learning. In _Proceedings of the 26th Annual International Conference on Machine Learning_. ACM, pages 1113-1120.
* Wiebe et al. (2005) Janyce Wiebe, Theresa Wilson, and Claire Cardie. 2005. Annotating expressions of opinions and emotions in language. _Language resources and evaluation_ 39(2):165-210.
* Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing_. Association for Computational Linguistics, Stroudsburg, PA, USA, pages 1504-1515.
* Wieting et al. (2016b) John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. 2016b. Towards universal paraphrastic sentence embeddings. In _International Conference on Learning Representations (ICLR)_.
* Transactions of the Association for Computational Linguistics_.
 



## Appendix A Parameters for training models

### L1 regularization of models

Optionally, our model can be additionally improved by adding an L1 regularizer term in the objective function, leading to slightly better generalization performance. Additionally, encouraging sparsity in the embedding vectors is beneficial for memory reasons, allowing higher embedding dimensions \(h\).

We propose to apply L1 regularization individually to each word (and n-gram) vector (both source and target vectors). Formally, the training objective function (3) then becomes

\[\min_{\mathbf{U},\mathbf{V}}\sum_{S\in\mathcal{C}}\sum_{w_{t}\in S}q_{p}( w_{t})\bigg{(}\Big{(}\ell\big{(}\mathbf{u}^{\top}_{w_{t}}\mathbf{v}_{S\setminus\{w_{ t}\}}\big{)}+\tau(\|\mathbf{u}_{w_{t}}\|_{1}+\|\mathbf{v}_{S\setminus\{w_{t}\}}\|_{1}) \Big{)}+ \tag{4}\] \[|N_{w_{t}}|\sum_{w^{\prime}\in\mathcal{V}}~{}q_{n}(w^{\prime}) \Big{(}\ell\big{(}-\mathbf{u}^{\top}_{w^{\prime}}\mathbf{v}_{S\setminus\{w_{t}\}}\big{)} +\tau(\|\mathbf{u}_{w^{\prime}}\|_{1})\Big{)}\bigg{)}\]

where \(\tau\) is the regularization parameter.

Now, in order to minimize a function of the form \(f(\textbf{z})+g(\textbf{z})\) where \(g(\textbf{z})\) is not differentiable over the domain, we can use the basic proximal-gradient scheme. In this iterative method, after doing a gradient descent step on \(f(\textbf{z})\) with learning rate \(\alpha\), we update z as

\[\textbf{z}_{n+1}=prox_{\alpha,g}(\textbf{z}_{n+\frac{1}{2}}) \tag{5}\]

where \(prox_{\alpha,g}(\textbf{x})=\arg\min_{\textbf{y}}\{g(\textbf{y})+\frac{1}{2 \alpha}\|\textbf{y}-\textbf{x}\|_{2}^{2}\}\) is called the proximal function (Rockafellar, 1976) of \(g\) with \(\alpha\) being the proximal parameter and \(\textbf{z}_{n+\frac{1}{2}}\) is the value of z after a gradient (or SGD) step on \(\textbf{z}_{n}\).

In our case, \(g(\textbf{z})=\|\textbf{z}\|_{1}\) and the corresponding proximal operator is given by

\[prox_{\alpha,g}(\textbf{x})=sign(\textbf{x})\odot\max(|\textbf{ x}_{n}|-\alpha,0) \tag{6}\]

where \(\odot\) corresponds to element-wise product.

Similar to the proximal-gradient scheme, in our case we can optionally use the thresholding operator on the updated word and n-gram vectors after an SGD step. The soft thresholding parameter used for this update is \(\frac{\tau-lr^{\prime}}{|R(S\setminus\{w_{t}\})|}\) and \(\tau\cdot lr^{\prime}\) for the source and target vectors respectively where \(lr^{\prime}\) is the current learning rate, \(\tau\) is the \(L1\) regularization parameter and \(S\) is the sentence on which SGD is being run.

We observe that \(L1\) regularization using the proximal step gives our models a small boost in performance. Also, applying the thresholding operator takes only \(|R(S\setminus\{w_{t}\})|\cdot h\) floating point operations for the updating the word vectors corresponding to the sentence and \((|N|+1)\cdot h\) for updating the target



as well as the negative word vectors, where \(|N|\) is the number of negatives sampled and \(h\) is the embedding dimension. Thus, performing \(L1\) regularization using soft-thresholding operator comes with a small computational overhead.

We set \(\tau\) to be 0.0005 for both the Wikipedia and the Toronto Book Corpus unigrams + bigrams models.