Title: NO TRAINING REQUIRED: EXPLORING RANDOM EN-CODERS FOR SENTENCE CLASSIFICATION

Abstract: We explore various methods for computing sentence representations from pretrained word embeddings without any training, i.e., using nothing but random parameterizations. Our aim is to put sentence embeddings on more solid footing by 1) looking at how much modern sentence embeddings gain over random methods-as it turns out, surprisingly little; and by 2) providing the field with more appropriate baselines going forward-which are, as it turns out, quite strong. We also make important observations about proper experimental protocol for sentence classification evaluation, together with recommendations for future research.

1. INTRODUCTION:

A sentence embedding is a vector representation of the meaning of a sentence, often created by a transformation of word embeddings through a composition function. This function is often nonlinear and recurrent in nature, and usually the word embeddings are initialized with pre-trained embeddings. Well-known examples of sentence embeddings include SkipThought (Kiros et al., 2015) and InferSent (Conneau et al., 2017) . The purpose of sentence embeddings is to have the meaning of a sentence encoded into a compact representation where it is readily available for downstream applications. For instance it could provide features for training a classifier or a distant metric could be applied to two representations to compute the semantic similarity of their corresponding sentences. Sentence embeddings can be trained with either an unsupervised or supervised objective, and they are often evaluated using transfer tasks, where a ahallow classifier is trained on top of the learned sentence encoder (which is kept fixed). There has been a lot of recent interest in trying to understand better what these sentence embeddings learn (Adi et al., 2016; Linzen et al., 2016; Conneau et al., 2018; Zhu et al., 2018) .

The natural language processing community does not yet have a clear grasp on the relationship between word and sentence embeddings: it is unclear how much trained sentence-encoding architectures improve over the raw word embeddings, and what aspect of such architectures is responsible for any improvement. Indeed, state-of-the-art word embeddings on their own perform quite well with simple pooling mechanisms, as reported by Wieting et al. (2015) ; Arora et al. (2017) and Shen et al. (2018) . Given the tremendous pace of research on sentence representations, it is important to establish solid baselines for others to build on. It has been observed that bidirectional LSTMs with max-pooling perform surprisingly well even without any training whatsoever (Conneau et al., 2017; 2018) , leading to claims that such architectures "encode priors that are intrinsically good for sentence representations" (Conneau et al., 2018) , similar to convolutional networks for images (Ulyanov et al., 2017) . Inspired by these observations, we propose to examine the following question: given a set of word embeddings, how can we maximize classification accuracy on the transfer tasks without any training, i.e. without updating any parameters except for those in the transfer task-specific linear classifier trained on top of the representation. SkipThought famously took around one month to train, while InferSent requires large amounts of annotated data-we examine to what extent we can match the performance of these systems by exploring different ways for combining nothing but the pre-trained word embeddings. 1 We go down a well-paved avenue of exploration in the machine learning research community, and exploit an insight originally due to Cover (1965) : "A complex pattern-classification problem, cast in a high-dimensional space nonlinearly, is more likely to be linearly separable than in a lowdimensional space, provided that the space is not densely populated." That is, we examine three types of models for obtaining randomly computed sentence representations from pre-trained word embeddings: bag of random embedding projections, randomly initialized recurrent networks and echo state networks.

Our goal is not to obtain a new state of the art, but to put current state of the art methods on more solid footing by 1) looking at how much they gain compared to random methods; and 2) providing the field with more solid baselines going forward. We make several important observations about proper experimental protocol for sentence classification evaluation; and finish with a list of takeaway recommendations.

2. RELATED WORK:

Sentence embeddings are receiving a lot of attention. Many approaches have been proposed, varying in their use of both training data and training objectives. Methods include autoencoders (Socher et al., 2011; Hill et al., 2016) and other learning frameworks using raw text (Le & Mikolov, 2014; Pham et al., 2015; Jernite et al., 2017; Pagliardini et al., 2017) , a collection of books (Kiros et al., 2015) , labelled entailment corpora (Conneau et al., 2017) , image-caption data (Kiela et al., 2017) , raw text labelled with discourse relations (Nie et al., 2017) , or parallel corpora (Wieting & Gimpel, 2017) . Multi-task combinations of these approaches (Subramanian et al., 2018; Cer et al., 2018) have also been proposed. Progress has been swift, but lately we have started to observe some troubling trends in how research is conducted, in particular with respect to properly identifying the sources of empirical gains (see also Lipton & Steinhardt (2018) ).

There was an issue with non-standard evaluation methods, for which SentEval (Conneau & Kiela, 2018) and then GLUE (Wang et al., 2018) were created. One often overlooked aspect of sentence representation evaluation, for example, is that logistic regression classifiers and multi-layer perceptrons (MLP) are not the same thing. To single out an example, the recent paper by Shen et al. (2018) , which aims to "give baselines more love", does not compare against LSTMs with the exact same pre-processing and range of hyperparameters, in effect ignoring its own baselines, and uses a custom designed MLP, sweeping over many hyperparameters unique to their setup with different embedding dimensionsionalities.

