Paper commentary
Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks
Tree-structured LSTMs beat sequential LSTMs on sentence meaning tasks
- Problem Sequential LSTMs read a sentence along one chain, so its syntactic grouping of words is not built in. It was unclear whether tree-shaped composition would give better sentence vectors.
- Method Tree-LSTM generalizes the LSTM to trees, so each unit reads several child units instead of one predecessor. It gives each child its own forget gate.
- Results The Constituency Tree-LSTM reached 51.0 fine-grained accuracy on Stanford Sentiment Treebank, above the best listed prior system at 49.8.
Why sentence structure matters for LSTM encoders
Sentence representations are usually built in one of three ways: by averaging word vectors, by running a sequence model over the tokens, or by composing vectors along a syntactic tree. Averaging discards word order, so sentences that differ only in which noun acts on which is invisible to such a model.
Recurrent networks read input of arbitrary length, but a plain recurrent transition struggles with long-distance dependencies because gradients grow or decay exponentially over long sequences. The LSTM addresses this with a memory cell that can keep state over long spans, and it has been applied widely to sequence tasks. A sequence model still propagates information along a single chain, so any phrase structure must be inferred from word order.
The open question, which this work tests directly, is whether a tree-shaped topology gives better sentence vectors than a sequential LSTM.
Tree-LSTM units with several children
A Tree-LSTM unit j takes an input vector x_j and the hidden states and memory cells of its children, so its gates depend on the whole set of children rather than on one predecessor. Instead of one forget gate, each child k gets its own forget gate f_jk, which lets the unit decide how much of each child's memory to keep.
The Child-Sum variant first sums the child hidden states into \( \tilde{h}_j = \sum_{k \in C(j)} h_k \), and the input, output and candidate gates are computed from that sum. Each child's forget gate is computed from its own hidden state, and the memory cell is updated as \( c_j = i_j \odot u_j + \sum_{k \in C(j)} f_{jk} \odot c_k \), so the number of children can vary freely.
The N-ary variant suits trees with ordered children and a bounded branching factor N. Each child position has its own weight matrices, so the forget gate for child k combines the states of all N positions through a separate matrix for each pair of positions. This allows finer control, for example a verb phrase child can be kept while a noun phrase child is forgotten, but the off-diagonal matrices become impractical for large N, where the authors suggest tying or fixing them.
The Dependency Tree-LSTM applies the Child-Sum unit to dependency trees, where each node takes the vector of its head word as input. The Constituency Tree-LSTM applies the binary N-ary unit to binarized constituency trees, where only leaf nodes receive word vectors and the left and right children have separate parameters.
Classifier and relatedness heads
For sentiment, a softmax layer on the hidden state of each labeled node predicts its class, and training minimizes the negative log-likelihood of the gold labels plus an L2 penalty. For relatedness, the two sentence vectors h_L and h_R are combined by an elementwise product \( h_{\times} = h_L \odot h_R \) and an elementwise absolute difference, and a sigmoid layer and softmax then give a distribution over the scores 1 to K.
The predicted score is the expectation \( \hat{y} = r^{T}\hat{p}_\theta \), with \( r^{T} = [1\ 2\ \ldots\ K] \). The training target is a sparse distribution whose expectation equals the gold rating: its mass is split between the two integers that bracket the rating, in proportion to how close the rating lies to each. The loss is a regularized KL divergence between that target and the predicted distribution, and the authors report that this objective performed better than a mean squared error objective.
Data, parameter matching and training
Sentiment experiments use the Stanford Sentiment Treebank, with 6920/872/1821 train/dev/test sentences for the binary subtask and 8544/1101/2210 for the five-class subtask. The binary subtask has fewer examples because neutral sentences are excluded from it.
Relatedness uses SICK, with 9927 sentence pairs split 4500/500/4927 into train, dev and test, and each relatedness score is an average of 10 annotator ratings on a 1 to 5 scale.
To compare structures at similar capacity, the memory dimension of each LSTM variant was set so that its parameter count stays close to the others. For the standard LSTM the memory dimension is 150 with 203,400 parameters on relatedness and 168 with 315,840 parameters on sentiment; the Constituency Tree-LSTM has 142 and 205,190 on relatedness and 150 and 316,800 on sentiment.
Word vectors are 300-dimensional GloVe vectors, updated during sentiment training at a learning rate of 0.1 and held fixed for relatedness, where tuning gave no significant improvement.
Sentiment results on the Stanford Sentiment Treebank
The Constituency Tree-LSTM with tuned GloVe vectors reached 51.0 fine-grained accuracy, averaged over 5 runs, above the Bidirectional LSTM at 49.1 and the DRNN at 49.8, the highest listed prior system. On the binary subtask the same model reached 88.0, which is comparable to the best listed prior results rather than clearly above them. The plain LSTM reached 46.4 fine-grained and 84.9 binary, below the tree models in the same table.
With randomly initialized vectors the Constituency Tree-LSTM drops to 43.9 fine-grained and 82.0 binary, so its strength depends on the pretrained vectors. With GloVe vectors held fixed it reached 49.7 fine-grained and 87.5 binary.
The Dependency Tree-LSTM scored 48.4 fine-grained and 85.7 binary, below the constituency model on both. The authors attribute part of this gap to training data: about 150K labeled nodes for the dependency model against 319K for the constituency model. They also point to dependency representations having fewer nodes, and to about 9% of dependency nodes that could not be matched to a labeled span in the training data.
Updating the word vectors during training gave a larger boost on fine-grained classification than on the binary subtask. The authors expect this because the GloVe vectors were not trained to capture sentiment.
Relatedness results on SICK
The strongest sequential model was the Bidirectional LSTM, at 0.8567, 0.7966 and 0.2736 on the same three measures.
The Constituency Tree-LSTM reached Pearson’s r of 0.8582, above every sequential variant on that measure and tied with the Bidirectional LSTM on Spearman’s ρ at 0.7966. The non-LSTM baselines were lower: mean vectors reached 0.7577, while DT-RNN and SDT-RNN reached 0.7923 and 0.7900.
Among the SemEval 2014 systems listed, ECNU reached 0.8414 and the Meaning Factory 0.8268, and the models in the table use no additional feature engineering. The authors note that their ECNU figure is stronger than the team's submitted system, which scored 0.8280 Pearson correlation.
Both tree models receive supervision only at the root in this task, unlike sentiment, where intermediate nodes are also labeled. The authors conjecture that the dependency model benefits from shorter paths between input words and the root, which the compact dependency structure provides.
Sentence length and tree advantage
The hypothesis is that tree structure eases the problem of preserving state over long word sequences, so the gain over sequential LSTMs should be largest on longer sentences. The length analysis bins sentences for both tasks, and for relatedness each point is the Pearson correlation over pairs whose mean length falls in a window.
The Dependency Tree-LSTM outperforms its sequential counterparts on relatedness for pairs of length 13 to 15, and it also performs consistently well on shorter pairs. The authors read this as evidence that tree structure encodes useful structural information in the representations, not only a remedy for length.
Length is measured as the mean length of the two sentences in a pair, so the analysis does not give a per-sentence comparison.
What the relatedness rankings show
For the query about a boy waving at runners from the ocean, the word ocean sits at depth 4 in the dependency parse, yet the retrieved sentences are all related to ocean, which the authors read as the tree model keeping information from relatively distant nodes.
Limits of the evidence
The sentiment gap between the two tree models is confounded by training-node counts, about 150K against 319K, so the authors do not isolate the cause. The node-count explanation is partial, and the authors also cite the unmatched dependency nodes, which they estimate at about 9%.
The experiments use two benchmarks, the Stanford Sentiment Treebank and SICK, and relatedness uses fixed word vectors because tuning gave no significant improvement.
The best sentiment result comes from a constituency tree and the best relatedness result from a dependency tree, so no single tree type is shown to be best on both tasks.
Paper info
- Authors
- Kai Sheng Tai, Richard Socher, Christopher D. Manning
- Venue
- arXiv · Preprint
- First published
- 2015-2-28
- Added
- 2026-11-12
- Updated
- 2015-5-30
- Version
- v3
- arXiv
- 1503.00075
- Category
- cs.CL · cs.AI · cs.LG
- 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
Kai Sheng Tai, Richard Socher, Christopher D. Manning (2015). Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks. arXiv:1503.00075v3. https://arxiv.org/abs/1503.00075v3
BibTeX
@misc{tai2015improved,
title = {{Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks}},
author = {Kai Sheng Tai and Richard Socher and Christopher D. Manning},
year = {2015},
eprint = {1503.00075},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1503.00075v3}
}