Skip to main content
QUICK REVIEW

[Paper Review] Tree-structured Attention with Hierarchical Accumulation

Xuan-Phi Nguyen, Shafiq Joty|arXiv (Cornell University)|Feb 19, 2020
Topic ModelingComputer Science15 references26 citations
TL;DR

This paper proposes Tree-Structured Attention with Hierarchical Accumulation, a method that integrates constituency parse trees into the Transformer's self-attention mechanism using constant parallel time complexity. By aggregating descendant representations through hierarchical embeddings, cumulative averaging, and weighted aggregation, the model achieves state-of-the-art performance on machine translation and text classification tasks, particularly excelling in low-resource settings and favoring phrase-level attention.

ABSTRACT

Incorporating hierarchical structures like constituency trees has been shown to be effective for various natural language processing (NLP) tasks. However, it is evident that state-of-the-art (SOTA) sequence-based models like the Transformer struggle to encode such structures inherently. On the other hand, dedicated models like the Tree-LSTM, while explicitly modeling hierarchical structures, do not perform as efficiently as the Transformer. In this paper, we attempt to bridge this gap with "Hierarchical Accumulation" to encode parse tree structures into self-attention at constant time complexity. Our approach outperforms SOTA methods in four IWSLT translation tasks and the WMT'14 English-German translation task. It also yields improvements over Transformer and Tree-LSTM on three text classification tasks. We further demonstrate that using hierarchical priors can compensate for data shortage, and that our model prefers phrase-level attentions over token-level attentions.

Motivation & Objective

  • To address the limitation of standard Transformers in encoding hierarchical syntactic structures like constituency trees.
  • To overcome the sequential computation bottleneck of Tree-LSTM while preserving structural inductive bias.
  • To enable scalable, parallelizable tree-encoding within the Transformer framework using constant time complexity.
  • To evaluate the effectiveness of hierarchical priors in low-resource NLP scenarios.
  • To analyze attention patterns and determine whether the model favors phrase-level or token-level attention.

Proposed method

  • The model uses hierarchical embeddings to encode sibling and hierarchical relationships between nodes in a parse tree.
  • It performs upward cumulative-average aggregation of hidden states from all descendants to form value representations for nonterminal nodes.
  • A weighted aggregation mechanism combines branch-level representations into a final value for each nonterminal node.
  • Subtree masking restricts attention scores to only activate when the key is a descendant of the query, enforcing structural consistency.
  • The method is integrated into the Transformer architecture, maintaining attention computation at constant parallel time complexity.
  • The model processes all nodes in the tree simultaneously, enabling scalability and efficient training/inference.

Experimental results

Research questions

  • RQ1Can hierarchical tree structures be encoded into self-attention with constant time complexity?
  • RQ2Does incorporating constituency parse trees improve performance on machine translation and text classification tasks?
  • RQ3How does the model perform under data-scarce conditions, and can hierarchical priors compensate for limited labeled data?
  • RQ4Does the model exhibit a preference for phrase-level attention over token-level attention?
  • RQ5How does the model's training and inference efficiency compare to recurrent tree models like Tree-LSTM?

Key findings

  • The Tree-Transformer outperforms the Transformer and Tree-LSTM on four IWSLT and one WMT’14 English-German translation tasks, with gains of up to 3.3 BLEU on small datasets.
  • On text classification, the model achieves 47.4% accuracy on SST-5, outperforming the Transformer and Tree-LSTM, especially in low-resource settings.
  • The model shows a consistent preference for phrase-level attention, with 59–66% of attention heads attending to nonterminal nodes rather than leaves, regardless of leaf/node ratio.
  • On the WMT’14 English-German task, the model improves by 3.3 BLEU when training data is under 1 million pairs, demonstrating strong data efficiency.
  • Training and inference times remain nearly constant with sequence length, unlike Tree-LSTM, which scales linearly, confirming the model’s parallelizability and scalability.
  • Ablation studies show that removing hierarchical embeddings or subtree masking reduces performance by 0.49 to 0.52 BLEU, confirming both components are essential.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.