Even when comparing InferSent and SkipThought, it is not entirely clear where differences come from: the better pre-trained word embeddings; the different architecture; the different objective; the layer normalization-e.g. what would happen if we trained a bidirectional LSTM with max-pooling using GloVe embeddings (i.e., InferSent's architecture) with a SkipThought objective or added layer normalization to InferSent? The nowadays surprisingly poor performance of the models in Hill et al. (2016) can at least partly be explained because 1) they use poorer (older) word embeddings; and 2) FastSent sentence representations are of the same dimensionality as the input word embeddings, while they are compared in the same table to much higher-dimensional representations. Obviously, a logistic regression classifier on top of a higher-dimensional input has more parameters too, giving such models an unfair advantage. In part, doing such in-full comparisons is simply not feasible, and often not appreciated by reviewers anyway, so we can hardly blame the authors of these papers. That said, we wholeheartedly agree that baselines need more love, befitting a good tradition in NLP (Wang & Manning, 2012) : with this work we hope to establish even stronger baselines for future work and try to estimate how much performance is being added by training sentence embeddings on top of pre-trained word embeddings.

There has been a lot of recent interest in trying to understand what linguistic knowledge is encoded in word and sentence embeddings, for instance in machine translation (Belinkov et al., 2017; Sennrich, 2016; Dalvi et al., 2017) , with a focus on evaluating RNNs or LSTMs (Linzen et al., 2016; Hupkes et al., 2018) or even sequence-to-sequence models (Lake & Baroni, 2018) . Various probing tasks (Ettinger et al., 2016; Adi et al., 2016; Conneau et al., 2018) were designed to try to understand what you can "cram into a vector" for representing sentence meaning. We show that a lot of information may be crammed into vectors using randomly parameterized combinations of pre-trained word embeddings: that is, most of the power in modern NLP systems is derived from having high-quality word embeddings, rather than from having better encoders.

The idea of using random weights is almost as old as neural networks, ultimately going back to ideas in multi-layer perceptrons with fixed randomly initialized first layers (Gamba et al., 1961; Borsellino & Gamba, 1961; Baum, 1988) , or what Minsky and Papert call Gamba perceptrons (Minsky & Papert, 2017) . The idea of fixing a subset of the network was made more explicit in (Schmidt et al., 1992; Pao et al., 1994) , which some people have started to call extreme learning machines (Huang et al., 2006). 2 Random features in machine learning are often used for low-rank approximation (Vempala, 2005) , as per the Johnson-Lindenstrauss lemma; exploiting the useful properties of random matrices (Mehta, 2004) . Random "kitchen sink" features have become a seminal approach in the machine learning literature (Rahimi & Recht, 2008; 2009) . Similar ideas underlie e.g. double-stochastic gradient methods (Dai et al., 2014) . In fact, it is well-known that random weights do well, as for example shown in computer vision with respect to convnets (Jarrett et al., 2009; Saxe et al., 2011) . Similarly, the importance of random initializations has been examined in depth (Sutskever et al., 2013) . In our case, we use random projections for higher-rank feature expansion of low-rank dense pre-trained word embeddings, exploiting Cover's theorem (Cover, 1965) . An encoder like this does not require any training, unlike other sentence encoders such as SkipThought and InferSent. Comparing those methods to our random sentence encoders provides valuable insight into how much of a performance improvement we have actually gained from training for a long time (in the case of SkipThought) or training on expensive annotated data (in the case of InferSent which is trained on the Stanford Natural Language Inference (SNLI) Corpus Bowman et al. (2015) , a large textual entailment dataset.).

The same idea of using fixed random computations underlies reservoir computing (Lukoševičius & Jaeger, 2009) and echo-state networks (Jaeger, 2001) . In reservoir computing, inputs are fed into a fixed, random, dynamical system called a reservoir that maps the input into a high dimensional space. Then a trainable linear transformation of this high dimensional space is learned to predict some output signal. Echo-state networks are a specific type of reservoir computing and are further described in Section 3.1.3.

Reservoir computing has been used previously in Natural Language Processing (NLP), though it is not common in the literature. (Frank, 2006a; b) investigated whether ESNs are capable of displaying the systematicity in natural language. (Tong et al., 2007; Hinaut & Dominey, 2012) investigated the ability of ESNs for learning grammatical structure. Lastly, Daubigney et al. (2013) used ESNs to find efficient teaching strategies.

3. APPROACH:

In this paper, we explore three architectures that produce sentence embeddings from pre-trained word embeddings, without requiring any training of the encoder itself. These sentence embeddings are then used as features for a collection of downstream tasks. The downstream tasks are all trained with a logistic regression classifier using the default settings of the SentEval framework (Conneau & Kiela, 2018) . The parameters of this classifier are the only ones that are updated during training (see Section 3.2 below).

3.1. RANDOM SENTENCE ENCODERS:

We are concerned with obtaining a good sentence representation h that is computed using some function f parameterized by θ over pre-trained input word embeddings e ∈ L, i.e. h = f θ (e 1 , . . . , e n ) where e i is the embedding for the i-th word in a sentence of length n. Typically, sentence encoders learn θ, after which it is kept fixed for the transfer tasks. InferSent represents a sentence as f = max(BiLSTM(e 1 , . . . , e n )) and optimizes the parameters using a supervised cross-entropy objective for predicting one of three labels from a combination of two sentence representations: entailment, neutral or contradictive. SkipThought represents a sentence as f = GRU n (e 1 , . . . , e n ), with the objective of being able to decode the previous and next utterance using negative log-likelihood from the final (i.e., n-th) hidden state.

InferSent requires large amounts of expensive annotation, while SkipThought takes a very long time to train. Here, we examine different ways of parameterizing f for representing the sentence meaning, without any training of θ. This means we do not require any labels for supervised training, nor do we need to train the sentence encoder for a long time with an unsupervised objective. We experiment with three methods for computing h: Bag of random embedding projections, Random LSTMs, and Echo State Networks. In this section, we describe the methods in more detail. In the following sections, we show that our methods lead to surprisingly good results, shedding new light on sentence representations, and establishing strong baselines for future work.

3.1.1. BAG OF RANDOM EMBEDDING PROJECTIONS (BOREP):

The first family of architectures we explore consists of simply applying a single random projection in a standard bag-of-words (or more accurately, bag-of-embeddings) model. We randomly initialize a matrix W ∈ R D×d , where D is the dimension of the projection and d is the dimension of our input word embedding. The values for the matrix are sampled uniformly from [-

1 √ d , 1 √ d ],

which is a standard initialization heuristic used in neural networks (Glorot & Bengio, 2010) . The sentence representation is then obtained as follows:

h = f pool (W e i ),

where f pool is some pooling function, e.g. f pool (x) = (x), f pool (x) = max(x) (max pooling) or f pool (x) = |x| -1 (x) (mean pooling). Optionally, we impose a nonlinearity max(0, h). We experimented with imposing positional encoding for the word embeddings, but did not find this to help.

3.1.2. RANDOM LSTMS:

Following InferSent, we employ bidirectional LSTMs, but in our case without any training. Conneau et al. (2017) reported good performance for the random LSTM model on the transfer tasks. The LSTM weight matrices and their corresponding biases are initialized uniformly at random from

[-1 √ d , 1 √ d ],

where d is the hidden size of the LSTM. In other words, the architecture here is the same as that of InferSent modulo the type of pooling used: h = f pool (BiLSTM(e 1 , . . . , e n )).

3.1.3. ECHO STATE NETWORKS:

Echo State Networks (ESNs) (Jaeger, 2001) were primarily designed for sequence prediction problems, where given a sequence X, we predict a label y for each step in the sequence. The goal is to minimize the error between the predicted ŷ and the target y at each timestep. Formally, an ESN is described using the following update equations:

hi = f pool (W i e i + W h h i-1 + b i ) h i = (1 -α)h i-1 + α hi ,

where W i , W h , and b i are randomly initialized and are not updated during training. The parameter α ∈ (0, 1] governs the extent to which the previous state representation is allowed to leak into the current state. The only learned parameters in an ESN are the final weight matrix, W o and corresponding bias b o , which are together used to compute a prediction ŷi for the i th label y i :

ŷi = W o [e i ; h i ] + b o .

We diverge from the typical per-timestep ESN setting, and instead use the ESN to produce a random representation of a sentence. We use a bidirectional ESN, where the reservoir states, h i , are concatenated for both directions. We then pool over these states to obtain the sentence representation: The property of echo state networks that sets them apart from randomly initialized classical recurrent networks, and allows for better performance, is the echo state property. The echo state property (Jaeger, 2001) claims that the state of the reservoir should be determined uniquely from the input history, and the effects of a given state asymptotically diminish in favor of more recent states.

In practice, one can satisfy the echo state property in most cases by ensuring that the spectral radius of W h is less than 1 (Lukoševičius & Jaeger, 2009 ). The spectral radius, i.e., the maximal absolute eigenvalue of W h , is one of many hyperparameters to be tuned when using ESNs. Others include the activation function, the amount of leaking between states, the sparsity of W h , whether to concatenate the inputs to the reservoir states, how to sample the values for W i and other factors. Lukoševičius & Jaeger (2009) gives a good overview of what hyperparameters are most critical when designing ESNs.

3.2. EVALUATION:

In our experiments, we evaluate on a standard sentence representation benchmark using SentEval (Conneau & Kiela, 2018) . SentEval allows for evaluation on both downstream NLP datasets as well as probing tasks, which measure how accurately a representation can predict linguistic information about a given sentence. The set of downstream tasks we use for evaluation comprises sentiment analysis (MR, SST), question-type (TREC), product reviews (CR), subjectivity (SUBJ), opinion polarity (MPQA), paraphrasing (MRPC), entailment (SICK-E, SNLI) and semantic relatedness (SICK-R, STSB). The probing tasks consist of those in Conneau et al. (2018) . We use the default SentEval settings (see Appendix A).

4. RESULTS:

We compare primarily to two well-studied sentence embedding models, InferSent (Conneau et al., 2017) and SkipThought (Kiros et al., 2015) with layer normalization (Ba et al., 2016) . We point out that there are recently introduced multi-task sentence encoders that improve performance further, but these either do not use pre-trained word embeddings (GenSen (Subramanian et al., 2018) ), or don't use SentEval (Universal Sentence Encoders (Cer et al., 2018) ). Since both architectures are inspired by InferSent and SkipThought, and combine their respective supervised and unsupervised objectives, we limit our comparison to the original models.

We compute the average accuracy/Pearson's r, along with the standard deviation, over 5 different seeds for the random methods, and tune on validation for each task. See Appendix A for a discussion of the used hyperparameters.

Table 1 reports the results on the selected SentEval benchmark tasks, where all models have 4096 dimensions (with the exception of SkipThought, which has 4800). We compare to three different InferSent models: the results from the paper, which had non-standard pooling over padding symbols (InferSent-1); the results from the InferSent GitHub,3 with fixed padding, using FastText instead of GloVe (InferSent-2); the results from an InferSent model we trained ourselves,4 with fixed padding, using GloVe embeddings (InferSent-3) (see Appendix C for a more detailed discussion of padding and pooling).5 Note that the comparison to layer-normalized SkipThought is not entirely fair, because it uses different (and older) word embeddings, but a higher dimensionality. We hypothesize that SkipThought might do a lot better if it had been trained with better pre-trained word embeddings.

First of all, we observe that all random sentence encoders generally improve over bag-ofembeddings. This is not entirely surprising, but it is important to note that the proper baseline for an n-dimensional sentence encoder is an n-dimensional BOREP representation, not an (m < n)dimensional BOE representation. BOREP does markedly better than BOE, constituting a much stronger baseline (and requiring no additional computation besides a simple random projection).

When comparing the random sentence encoders, we observe that ESNs outperform BOREP and RandLSTM on all tasks. It is unclear whether (randomly initialized) LSTMs exhibit the echo state property, but the main reason for the improvement is likely that in our experiments ESNs had more hyperparameters available for tuning.

When comparing to InferSent, in which case we should look at InferSent-3 in particular (as it has fixed padding and also uses GloVe embeddings), we do see a clear difference on some of the tasks, showing that training does in fact help. The performance gains over the random methods, however, are not as big as we might have hoped, given that InferSent requires annotated data and takes time to train, while the random sentence encoders can be applied immediately. For SkipThought, we discern a similar pattern, where the gain over random methods (which do have better word embeddings) is even smaller. While SkipThought took a very long time to train, in the case of SICK-E you would actually even be better off simply using BOREP, while ESN outperforms SkipThought on five of the 10 tasks.

Note that in these experiments we do model selection over per-task validation set performance, but Appendix B shows that the method is robust, as we could also have used the best-overall model on validation and obtained similar results.

Keep in mind that the point of these results is not that random methods are better than these other encoders, but rather that we can get very close and sometimes even outperform those methods without any training at all, from just using the pre-trained word embeddings.

4.1. TAKING COVER TO THE MAX:

If we take Cover's theorem to the limit, we can project to an even higher-dimensional representation as long as we can still easily fit things onto a modern GPU: hence, we project to 4096 × 6 (24576) dimensions instead of the 4096 dimensions we used in Table 1 . In order to make for a fair comparison, we can also randomly project InferSent and SkipThought representations to the same dimensionality and examine performance.

Table 2 shows the results. Interestingly, the gap seems to get smaller, and the projection in fact appears to be detrimental to InferSent and SkipThought performance. The numbers reported in the table are competitive with (older) much more sophisticated trained methods. Simply maximizing the number of dimensions, however, might lead to overfitting, so we also analyze how performance changes as a function of the dimensionality of the sentence embeddings: we sample random models for a range of dimensions, {512, 1024, 2048, 4096, 8192, 12288, 24576}, and train models for BOREP, random LSTMs, and ESNs. Performance of these models is shown in Figure 1 .

As suggested by Cover's theorem, as well as earlier findings in the sentence embedding literature (see e.g. Fig. 5 of Conneau et al. ( 2017)), we observe that higher dimensionality in most cases leads to better performance. In some cases it looks like we would have benefited from having even higher dimensionality (e.g. SUBJ, TREC and SST2), while in other cases we can see that the model probably starts to overfit (STSB, SICK-E for BOREP). In general, the trend is up, meaning that a higher-dimensional embeddings leads to better performance.

5. ANALYSIS:

We analyze random sentence embeddings by examining how these embeddings perform on the probing tasks introduced by Conneau et al. (2018) , in order to gauge what properties of sentences they are able to recover. These probing tasks were introduced in order to provide a framework for ascertaining the linguistic properties of sentence embeddings, comprising three types of information: surface, syntactic and semantic information. Table 3 : Performance on a set of probing tasks defined in (Conneau et al., 2018) . All random architecture models are 4096 dimensions and were selected by tuning over validation performance on the classification tasks.

There are two surface information tasks: predicting the correct length bin from 6 equal-width bins sorted by sentence length (Length) and predicting which word is present in the given sentence from a set of 1000 mid-frequency words (Word Content, WC). Syntactic information comprises 3 tasks: predicting whether a sentence has been perturbed by switching two adjacent words (BShift); the depth of the constituent parse tree of the sentence (TreeDepth); and the topmost constituent sequence of the constituent parse in a 20-way classification problem (TopConst). Finally, there are five semantic information tasks: predicting the tense of the main-clause verb (Tense); the number of the subject of the main clause (SubjNum); the number of the direct object of the main clause (ObjNum); whether a sentence has been modified by replacing a noun or verb with another in a way that the newly formed bigrams have similar frequencies to those they replaced (Semantic Odd Man Out, SOMO); and whether the order of two coordinate clauses has been switched (CoordInv).

Table 3 shows the performance of the random sentence encoders (using the best-overall model tuned on the classification validation sets of the SentEval tasks) on these probing tasks along with bag-ofembeddings (BOE), SkipThought-LN, and InferSent. From the table, we see that ESNs and RandL-STMs outperform BOE and BOREP on most of the tasks, especially those that require knowledge of the order of the words. This indicates that these models, even though initialized randomly, are capturing order, as one would expect. We also see that ESNs and InferSent are fairly close on many of the tasks, with Skipthought-LN generally outperforming both.

It seems that random models do best when the tasks largely require picking up on certain words. We can see which tasks these are by looking at how well BOREP does compared to the recurrent models (WC, Tense, SubjNum, ObjNum are good candidates for this type of task). In these, random models are all very competitive to the trained encoders. If one looks at the tasks where there is the largest difference between ESN and the best of IS or ST-LN (SOMO, CoordInv, BShift, TopConst) it seems that one thing these all have in common is that they do require sequential knowledge. We say this because the BOREP baseline lags behind the recurrent models significantly for many of these (and is often at the majority-vote baseline) and also because of the very definitions of these tasks. This also makes intuitive sense as well since this is the type of knowledge that is much harder to learn and is not provided by stand-alone word embeddings. Therefore, we'd expect the trained models to have an edge here, which seems to bear out in these experiments.

6. DISCUSSION:

In light of our findings, we list several take-away messages with regard to sentence embeddings:

• If you need a baseline for your sentence encoder, don't just use BOE, use BOREP of the same dimension, and/or a randomly initialized version of your encoder. • If you are pressed for time and have a small to mid-size dataset, simply randomly project to a very high dimensionality, and profit. • More dimensions in the encoder is usually better (up to a point).

• If you want to show that your system is better than another system, use the same classifier on top with the same hyperparameters; and use the same word embeddings at the bottom; while having the same sentence embedding dimensionality. • Be careful with padding, pooling and sorting: you may inadvertently end up favoring certain methods on some tasks, making it harder to identify sources of improvement.

As Rahimi and Recht wrote when reflecting on their random kitchen sinks paper6 :

Its such an easy thing to try. When they work and I'm feeling good about life, I say "wow, random features are so powerful! They solved this problem!" Or if I'm in a more somber mood, I say "that problem was trivial. Even random features cracked it." [...] Regardless, it's an easy trick to try.

Indeed, random sentence encoders are easy to try: they require no training, and should be used as a solid baseline to be compared against when learning sentence encoders that are supposed to capture more than simply what is encoded in the pre-trained word embeddings. While sentence embeddings constitute a very promising research direction, much of their power appears to come from pre-trained word embeddings, which even random methods can exploit. The probing analysis revealed that the trained systems are in fact better at some more intricate semantic probing tasks, aspects of which are however apparently not well-reflected in the downstream evaluation tasks.

7. CONCLUSION:

In this work we have sought to put sentence embeddings on more solid footing by examining how much trained sentence encoders improve over random sentence encoders. As it turns out, differences exist, but are smaller than we would have hoped: in comparison to sentence encoders such as SkipThought (which was trained for a very long time) and InferSent (which requires large amounts of annotated data), performance improvements are less than 2 points on average over the 10 Sen-tEval tasks. Therefore one may wonder to what extent sentence encoders are worth the attention they're receiving. Hope remains, however, if we as a community start focusing on more sophisticated tasks that require more sophisticated learned representations that cannot merely rely on having good pre-trained word embeddings.

over the most commonly used ones: mean pooling and max pooling. We use the publicly available 300-dimensional GloVe embeddings (Pennington et al., 2014) trained on Common Crawl for all experiments. All words that are not in the vocabulary for GloVe are assigned a vector of zeros.

For the ESNs, we only tune whether to use a ReLU or no activation function,7 the spectral radius from {0.4, 0.6, 0.8, 1.0}, the range of the uniform distribution for initializing W i where the max distance from zero is selected from {0.01, 0.05, 0.1, 0.2}, and finally the fraction of elements in W h that are set to 0, i.e., sparsity, is selected from {0, 0.25, 0.5, 0.75}. Furthermore, our model did not include a bias term b i .

We chose not to experiment with other possibilities that ESNs provide that could further enhance performance like leaking or concatenating/adding the input embedding to the reservoir state in favor of a simpler model.

We In order to examine the stability of the random sentence encoders, we select the two best overall models by best validation score-one that achieved the highest accuracy score, and one that achieved the highest correlation score (as these differed significantly)-and examine the results. The performance of these models is shown in Table 4 . We observe that performance is very stable, and that task-specific tuning yields little or no benefit over the best-overall model, which is beneficial: the good results obtained by random sentence encoders are not some fluke, and the finding is robust. We further analyzed how max-pooling over padding affects downstream evaluations and noticed that for this effect to occur, the batch size to produce the embeddings and the order in which sentenced were embedded needed to be a specific way. The order in which sentences are embedded in SentEval is not random, as sentences are sorted by length prior to being grouped into batches. We noticed that upsetting this order, or changing the batch size so that sentences are grouped differently, causes a significant change on the downstream performance.

In Table 5 , we reproduce this effect for RandLSTM (averaged over 5 seeds) and also include results for InferSent and GenSen using their released code. The first half of the table shows results when max pooling with padding is used and the batches are sorted. The second half of the table shows performance when the batches are unsorted. As can be seen by the table, the performance has a significant drop-off when the batches are unsorted, especially for MR and CR.

Max pooling over padded values changes negative values in the features of longer sentences to zero. This is because if the largest value in the hidden representations over the length of the sentence is negative, the padded zeros will be greater. Thus, longer sentences, when grouped with shorter ones, will have more sparse representations. We tried to reproduce this effect by using a ReLU, but it didn't increase performance. We also checked to see if length was strongly correlated with either class for the problems in Table 5 , but found the correlation was low for all binary tasks. In fact it is 0.0 for CR, one of the tasks most affected by this phenomenon.

It turns out that in several of the datasets, those examples obtaining the sparse representations (becoming sparsed) occur much more often in certain classes than others. 

D EXPLORING DIFFERENT INITIALIZATION STRATEGIES:

We analyzed the effects different initialization strategies had on performance for BOREP and Ran-dLSTM. We experimented with 6 different initialization strategies: 1) Heuristic, which is the approach used in this paper for BOREP and RandLSTM experiments unless otherwise noted, where elements are sampled uniformly from [-

1 √ d , 1 √ d ]

