Paper commentary
Supervised Learning of Universal Sentence Representations from Natural Language Inference Data
Supervised NLI training yields sentence encoders that beat unsupervised ones on transfer
- Problem Sentence encoders trained without labels have not matched word embeddings in usefulness, and it was unclear which supervised task could produce general-purpose sentence vectors. Earlier SNLI-based encoders gave inconclusive results.
- Method The authors train a shared encoder on SNLI premise and hypothesis pairs, using concatenated, product and difference matching features. They then freeze the encoder and use its sentence vectors as features for transfer tasks.
- Results BiLSTM-Max with 4096 dimensions reached 85.2 micro and 83.7 macro aggregated transfer scores, the highest of the seven encoders compared.
Why supervised signals for sentence vectors
Word embeddings are a standard source of features, but packing the meaning of a whole sentence into one vector is less settled. Most sentence encoders are trained without labels, for example by predicting the sentences around a given sentence, as SkipThought does. The authors ask whether a supervised objective can do better. Their reference point is computer vision, where networks pretrained on ImageNet are reused for other tasks.
The candidate objective is natural language inference on the SNLI corpus, which contains 570k human-generated English sentence pairs labelled as entailment, contradiction or neutral. To the authors' knowledge, earlier work that trained on SNLI for sentence encoders gave inconclusive results, and none had used the full SNLI corpus for generic encoders.
Training a shared encoder on NLI pairs
The training network encodes the premise and the hypothesis with one shared encoder, which yields a vector u for the premise and a vector v for the hypothesis. The authors choose this sentence-encoding design over joint models that let the two sentences interact through cross-features or attention, because their goal is an encoder that works on single sentences.
The two vectors are combined by three matching methods: concatenation, element-wise product and absolute element-wise difference. The combined feature is written as \((u, v, |u - v|, u \ast v)\). This feature passes through fully connected layers that end in a three-way softmax, which predicts entailment, contradiction or neutral.
The classifier is a multi-layer perceptron with one hidden layer of 512 units. Encoder and classifier are both trained on SNLI with SGD. The product and difference terms give the classifier a way to measure how far apart the two sentence vectors are, which the authors later connect to their STS14 result.
Seven encoder designs
Seven architectures are compared, covering recurrent, attention-based and convolutional designs. The LSTM and GRU encoders use the last hidden vector as the sentence representation. BiGRU-last concatenates the last hidden states of a forward and a backward GRU, which copies the architecture used by SkipThought vectors.
A BiLSTM concatenates the forward and backward hidden state at each time step. Its fixed-size vector comes from pooling across time, either with max pooling, which keeps the largest value of each hidden dimension, or with mean pooling, which averages the states. Max pooling is the design that the authors keep as their final choice.
The self-attentive encoder scores each BiLSTM state with a learned context vector \(u_w\). It computes \( \bar h_i = \tanh(W h_i + b_w) \) and \( \alpha_i = e^{\bar h_i^T u_w} / \sum_i e^{\bar h_i^T u_w} \), and forms \( u = \sum_t \alpha_i h_i \). Four context vectors give four weighted views of the sentence, and their outputs are concatenated into the final representation.
The hierarchical ConvNet stacks four convolutional layers. Max pooling over the feature maps of each layer gives representations u1 to u4, which are concatenated, so the vector mixes several levels of abstraction.
Optimization and frozen-feature transfer
For transfer, the trained encoder is kept fixed and produces one vector per sentence. Those vectors are the features that the transfer tasks use. SentEval fits a logistic regression with Adam and batch size 64, and the L2 penalty is tuned by grid search on the validation set. The authors choose a linear classifier for the classification tasks because it needs fewer parameters than an MLP and suits small datasets.
Which encoder transfers best
With 4096 dimensions, BiLSTM-Max reached 85.0 dev and 84.5 test accuracy on SNLI, and the highest micro and macro aggregated transfer scores of the seven encoders, at 85.2 and 83.7. The LSTM row uses 2048 dimensions, while the other rows use 4096.
Better NLI accuracy did not always carry over to transfer. Inner-attention scored 82.3 on SNLI dev against 79.0 for BiLSTM-Mean, yet its micro transfer score was 82.1, below 83.1 for BiLSTM-Mean. The authors suggest that inner-attention focuses on parts of a sentence that help SNLI but not the transfer tasks, while BiLSTM-Mean does not make sharp choices, which they read as keeping more general information.
Micro performance generally rises with embedding size for almost all models. The increase is most visible for BiLSTM-Max, HConvNet and inner-attention. The authors read this as larger encoders retaining information that is not needed for NLI but is useful for transfer, since their SNLI results stay relatively stable across sizes.
Effect of the optimizer
When BiLSTM-max was trained with Adam instead of SGD, it converged on SNLI in 5 epochs rather than 10. Its transfer results were worse, and the authors attribute this to a greater ability to over-specialize on the training task. The comparison covers this one model and this one alternative optimizer.
Comparison with unsupervised and other supervised encoders
Table 4 groups the baselines by the kind of data they were trained on: unordered unsupervised models, ordered unsupervised models such as SkipThought and FastSent, and supervised models trained on COCO, dictionary definitions, NMT and SST.
Against SkipThought-LN, the strongest unsupervised baseline in the table, BiLSTM-Max trained on SNLI scores higher on MR (79.9 against 79.4), CR (84.6 against 83.1) and MPQA (89.8 against 89.3). On SUBJ it is lower, at 92.1 against 93.7.
The authors report that SNLI-trained models outperform encoders trained on COCO, dictionary definitions, NMT, PPDB and SST. For SST they used exactly the same models as for SNLI.
The SNLI training set is much smaller than the corpus behind SkipThought-LN: 570k pairs against 64M sentences.
SICK and STS14 results
On SICK-R, BiLSTM-Max trained on SNLI reaches a Pearson correlation of 0.885, against 0.868 for the Tree-LSTM of Tai et al. (2015). On SICK-E, it reaches 86.3% test accuracy, against 84.5% for the Illinois-LH system. For relatedness the authors use the same matching methods as in SNLI and fit a logistic regression on the joint representation.
The authors also compare with earlier transfer work by Bowman et al. (2015), which fine-tuned an LSTM trained on SNLI on SICK and reached 80.8% accuracy. Here only the classifier is learned on frozen embeddings, and the authors attribute the higher result to the embeddings already containing what the in-domain task needs.
On the six unsupervised STS14 tasks, cosine similarity in the BiLSTM-Max embedding space reaches a Pearson correlation of 0.68, against 0.29 for SkipThought and 0.44 for SkipThought-LN. The authors link this to the distance-based matching features used during NLI training. This is their hypothesis.
Caption-image retrieval and the AllNLI training set
The loss sums \( \max(0, \alpha - s(V y, U x) + s(V y, U x_k)) \) over negative captions and the matching reverse terms over negative images, with \(s\) the cosine similarity.
The split follows Karpathy and Fei-Fei: 113k COCO images with five captions each for training, 5k for validation and 5k for test, with scores averaged over five random sets of 1k test images. Under the same ResNet-101 setting, SkipThought reaches 37.9 caption retrieval R@1, and BiLSTM-Max trained on SNLI reaches 42.4. The SkipThought result with VGG19 features used 82k training samples and reached 33.8, so that row is not the same setting.
MultiNLI adds 433K sentence pairs across ten genres. Training on AllNLI gives 42.6 caption R@1 and 33.9 image R@1, against 33.2 image R@1 for SNLI alone. The authors observe that training on other genres does not degrade caption retrieval compared with SNLI, which mostly contains captions.
AdaSent is trained directly on each task, so this is a comparison with a supervised reference rather than with another transfer encoder.
Limits of the evidence
Only the sentence-encoding form of NLI training was used. The joint models that encode both sentences together were not trained, since the goal was a generic single-sentence encoder.
The optimizer comparison covers one architecture, BiLSTM-max, and one alternative optimizer, Adam. The embedding size observations are reported on the micro aggregate, and the SNLI accuracy is described as relatively stable across sizes.
The SkipThought-LN comparison pairs a model trained on 570k SNLI pairs with a model trained on 64M sentences, so the two differ in data scale as well as in training objective. The caption retrieval baseline with VGG19 features used a different training size, so it is not matched to the SNLI setting.
Paper info
- Authors
- Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, Antoine Bordes
- Venue
- arXiv · Preprint
- First published
- 2017-5-5
- Added
- 2026-11-12
- Updated
- 2018-7-8
- Version
- v5
- arXiv
- 1705.02364
- Category
- cs.CL
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, Antoine Bordes (2017). Supervised Learning of Universal Sentence Representations from Natural Language Inference Data. arXiv:1705.02364v5. https://arxiv.org/abs/1705.02364v5
BibTeX
@misc{conneau2017supervised,
title = {{Supervised Learning of Universal Sentence Representations from Natural Language Inference Data}},
author = {Alexis Conneau and Douwe Kiela and Holger Schwenk and Loic Barrault and Antoine Bordes},
year = {2017},
eprint = {1705.02364},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1705.02364v5}
}