Hostname: page-component-74656f9884-skzmx Total loading time: 0 Render date: 2026-11-06T09:07:25.097Z Has data issue: false hasContentIssue false

Jointly learning sentence embeddings and syntax with unsupervised Tree-LSTMs

Published online by Cambridge University Press:  31 July 2019

Jean Maillard*
Affiliation:
Department of Computer Science and Technology, University of Cambridge, Cambridge, United Kingdom
Stephen Clark
Affiliation:
DeepMind, London, UK
Dani Yogatama
Affiliation:
DeepMind, London, UK
*
*Corresponding author. Email: jean@maillard.it
Rights & Permissions [Opens in a new window]

Abstract

We present two studies on neural network architectures that learn to represent sentences by composing their words according to automatically induced binary trees, without ever being shown a correct parse tree. We use Tree-Long Short-Term Memories (LSTMs) as our composition function, applied along a tree structure found by a differentiable natural language chart parser. The models simultaneously optimise both the composition function and the parser, thus eliminating the need for externally provided parse trees, which are normally required for Tree-LSTMs. They can therefore be seen as tree-based recurrent neural networks that are unsupervised with respect to the parse trees. Due to being fully differentiable, the models are easily trained with an off-the-shelf gradient descent method and backpropagation.

In the first part of this paper, we introduce a model based on the CKY chart parser, and evaluate its downstream performance on a natural language inference task and a reverse dictionary task. Further, we show how its performance can be improved with an attention mechanism which fully exploits the parse chart, by attending over all possible subspans of the sentence. We find that our approach is competitive against similar models of comparable size and outperforms Tree-LSTMs that use trees produced by a parser.

Finally, we present an alternative architecture based on a shift-reduce parser. We perform an analysis of the trees induced by both our models, to investigate whether they are consistent with each other and across re-runs, and whether they resemble the trees produced by a standard parser.

Information

Type
Article
Copyright
© Cambridge University Press 2019 
Figure 0

Table 1. Chart for the sentence ‘neuro linguistic programming rocks’

Figure 1

Figure 1. CKY-based unsupervised Tree-LSTM network structure for the sentence ‘neuro linguistic programming rocks’.

Figure 2

Figure 2. Shift-reduce unsupervised Tree-LSTM network structure for the sentence ‘neuro linguistic programming rocks’, with a beam size of three.

Figure 3

Table 2. Test set accuracy (higher is better) on the SNLI data set, and number of parameters. We also report the number of intrinsic model parameters (excluding the number of word embedding parameters). Other models based on sentence embeddings are also reported

Figure 4

Table 3. Test set accuracy (higher is better) on the SNLI data set for the two attention models

Figure 5

Table 4. Median rank (lower is better) and accuracies (higher is better) at 10 and 100 on the three test sets for the reverse dictionary task: seen words (S), unseen words (U) and concept descriptions (C)

Figure 6

Figure 3. Median rank (lower figures are better) on the development data set for the reverse dictionary task. The CKY-based unsupervised Tree-LSTM requires fewer training examples for a given performance level.

Figure 7

Figure 4. Binary trees of SNLI sentences induced by the CKY-based model.

Figure 8

Figure 5. Binary trees of dictionary definitions induced by the CKY-based model.

Figure 9

Table 5. SNLI and MultiNLI (matched) test set accuracy. Results marked with * are for the more complex model variants with an extra leaf RNN transformation. We also report the performance of our models on the hard subsets of Gururangan et al.

Figure 10

Table 6. Unlabelled F1 scores of the development set trees induced by various models against: other runs of the same model, fully left- and right-branching trees, and Stanford parser trees provided with the data sets. Results marked with † are as reported in Williams et al. (2018); those marked with ‡ are from Yogatama et al. (2016); and those marked with * are for the more complex model variant with the leaf RNN transformation

Figure 11

Table 7. Unlabelled F1 scores of the development set trees induced by various models, similar to Table 6. Results are broken down by NLI gold label (entailment, neutral, contradiction) and by the correctness of the model’s prediction. We also report results for the trees in the hard data sets of Gururangan et al.