2) Uniform where parameters are sampled from [-0.1, 0.1], 3) Normal where parameters are sampled from a normal distribution with 0 mean and a standard deviation of 1, 4) Orthogonal where elements are sampled from the heuristic and then the matrices of the parameters are made orthogonal 5) He initialization (He et al., 2015) and 6) Xavier initialization (Glorot & Bengio, 2010) .

We find that BROEP is robust to initialization strategy, with a slight edge for Orthogonal and Xavier initialization. However, RandLSTM does poorly with Normal initialization and to a lesser degree, Uniform. He and Xavier initialization seem to give the best average performance. and less-so for those tasks relying on a measure of semantic similarity. This is sensible because semantic similarity tasks can make use of embeddings appearing in the test data that were not in the training data if the words appear in both sentences in the example. However, this is not the case for classification as an unseen random word embeddings provide little information.

Interestingly, pooling randomly initialized 4096 dimension embeddings outperforms BOREP and RandLSTM. It would be interesting to see the performance of this model when the embeddings are pre-trained instead of random. Perhaps pooling them would be competitive with trained encoders like Infersent. It would also be interesting to see what effect large-dimension word embeddings have on both a trained sentence encoder like Infersent as well as random recurrent architectures. We leave this exploration for future work.

:

See http://elmorigin.wixsite.com/originofelm for an interesting discussion of ELM.

