[Paper Review] The Importance of Being Recurrent for Modeling Hierarchical Structure
This paper investigates whether recurrent neural networks (LSTMs) outperform non-recurrent transformers (FANs) in modeling hierarchical linguistic structures. Using subject-verb agreement and logical inference tasks, the authors show that LSTMs consistently generalize better to longer sequences and are more robust to misleading features, demonstrating that recurrency is crucial for capturing hierarchical dependencies even when non-recurrent models are more computationally efficient.
Recent work has shown that recurrent neural networks (RNNs) can implicitly capture and exploit hierarchical information when trained to solve common natural language processing tasks such as language modeling (Linzen et al., 2016) and neural machine translation (Shi et al., 2016). In contrast, the ability to model structured data with non-recurrent neural networks has received little attention despite their success in many NLP tasks (Gehring et al., 2017; Vaswani et al., 2017). In this work, we compare the two architectures---recurrent versus non-recurrent---with respect to their ability to model hierarchical structure and find that recurrency is indeed important for this purpose.
Motivation & Objective
- To evaluate whether recurrent architectures like LSTMs are better than non-recurrent transformers (FANs) at implicitly modeling hierarchical structure in sequential data.
- To assess the generalization capability of LSTMs and FANs on tasks requiring nested syntactic or logical dependencies.
- To determine if the computational efficiency of non-recurrent models comes at the cost of hierarchical structure understanding.
- To investigate whether explicit supervision or language modeling pretraining improves hierarchical structure capture in both architectures.
Proposed method
- The study compares LSTMs and FANs (a non-recurrent transformer variant) on two controlled NLP tasks: subject-verb agreement and logical inference.
- For subject-verb agreement, models are trained on next-word prediction or explicit number prediction, with performance measured by accuracy across varying syntactic distances.
- For logical inference, models encode premise-hypothesis pairs using either LSTM or FAN encoders, followed by a feed-forward classifier for 7-way relation prediction.
- FANs use learnable query vectors to pool sentence representations into fixed-size vectors via multi-head self-attention.
- Hyperparameters are tuned via grid search, and models are optimized with Adam; word and output embeddings are shared.
- Experiments are conducted on both full datasets and subsets with limited logical operators to test generalization to longer sequences.
Experimental results
Research questions
- RQ1Does recurrency provide a significant advantage over non-recurrent attention mechanisms in modeling hierarchical linguistic structure?
- RQ2How do LSTMs and FANs compare in generalizing to longer sequences in tasks requiring nested syntactic or logical dependencies?
- RQ3Is explicit supervision more effective than language modeling pretraining for capturing hierarchical structure in both architectures?
- RQ4How robust are LSTMs and FANs to misleading syntactic features in subject-verb agreement tasks?
Key findings
- LSTMs outperform FANs in subject-verb agreement, especially on longer syntactic distances, when trained with either language modeling or explicit supervision.
- On the logical inference task, LSTMs generalize significantly better than FANs when trained on shorter sequences (≤6 logical operators), achieving higher accuracy on longer test sequences (6 < n ≤ 12).
- FANs perform comparably to LSTMs when trained on the full dataset, but their performance degrades sharply when generalizing to longer sequences.
- LSTMs show greater robustness to misleading features in the subject-verb agreement task, maintaining higher accuracy across varying distances and attractor counts.
- The results indicate that recurrency is a key factor in capturing hierarchical structure, even when non-recurrent models are more computationally efficient.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.