On Tree-Based Neural Sentence Modeling

Haoyue Shi, Hao Zhou, Jiaze Chen, Lei Li

Abstract

Does a neural network need to understand grammar to model a sentence? This paper suggests the answer is "not necessarily." By replacing complex linguistic syntax trees with "trivial" structures—like perfectly balanced or simple right-branching trees—the authors found that these simpler models often outperform state-of-the-art syntax-based encoders across a variety of NLP tasks.

Introduction

For years, the NLP community assumed that "Tree-LSTMs" succeeded because they mirrored the recursive, hierarchical nature of human language (syntax). By using a dependency or constituency tree as the network's "skeleton," researchers believed they were giving the model a helpful "inductive bias" about how words relate to one another.

However, some newer models that learned their own tree structures (latent trees) performed well even when the trees they produced looked nothing like human grammar. This raised a fundamental question: Is the performance boost in tree-based models actually coming from syntax, or is it just a side effect of the hierarchical structure itself? Shi et al. set out to isolate the "syntax" variable to see what truly drives performance.

Experimental Framework

The authors conducted a systematic comparison between a standard Bi-LSTM and five different tree-based encoder layouts:

  1. Parsing Trees: Standard binary constituency trees (the "linguistic" baseline).
  2. Gumbel Trees: Latent trees learned automatically via the Gumbel-Softmax trick.
  3. Balanced Trees: A "trivial" structure where the sentence is recursively split in half, ensuring the tree is as shallow as possible.
  4. Left-Branching Trees: A linear structure where words are added one by one from left to right.
  5. Right-Branching Trees: A linear structure where words are added from right to left.

To ensure a fair comparison, they used bi-leaf-RNNs, which process the input words with a bidirectional RNN before feeding them into the tree nodes. This ensures that even "trivial" trees have access to local context. They evaluated these encoders using a unified framework for classification, relation prediction, and generation.

Datasets and Tasks

The study utilized 10 diverse datasets categorized into three primary task groups:

  • Sentence Classification: AG’s News (AGN), Amazon Review Polarity (ARP), Amazon Review Full (ARF), DBpedia, and Word-Level Semantic Relation (WSR).
  • Sentence Relation: Stanford Natural Language Inference (SNLI) and Conjunction Prediction (Conj). These tasks typically involve comparing two sentences to determine their relationship.
  • Sentence Generation: Quora Paraphrasing (Para), English-Chinese Machine Translation (MT), and Auto-Encoding (AE).
Figure 2: The framework used for sentence relation tasks, where two sentences are encoded separately before being compared by a multi-layer perceptron.

Key Insights

Syntax is not the "Secret Sauce"

Surprisingly, trivial trees (especially balanced and right-branching ones) frequently outperformed actual linguistic parsing trees. This suggests that explicit syntactic guidance might be a distraction rather than a help for neural encoders.

The Proximity Principle

In generation tasks (like MT), the model must "bottleneck" the entire sentence into a single vector. The authors found that Right-Branching trees performed best here because they place the beginning of the sentence closer to the final root representation. Since the first words are often the most crucial for starting a translation correctly, "shortening the path" to those words improves performance.

Shallowness Matters

Balanced trees were the champions of classification. Because they are mathematically "shallow," the path from any word to the final representation is short. This reduces gradient vanishing/explosion issues and allows the model to treat all words "fairly," making it easier for the LSTM gates to pick out crucial information regardless of where it appears in the sentence.

Key Results

  • Classification: The Balanced Tree achieved the highest accuracy on 4 out of 5 classification tasks (e.g., 92.1% on AGN).
  • Generation: The Right-Branching Tree dominated, particularly in Machine Translation, achieving a BLEU score of 23.1, significantly higher than the Parsing Tree's 19.1 and the Bi-LSTM's 21.3.
  • Saliency Visualization: Using Jacobian-based saliency maps, the authors proved that Right-Branching models naturally "focus" on the start of the sentence, while Balanced trees distribute their attention more evenly, validating their structural hypotheses.

Discussion and Future Work

The authors acknowledge that while parsing trees didn't win, they aren't "useless"; they just might not be the most efficient structure for the way LSTMs process information. A notable limitation is that this study focuses on Tree-LSTMs. Since the publication of this paper, the Transformer architecture (which uses self-attention rather than explicit trees) has become the industry standard. A natural next step would be investigating whether these "trivial" structural priors could be used to improve or explain the success of Transformer-based models, or if the "proximity principle" still holds in non-recurrent architectures.

Summary updated

BibTeX
@inproceedings{shi2018tree,
  author = {Haoyue Shi and Hao Zhou and Jiaze Chen and Lei Li},
  title = {{On Tree-Based Neural Sentence Modeling}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1492},
}
Figure