https://github.com/facebookresearch/InferSent

We trained this model using the hyperparameters described byConneau et al. (2017). Training on both SNLI(Bowman et al., 2015) and MultiNLI(Williams et al., 2018), we achieved a test performance on SNLI of 84.4 when max-pooling over padded words and 83.9 when max-pooling over the length of the sentences.

We note that GenSen uses the same pooling as Infersent-1, and we show in Appendix C that this has a significant effect on performance.

http://www.argmin.net/2017/12/05/kitchen-sinks/

A tanh activation did not work well in these experiments, even though it is often used in ESNs.

Training is stopped when validation performance has not increased 5 times. Checks for validation performance occur every 4 epochs.

Figures and Tables:

Figure 1: Performance while varying dimensionality, for the three random sentence encoders over all ten downstream tasks.

Performance (accuracy for all tasks except SICK-R and STSB, for which we report Pearson's r) on all ten downstream tasks where all models have 4096 dimensions with the exception of BOE (300) and ST-LN (4800). Standard deviations are show in parentheses. InferSent-1 is the paper version with GloVe (G) embeddings, InferSent-2 has fixed padding and uses FastText (F) embeddings, and InferSent-3 has fixed padding and uses GloVe embeddings. We also show the difference between the best random architecture (BestRand) and InferSent-3 and ST-LN, respectively. The average performance difference between the best random architecture and InferSent-3 and ST-LN is 1.7 and -0.4 respectively.

Table content: <table><tr><td>Model</td><td colspan="2">Dim MR</td><td>CR</td><td colspan="2">MPQA SUBJ</td><td>SST2</td><td>TREC</td><td colspan="4">SICK-R SICK-E MRPC STSB</td></tr><tr><td>BOE</td><td colspan="11">300 77.3(.2) 78.6(.3) 87.6(.1) 91.3(.1) 80.0(.5) 81.5(.8) 80.2(.1) 78.7(.1) 72.9(.3) 70.5(.1)</td></tr><tr><td>BOREP</td><td colspan="11">4096 77.4(.4) 79.5(.2) 88.3(.2) 91.9(.2) 81.8(.4) 88.8(.3) 85.5(.1) 82.7(.7) 73.9(.4) 68.5(.6)</td></tr><tr><td>RandLSTM</td><td colspan="11">4096 77.2(.3) 78.7(.5) 87.9(.1) 91.9(.2) 81.5(.3) 86.5(1.1) 85.5(.1) 81.8(.5) 74.1(.5) 72.4(.5)</td></tr><tr><td>ESN</td><td colspan="11">4096 78.1(.3) 80.0(.6) 88.5(.2) 92.6(.1) 83.0(.5) 87.9(1.0) 86.1(.1) 83.1(.4) 73.4(.4) 74.4(.3)</td></tr><tr><td>InferSent-1 = paper, G</td><td colspan="2">4096 81.1</td><td>86.3</td><td>90.2</td><td>92.4</td><td>84.6</td><td>88.2</td><td>88.3</td><td>86.3</td><td>76.2</td><td>75.6</td></tr><tr><td colspan="3">InferSent-2 = fixed pad, F 4096 79.7</td><td>84.2</td><td>89.4</td><td>92.7</td><td>84.3</td><td>90.8</td><td>88.8</td><td>86.3</td><td>76.0</td><td>78.4</td></tr><tr><td colspan="3">InferSent-3 = fixed pad, G 4096 79.7</td><td>83.4</td><td>88.9</td><td>92.6</td><td>83.5</td><td>90.8</td><td>88.5</td><td>84.1</td><td>76.4</td><td>77.3</td></tr><tr><td colspan="2">∆ InferSent-3, BestRand -</td><td>1.6</td><td>3.4</td><td>0.4</td><td>0.0</td><td>0.5</td><td>2.0</td><td>2.4</td><td>1.0</td><td>2.3</td><td>2.9</td></tr><tr><td>ST-LN</td><td colspan="2">4800 79.4</td><td>83.1</td><td>89.3</td><td>93.7</td><td>82.9</td><td>88.4</td><td>85.8</td><td>79.5</td><td>73.2</td><td>68.9</td></tr><tr><td>∆ ST-LN, BestRand</td><td>-</td><td>1.3</td><td>3.1</td><td>0.8</td><td>1.1</td><td>-0.1</td><td>0.5</td><td>-0.3</td><td>-3.6</td><td>-0.9</td><td>-5.5</td></tr></table>



Table content: <table><tr><td>2)</td></tr></table>

