I
MPROVING
S ENTENCE R EPRESENTATIONS WITH
M ULTI - VIEW F
RAMEWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
Multi-view learning can provide self-supervision when different views are available of the same data.
Distributional hypothesis provides another form of useful self-supervision from adjacent sentences which are plentiful in large unlabelled corpora.
Motivated by the asymmetry in the two hemispheres of the human brain as well as the observation that different learning architectures tend to emphasise different aspects of sentence meaning
, we present two multi
-view frameworks for learning sentence representations in an unsupervised fashion
One framework uses a generative objective and the other a discriminative one.
In both frameworks the ﬁnal representation is an ensemble of two views in which, one view encodes the input sentence with a Recurrent Neural Network (RNN), and the other view encodes it with a simple linear model.
We show that, after learning, the vectors produced by our multi-view frameworks provide improved representations over their single-view learned counterparts and the combination of different views gives representational improvement over each view and demonstrates solid transferabil ity on standard downstream tasks.
I NTRODUCTION
Multi-view learning methods provide the ability to extract information from different views of the data and enable self-supervised learning of useful features for future prediction when annotated data is not available (de Sa, 1993).
Minimising the disagreement among multiple views helps the model to learn rich feature representations of the data and, also after training, the ensemble of the feature vectors from multiple views can provide an even stronger generalisation ability.
Distributional hypothesis (Harris, 1954) noted that words that occur in similar contexts tend to have similar meaning (Turney & Pantel, 2010), and distributional similarity (Firth, 1957) consolidated this idea by stating that the meaning of a word can be determined by the company it has.
The hypothesis has been widely used in machine learning community to learn vector representations of human languages.
Models built upon distributional similarity don’t explicitly require humanannotated training data; the supervision comes from the semantic continuity of language data, such as text and speech.
Large quantities of annotated data are usually hard to obtain.
Our goal is to propose learning algorithms built upon the ideas of multi-view learning and distributional hypothesis to learn from unlabelled data.
We draw inspiration from the lateralisation and asymmetry in information processing of the two hemispheres of the human brain where, for most adults, sequential processing dominates the left hemisphere, and the right hemisphere has a focus on parallel processing (Bryden, 2012), but both hemispheres have been shown to have roles in literal and non-literal language comprehension (Coulson et al., 2005; Coulson & van Petten, 2007).
Our proposed multi-view frameworks aim to leverage the functionality of both RNN-based models, which have been widely applied in sentiment analysis tasks (Yang et al., 2016), and the linear/loglinear models, which have excelled at capturing attributional similarities of words and sentences (Arora et al., 2016; 2017; Hill et al., 2016; Turney & Pantel, 2010) for learning sentence representations.
Previous work on unsupervised sentence representation learning based on distributional hypothesis can be roughly categorised into two types:
Generative objective: These models generally follow the encoder-decoder structure.
The encoder learns to produce a vector representation for the current input, and the decoder learns to generate sentences in the adjacent context given the produced vector (Kiros et al., 2015;
Hill et al., 2016; Gan et al., 2017; Tang et al., 2018).
The idea is straightforward, yet its scalability for very large corpora is hindered by the slow decoding process that dominates training time, and also the decoder in each model is discarded after learning as the quality of generated sequences is not the main concern, which is a waste of parameters and learning effort.
Our ﬁrst multi-view framework has a generative objective and uses an RNN as the encoder and an invertible linear projection as the decoder.
The training time is drastically reduced as the decoder is simple, and the decoder is also utilised after learning.
A regularisation is applied on the linear decoder to enforce invertibility, so that after learning, the inverse of the decoder can be applied as a linear encoder in addition to the RNN encoder.
Discriminative Objective: In these models, a classiﬁer is learnt on top of the encoders to distinguish adjacent sentences from those that are not (Li & Hovy, 2014; Jernite et al., 2017; Nie et al., 2017;
Logeswaran & Lee, 2018)
; these models make a prediction using a predeﬁned differential similarity function on the representations of the input sentence pairs or triplets.
Our second multi-view framework has a discriminative objective and uses an RNN encoder and a linear encoder; it learns to maximise agreement among adjacent sentences.
Compared to earlier work on multi-view learning (de Sa, 1993; Dhillon et al., 2011) that takes data from various sources or splits data into disjoint populations, our framework processes the exact same input data in two distinctive ways.
Having two distinctive information processing views encourages the model to encode different aspects of an input sentence, and is beneﬁcial to the future use of the learnt representations.
Our contribution is threefold:
• Two multi-view frameworks for learning sentence representations are proposed, in which one framework uses a generative objective and the other one adopts a discriminative objective.
Two encoding functions, an RNN and a linear model, are learnt in both frameworks.
• The results show that in both frameworks, the ensemble of two views provide better results than each view alone, and especially, aligning two views by the invertible contraint in the generative approach and by maximising the agreement in the discriminative objective improves each view in our efﬁciently trained multi-view frameworks.
• Models trained under our proposed frameworks achieve good performance on the unsupervised tasks, and overall outperform existing unsupervised transfer learning models, and armed with various pooling functions, they also show solid results on supervised tasks, which are either comparable to or better than those of the best unsupervised transfer model.
It is shown in Hill et al.
(2016) that the consistency between supervised and unsupervised evaluation tasks is much lower than that within either supervised or unsupervised evaluation tasks alone and that a model that performs well on supervised evaluation tasks may fail on unsupervised tasks.
Conneau et al.
(2017) subsequently showed that, with a labelled training corpus, such as SNLI (Bowman et al., 2015) and MultiNLI (Williams et al., 2017), the resulting representations of the sentences from the trained model excel in both supervised and unsupervised tasks.
Our model is able to achieve good results on both groups of tasks without labelled information.
M ODEL A RCHITECTURE
Our goal is to marry RNN-based sentence encoder and the avg-on-word-vectors sentence encoder into multi-view frameworks with simple training objectives.
The motivation for the idea is that, as mentioned in the prior work, RNN-based encoders process the sentences sequentially, and are able to capture complex syntactic interactions, while the avgon-word-vectors encoder has been shown to be good at capturing the coarse meaning of a sentence which could be useful for ﬁnding paradigmatic parallels (Turney & Pantel, 2010).
We present two multi-view frameworks to learn two different sentence encoders; after learning, the vectors produced from two encoders of the same input sentence are used to compose the sentence representation.
The details of our learning frameworks are described as follows:
2. E NCODERS
In our multi-view frameworks, we ﬁrst introduce two encoders that, after learning, can be used to build sentence representations.
One encoder is a bi-directional Gated Recurrent Unit (Chung et al., 2014)
f ( s ; φ ) , where s is the input sentence and φ is the parameter vector in the GRU.
During learning, only hidden state at the last time step is sent to the next stage in learning.
The other encoder is a linear avg-on-word-vectors model g ( s ; W ) , which basically transforms word vectors in a sentence by a learnable weight matrix W and outputs an averaged vector.
2. G ENERATIVE O BJECTIVE
Given the ﬁnding (Tang et al., 2018) that neither an autoregressive nor an RNN decoder is necessary for learning sentence representations that excel on downstream tasks, our learning framework only learns to predict words in the next sentence.
The framework has an RNN encoder f , and a linear decoder h .
Given an input sentence s i , the encoder produces a vector z fi
= f
( s i ; φ ) , and the decoder h projects the vector to x i
= h ( z fi ; U ) =
Uz fi , which has the same dimension as the word vectors v w .
Negative sampling is applied to calculate the likelihood of generating the j -th word in the ( i + 1) -th sentence, shown in Eq.
[Equation]
where v w k are pretrained word vectors for w k , the empirical distribution P e ( w ) is the unigram distribution raised to power 0.75 (Mikolov et al., 2013), and K is the number of negative samples.
The learning objective is to maximise the likelihood for words in all sentences in the training corpus.
Ideally, the inverse of h should be easy to compute so that during testing we can set g
= h − 1 .
As h is a linear projection, the simplest situation is when U is an orthogonal matrix and its inverse is equal to its transpose.
Often, as the dimensionality of vector z fi doesn’t necessarily need to match that of word vectors v w , U is not a square matrix 1 .
To enforce invertibility on U , a row-wise orthonormal regularisation on U is applied during training, which leads to UU (cid:62)
=
I , where I is the identity matrix, thus the inverse function is simply g − 1 ( x ) =
U (cid:62) x , which is easily computed.
The regularisation formula is || UU (cid:62) −
I || F , where || · || F is the Frobenius norm.
Speciﬁcally, the update rule (Ciss ´ e et al., 2017) for the regularisation is:
[Equation]
where β is set to 0 .
After learning, we set W =
U (cid:62) , then the inverse of the decoder h becomes the encoder g .
Compared to prior work with generative objective, our framework reuses the decoding function rather than ignoring it for building sentence representations after learning, thus information encoded in the decoder is also utilised.
2. D ISCRIMINATIVE O BJECTIVE
Our multi-view framework with discriminative objective learns to maximise the agreement between the representations of a sentence pair across two views if one sentence in the pair is in the neighbourhood of the other one.
An RNN encoder f
( s ; φ ) and a linear avg-on-word-vectors g ( s ; W ) produce a vector representation z fi and z gi for i -th sentence respectively.
The agreement between two views of a sentence pair ( s i , s j ) is deﬁned as a ij = a ji = cos( z fi , z gj ) + cos( z gi , z fj ) .
The training objective is to minimise the loss function:
[Equation]
where
[Equation]
where τ is the trainable temperature term, which is essential for exaggerating the difference between adjacent sentences and those that are not.
The neighbourhood/context window c , and the batch size
N are hyperparameters.
The choice of cosine similarity based loss is based on the observations in Turney & Pantel (2010) that, of word vectors derived from distributional similarity, vector length tends to correlate with frequency of words, thus angular distance captures more important meaning-related information.
Also, since our model is unsupervised/self-supervised, whatever similarity there is between neighbouring sentences is what is learnt as important for meaning.
2. P OSTPROCESSING
The postprocessing step proposed in Arora et al.
(2017), which removes the top principal component of a batch of representations, is applied on produced representations from f and g respectively after learning with a ﬁnal l 2 normalisation.
In addition, in our multi-view framework with discriminative objective, in order to reduce the discrepancy between training and testing, the top principal component is estimated by power iteration method (Mises & Pollaczek-Geiringer, 1929) and removed during learning.
E XPERIMENTAL D ESIGN
Three unlabelled corpora from different genres are used in our experiments, including BookCorpus (Zhu et al., 2015), UMBC News (Han et al., 2013) and Amazon Book Review 2 (McAuley et al., 2015); six models are trained separately on each of three corpora with each of two objectives.
The summary statistics of the three corpora can be found in Table 1.
Adam optimiser (Kingma & Ba, 2014) and gradient clipping (Pascanu et al., 2013) are applied for stable training.
Pretrained word vectors, fastText (Bojanowski et al., 2017), are used in our frameworks and ﬁxed during learning.
[Table]
”, “mean( · )”, and “min( · )” refer to global max-, mean-, and min-pooling over time, which result in a single vector.
The table also presents the diversity of the way that a single sentence representation can be calculated.
X i refers to word vectors in i -th sentence, and H i refers to hidden states at all time steps produced by f .
[Table]
All of our experiments including training and testing are done in PyTorch (Paszke et al., 2017).
The modiﬁed SentEval (Conneau & Kiela, 2018) package with the step that removes the ﬁrst principal component is used to evaluate our models on the downstream tasks.
Hyperparameters, including negative samples K in the framework with generative objective, context window c in the one with discriminative objective, are tuned only on the averaged performance on STS14 of the model trained on the BookCorpus; STS14/G1 and STS14/D1 results are thus marked with a (cid:63) in Table 3 and Table 4 to indicate possible overﬁtting on that dataset/model only.
Batch size N and dimension d in both frameworks are set to be the same for fair comparison.
Hyperparameters are summarised in supplementary material.
[Table] [Table]
3. U NSUPERVISED E VALUATION - T EXTUAL S IMILARITY T ASKS
Representation: For a given sentence input s with M words, suggested by (Pennington et al., 2014; Levy et al., 2015), the representation is calculated as z = (cid:0) ˆ
z f
+ ˆ z g (cid:1) / 2 , where ˆ z refers to the post-processed and normalised vector, and is mentioned in Table 2.
Tasks :
The unsupervised tasks include ﬁve tasks from SemEval Semantic Textual Similarity (STS) in 2012-2016 (Agirre et al., 2015; 2014; 2016; 2012; 2013) and the SemEval2014 Semantic Relatedness task (SICK-R) (Marelli et al., 2014).
Comparison : We compare our models with: • Unsupervised transfer learning : We selected models with strong results from related work, including fastText, fastText+WR.
• Semisupervised transfer learning : The word vectors are pretrained on each task (Wieting et al., 2015) without label information, and word vectors are averaged to serve as the vector representation for a given sentence (Arora et al., 2017).
• Supervised transfer learning : ParaNMT (Wieting & Gimpel, 2018) is included as a supervised transfer learning method as the data collection stage requires a neural machine translation system trained in supervised fashion.
and the InferSent 3 (Conneau et al., 2017) trained on SNLI (Bowman et al., 2015) and MultiNLI (Williams et al., 2017) is included as well.
The results are presented in Table 3.
Since the performance of FastSent (Hill et al., 2016) and QT (Logeswaran & Lee, 2018) were only evaluated on STS14, we compare to their results in Table 4.
All six models trained with our learning frameworks outperform other unsupervised and semi supervised transfer learning methods, and the model trained on the UMBC News Corpus with discriminative objective gives the best performance likely because the STS tasks contain multiple news- and headlines-related datasets which is well matched by the domain of the UMBC News Corpus.
3. S UPERVISED E VALUATION
The evaluation on these tasks involves learning a linear model on top of the learnt sentence representations produced by the model.
Since a linear model is capable of selecting the most relevant dimensions in the feature vectors to make predictions, it is preferred to concatenate various types of representations to form a richer, and possibly more redundant feature vector, which allows the linear model to explore the combination of different aspects of encoder functions to provide better results.
Representation: Inspired by prior work (McCann et al., 2017; Shen et al., 2018), the representation z f is calculated by concatenating the outputs from the global mean-, max- and min-pooling on top of the hidden states H , and the last hidden state, and z g is calculated with three pooling functions as well.
The post-processing and the normalisation step is applied individually.
These two representations are concatenated to form a ﬁnal sentence representation.
Table 2 presents the details.
Tasks : Semantic relatedness (SICK) (Marelli et al., 2014), paraphrase detection (MRPC) (Dolan et al., 2004), question-type classiﬁcation (TREC) (Li & Roth, 2002), movie review sentiment (MR) (Pang & Lee, 2005), Stanford Sentiment Treebank (SST)
(Socher et al., 2013), customer product reviews (CR) (Hu & Liu, 2004), subjectivity/objectivity classiﬁcation (SUBJ) (Pang & Lee, 2004), opinion polarity (MPQA) (Wiebe et al., 2005).
The results are presented in Table 5.
Comparison : Our results as well as related results of supervised task-dependent training models, supervised transfer learning models, and unsupervised transfer learning models are presented in
Table 5.
Note that, for fair comparison, we collect the results of the best single model (MC-QT) trained on BookCorpus in Logeswaran & Lee (2018).
Six models trained with our learning frameworks either outperform other existing methods, or achieve similar results on some tasks.
The model trained on the Amazon Book Review gives the best performance on sentiment analysis tasks, since the corpus conveys strong sentiment information.
Our models perform similarly or better than existing methods, but with higher training efﬁciency
[Table]
ParagraphVec
[Table]
Unsupervised training with ordered sentences
FastSent - - 72.2/80.
Skip-thought 85.
CNN-LSTM † - 86.
DiscSent ‡ - - 75.0/ - 87.
DisSent ‡ - 79.
MC-QT 86.
Multi-view G 3.
Multi-view G  87. Multi-view G  87.
Multi-view D  87.
Multi-view D 8.
[Table]
[Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table]
D ISCUSSION 4. E NSEMBLE IN M ULTI - VIEW F RAMEWORKS
In both frameworks, RNN encoder and linear encoder perform well on all tasks, and generative objective and discriminative objective give similar performance.
In general, an ensemble of the representations generated from two distinct encoding functions performs even better.
The two encoding functions, f and g , have naturally different behaviour.
With distributional similarity (Firth, 1957), our multi-view frameworks help the two encoding functions to learn more generalised representations.
Therefore, f and g encode the input sentence with emphasis on different aspects, and the subsequently trained linear model for each of the supervised downstream tasks beneﬁts from this diversity leading to better predictions.
4. G ENERATIVE O BJECTIVE : R EGULARISATION ON I NVERTIBILITY
The orthonormal regularisation applied on the linear decoder to enforce invertibility in our multiview framework encourages the vector representations produced by f and those by h − 1 , which is g in testing, to align with each other.
A direct comparison is to train our multi-view framework without the invertible constraint, and still directly use U (cid:62) as an additional encoder in testing.
The results of our framework with and without the invertible constraint are presented in Table 6.
The ensemble method of two views, f and g , on unsupervised evaluation tasks (STS12-16 and
SICK14) is averaging, which beneﬁts from aligning representations from f and g by applying invertible constraint, and the RNN encoder f gets improved on unsupervised tasks by learning to align with g .
On supervised evaluation tasks, as the ensemble method is concatenation and a linear model is applied on top of the concatenated representations, as long as the encoders in two views process sentences distinctively, the linear classiﬁer is capable of picking relevant feature dimensions from both views to make good predictions, thus there is no signiﬁcant difference between our multi-view framework with and without invertible constraint.
4. D ISCRIMINATIVE O BJECTIVE : M ULTI - VIEW VS . S INGLE - VIEW
In order to determine if the multi-view framework with two different views/encoding functions is helping the learning, we compare our framework with discriminative objective to other reasonable variants, including the multi-view model with two functions of the same type but parametrised independently, either two f -s or two g -s, and the single-view model with only one f or g .
Tablepresents the results of the models trained on UMBC Corpus.
In our multi-view learning with f and g , the two encoding functions improve each other’s view.
As illustrated in previous work, and speciﬁcally emphasised in Hill et al.
(2016), linear/log-linear models, which include g in our model, produce better representations for STS tasks than RNN-based models do.
The same ﬁnding can be observed in Table 6 as well, where g consistently provides better results on STS tasks than f does.
In addition, as we expected, in our multi-view learning with f and g , g improves the performance of f on STS tasks.
With maximising the agreement between the representations generated from f and g , we also see in the table that f improves g on supervised evaluation tasks.
Compared with the ensemble of two multi-view models, each with two encoding functions of the same type, our multi-view framework with f and g provides slightly better results on STS tasks, and similar results on supervised evaluation tasks, while our model has much higher training efﬁciency.
Compared with the ensemble of two single-view models, each with only one encoding function, the matching between f and g in our multi-view model produces better results.
C ONCLUSION
We proposed multi-view sentence representation learning frameworks with generative and discriminative objectives; each framework combines an RNN-based encoder and an average-on-wordvectors linear encoder and can be efﬁciently trained within a few hours on a large unlabelled corpus.
The experiments were conducted on three large unlabelled corpora, and meaningful comparisons were made to demonstrate the generalisation ability and the transferability of our learning frameworks, and also to consolidate our claim.
The produced sentence representations outperform existing unsupervised transfer methods on unsupervised evaluation tasks, and match the performance of the best unsupervised model on supervised evaluation tasks.
As presented in our experiments, the ensemble of two views leveraged the advantages of both views, and provides rich semantic information of the input sentence, also the multi-view learning helps each view to produce better representations than single-view learning.
Meanwhile, our experimental results also support the ﬁnding in Hill et al.
(2016) that linear/log-linear models ( g in our frameworks) tend to work better on the unsupervised tasks, while RNN-based models ( f in our frameworks) generally perform better on the supervised tasks.
Future work should explore the impact of having various encoding architectures and learning under the multi-view framework.
Our multi-view learning frameworks were inspired by the asymmetric information processing in the two hemispheres of the human brain, in which for most adults, the left hemisphere contributes to sequential processing, including primarily language understanding, and the right one carries out more parallel processing, including visual spatial understanding (Bryden, 2012).
The experimental results raise an intriguing hypothesis about how these two types of information processing may complementarily help learning.
A PPENDIX E VALUATION TASKS
The details, including size of each dataset and number of classes, about the evaluation tasks are presented below 1 .
[Table]
P OWER I TERATION
The Power Iteration was proposed in Mises & Pollaczek-Geiringer (1929)
[Table]
and it is an efﬁcient algorithm for estimating the top eigenvector of a given covariance matrix.
Here, it is used to estimate the top principal component from the representations produced from f and g separately.
We omit the superscription here
[Table]
since the same step is applied to both f and g
[Table]
Suppose there is a batch of representations Z =
[ z 1 , z 2 ..., z N ] ∈ R 2 d × N from either f or g , the
Power Iteration method is applied here to estimate the top eigenvector of the covariance matrix 2 :
C = ZZ (cid:62)
[Table]
and it is described in Algorithm 1:
Algorithm
Estimating the First Principal Component (Mises & Pollaczek-Geiringer, 1929)
Input: Covariance matrix C ∈ R 2 d × 2 d , number of iterations T Output: First principal component u ∈ R 2 d 1: Initialise a unit length vector u ∈ R 2 d 2:
for t ← 1 , T do 3: u ← Cu , 4: u ← u || u
||
In our experiments, T is set to be 5 .
T RAINING & M ODEL D ETAILS
The hyperparameters we need to tune include the batch size N , the dimension of the GRU encoder d , and the context window c , and the number of negative samples K .
The results we presented in this paper is based on the model trained with N = 512 , d = 1024 .
Speciﬁcally, in discriminative objective, the context window is set c = 3 , and in generative objective, the number of negative samples is set K = 5 .
It takes up to 8GB on a GTX 1080Ti GPU.
The initial learning rate is 5 × 10 − 4 , and we didn’t anneal the learning rate through the training.
All weights in the model are initialised using the method proposed in He et al.
(2015), and all gates in the bi-
GRU are initialised to 1, and all biases in the single-layer neural network are zeroed before training.
The word vectors are ﬁxed to be those in the FastText (Bojanowski et al., 2017), and we don’t ﬁnetune them.
Words that are not in the FastText’s vocabulary are ﬁxed to 0 vectors through training.
The temperature term is initialised as 1 , and is tuned by the gradient descent during training.
The temperature term is used to convert the agreement a ij to a probability distribution p ij in Eq.
1 in the main paper.
In our experiments, τ is a trainable parameter initialised to 1 that decreased consistently through training.
Another model trained with ﬁxed τ set to the ﬁnal value performed similarly.
E FFECT OF P OST - PROCESSING S TEP
[Figure] [Table] [Figure]
[Table]
C OMBINING BOTH GENERATIVE AND DISCRIMINATIVE OBJECTIVE IN OUR MULTI - VIEW FRAMEWORK
Models with both generative and discriminative objectives are trained to see if further improvement can be provided by combining an RNN encoder, an inverse of a linear decoder in the generative objective and a linear encoder in the discriminative objective.
The results of models trained on
BookCorpus and UMBC News are presented in Table
[Table]
As presented in the table
[Table]
no further improvement against models with only one objective is shown.
In our understanding, the inverse of the linear decoder in generative objective behaves similarly to the linear encoder in the discriminative objective, which is presented in Table 6 in the main paper.
Therefore, combining two objectives doesn’t perform better than only one of them.
[Table]
N UMBER OF P ARAMETERS
The number of parameters of each of the selected models is
Ours: ≈ 8 .
8 M 2.
Quick-thought (Logeswaran & Lee, 2018):
≈ 19 .
8 M 3.
Skip-thought (Kiros et al., 2015): ≈ 57 .
7 M