use the default SentEval settings, which are to train with a logistic regression classifier, use a batch size of 64, a maximum number of epochs of 200 with early stopping, 8 no dropout, and use Adam(Kingma & Ba, 2014) for optimization with a learning rate of 0.001.

Table content: <table><tr><td colspan="3">B TESTING ROBUSTNESS</td><td/><td/><td/><td/></tr><tr><td>Model</td><td>MR</td><td>CR</td><td>MPQA SUBJ</td><td>SST2</td><td>TREC</td><td>SICK-R SICK-E MRPC STSB</td></tr><tr><td>BOREP (class.)</td><td colspan="6">77.6(.4) 79.3(.2) 88.3(.2) 91.9(.2) 80.6(.6) 88.8(.3) 85.5(.1) 82.2(.1) 73.6(.8) 69.3(.6)</td></tr><tr><td>BOREP (corr.)</td><td colspan="6">77.4(.4) 79.6(.4) 88.3(.1) 92.2(.1) 81.8(.4) 85.6(1.4) 84.6(.2) 82.1(.3) 73.9(.4) 68.5(.6)</td></tr><tr><td colspan="7">RandLSTM (class., corr.) 77.2(.3) 78.7(.5) 87.9(.1) 91.9(.2) 81.5(.3) 86.5(1.1) 85.5(.1) 81.8(.5) 74.1(.5) 72.4(.5)</td></tr><tr><td>ESN (class.)</td><td colspan="6">78.2(.2) 80.1(.2) 88.3(.2) 92.5(.1) 83.0(.5) 88.3(1.5) 85.3(.2) 82.4(.7) 73.1(.4) 70.0(.4)</td></tr><tr><td>ESN (corr.)</td><td colspan="6">76.7(.2) 78.2(.6) 88.0(.1) 91.5(.3) 81.2(.5) 86.7(1.2) 86.1(.1) 82.9(.1) 74.1(.5) 74.4(.3)</td></tr></table>

Performance (accuracy for all tasks except SICK-R and STSB, for which we report Pearson's r) on all ten downstream tasks. Standard deviations are show in parentheses. All models have 4096 dimensions and were selected by tuning over validation performance on classification tasks or correlation tasks as noted. For RandLSTM this corresponds to a single model that uses max pooling.

Table content: <table/>

Accuracy on single-sentence binary classification tasks from SentEval, where max-pooling is done over padded values instead of over the length of the sentence. Experiments are split between Sorted where sentences are sorted in order of length prior to batching and Unsorted where they are not.

Table content: <table><tr><td colspan="2">C POOLING AND PADDING</td><td/></tr><tr><td/><td>Model</td><td colspan="2">MR CR MPQA SUBJ SST2</td></tr><tr><td>Sorted</td><td colspan="2">RandLSTM 81.7 84.0 89.4 InferSent 81.6 86.7 90.3</td><td>93.0 81.2 92.5 84.5</td></tr><tr><td/><td>GenSen</td><td>82.7 87.4 91.0</td><td>94.1 83.2</td></tr><tr><td>Unsorted</td><td colspan="2">RandLSTM 77.2 79.2 88.1 InferSent 79.9 84.3 89.5</td><td>92.0 81.8 92.4 84.4</td></tr><tr><td/><td>GenSen</td><td>78.1 84.2 89.7</td><td>92.4 83.9</td></tr></table>

Table 6 analyzes the distribution of sparsed examples in MR, CR, MPQA, SUBJ, and SST2. Since MR, CR, MPQA, and SUBJ have no defined training/validation/testing split, the first row of the table shows the percentage of the data that becomes sparsed when the sentences are embedded. The second row is what percentage of those sparsed embeddings are of the positive class.SST2 is split into a training/validation/test set. In it, only 3.5% of the training data is sparsed. However, 94% of the sparsed data has a class 1 label. In the testing data, 75% of the data is sparsed with 61% of the data having class 1. Overall, since little training data is actually sparsed, and the class imbalance of the testing data isn't as skewed as in the other datasets, SST2 is less affected by these sparsed representations as can be seen in the table. Percentage of total data sparsed due to max-pooling over padded values and the percentage of that data that is the positive class for MR, CR, MPQA, and SUBJ.

Table content: <table><tr><td/><td colspan="2">MR CR MPQA SUBJ</td></tr><tr><td>% Total data sparsed</td><td>23 59 8</td><td>23</td></tr><tr><td colspan="2">% Class 1 data sparsed 91 82 70</td><td>92</td></tr></table>

Peer review (iclr2019):
 This paper is about exploring better baselines for sentence-vector representations through randomly initialized/untrained networks. I applaud the overall message of this paper that we need to evaluate our models more thoroughly and have better baselines. The experimentation is quite thorough and I like that you 1) explored several different architectures 2) varied the dimensionality of representations 3) examine representations with probing tasks in the Analysis section. Main Critique - In your takeaways you say that, “For some of the benchmark datasets, differences between random and trained encoders are so small that it would probably be best not to use those tasks anymore.” I don’t think this follows from your results. Just because current trained encoders do not perform better than random encoders on these tasks doesn’t in itself mean these tasks aren’t good evaluation tasks. These tasks could be faulty for other reasons, but just because we have no better technique than random encoders currently, doesn’t make these evaluation tasks not worthwhile. Perhaps you could further examine what features (n-gram, etc.) it takes to do well on these tasks in order to argue that they shouldn’t be used. - In your related work section you say that “We show that a lot of information may be crammed into vectors using randomly parameterized combinations of pre-trained word embeddings: that is, most of the power in modern NLP systems is derived from having high-quality word embeddings, rather than from having better encoders.” Did you run experiments with randomly initialized embeddings? This paper (https://openreview.net/forum?id=ryeNPi0qKX) finds that representations from LSTMs with randomly initialized embeddings can perform quite well on some transfer tasks. I think in order to make such a claim about the power of high-quality word embeddings you should include numbers comparing them to randomly initialized embeddings. Questions - Did you find that your results were sensitive to the initialization technique used for your random LSTMs / projections? - Do you have a sense of why random non-linear features are able to perform well on these tasks? What kind of features are the skip-thought and InferSent representations learning if they do not perform much better? It’s interesting that many of the random encoder methods outperform the trained models on word content. I think you could discuss these Analysis section findings more. Other Critiques - In the introduction, instead of simply describing what is commonly done to obtain and evaluate sentence embeddings, it would be better to include a sentence or two about the motivation for sentence embeddings at all. - The first sentence, “Sentence embeddings are learned non-linear recurrent combinations of pre-trained word embeddings”, doesn’t seem to be true as BOE representations are also sentence embeddings and CNNs/transformers could also work. “Non-linear” and “recurrent” are not inherent requirements for sentence embeddings, but just techniques that researchers commonly use. - In the second paragraph of introduction instead saying “Natural language processing does not yet have a clear grasp on the relationship between word and sentence embeddings…” it might be better to say “NLP researchers” or the “NLP community” instead of “NLP” as a field doesn’t have a clear grasp. - In the introduction: “It is unclear how much sentence-encoding architectures improve over the raw word embeddings, and what aspect of such architectures is responsible for any improvement.” It would be also good to mention that it’s unclear how much the training task / procedure also is affects improvements. - You could describe more about applications of reservoir computing in your related work section as it’s been used in NLP before. - I don’t think you actually ever describe the type of data that InferSent is trained on, only that it is “expensive” annotated data. It might be useful to add a sentence about natural language inference for clarity. - In the conclusion, change “performance improvements are less than 1 and less than 2 points on average over the 10 SentEval tasks, respectively” to “performance improvements are less than 2 percentage points on average over the 10 SentEval tasks, respectively” - It would be nice if you bolded/underlined the best performing numbers in your results tables.