[Paper Review] Quantifying the vanishing gradient and long distance dependency problem in recursive neural networks and recursive LSTMs
This paper investigates the vanishing gradient and long-distance dependency problems in recursive neural networks (RNNs) and recursive LSTMs (RLSTMs) using a controlled artificial task. By generating synthetic sentences with labeled keywords at varying depths in parse trees, the authors demonstrate that RLSTMs significantly outperform RNNs in capturing long-range dependencies and transmitting error signals, with gradient ratios indicating stable backpropagation even at depths up to 13.
Recursive neural networks (RNN) and their recently proposed extension recursive long short term memory networks (RLSTM) are models that compute representations for sentences, by recursively combining word embeddings according to an externally provided parse tree. Both models thus, unlike recurrent networks, explicitly make use of the hierarchical structure of a sentence. In this paper, we demonstrate that RNNs nevertheless suffer from the vanishing gradient and long distance dependency problem, and that RLSTMs greatly improve over RNN's on these problems. We present an artificial learning task that allows us to quantify the severity of these problems for both models. We further show that a ratio of gradients (at the root node and a focal leaf node) is highly indicative of the success of backpropagation at optimizing the relevant weights low in the tree. This paper thus provides an explanation for existing, superior results of RLSTMs on tasks such as sentiment analysis, and suggests that the benefits of including hierarchical structure and of including LSTM-style gating are complementary.
Motivation & Objective
- To investigate whether recursive LSTMs (RLSTMs) overcome the vanishing gradient and long-distance dependency problems more effectively than standard recursive neural networks (RNNs).
- To isolate and quantify the impact of hierarchical structure and LSTM gating on gradient flow and dependency capture.
- To develop a controlled artificial learning task that enables precise measurement of model performance across varying tree depths and keyword positions.
- To analyze backpropagated error signal magnitudes using gradient norm ratios between keyword nodes and root nodes as a diagnostic tool.
- To explain the empirical superiority of RLSTMs in NLP tasks like sentiment analysis through systematic analysis of gradient dynamics.
Proposed method
- Designed an artificial task where sentences are sequences of integers, with one keyword (value < 1000) determining the label (keyword // 100), and parse trees are binary and randomly generated.
- Used a binary tree structure with controlled depth to vary the distance between the keyword leaf and the root node, enabling systematic evaluation of long-range dependency.
- Implemented both RNN and RLSTM models with 50-dimensional word and memory vectors, using tanh activation and Xavier initialization.
- Trained models using AdaGrad with learning rate 0.05 and mini-batch sizes of 20 (RNN) and 5 (RLSTM), evaluating performance across 10 datasets with increasing keyword depth.
- Calculated the ratio of gradient norm at the keyword node to that at the root node during backpropagation to quantify signal strength and detect vanishing/exploding gradients.
- Used boxplots and line graphs to visualize model accuracy and gradient ratio trends across training epochs and increasing tree depths.
Experimental results
Research questions
- RQ1Does the RLSTM model mitigate the vanishing gradient problem more effectively than the RNN across increasing tree depths?
- RQ2Can the RLSTM capture long-range dependencies in parse trees more reliably than the RNN when the keyword is located deep in the tree?
- RQ3Is the ratio of gradient norms between the keyword node and the root node a reliable indicator of backpropagation effectiveness in hierarchical models?
- RQ4To what extent do hierarchical structure and LSTM-style gating jointly improve performance on tasks requiring long-distance information flow?
- RQ5Does the RNN’s performance degrade significantly with increasing depth, even after extended training, due to persistent gradient vanishing?
Key findings
- The RNN model achieves high accuracy (above 90%) when the keyword is within depth 3, but performance drops sharply to near-random levels (around 10%) at depths 9–10, indicating severe long-range dependency failure.
- The RLSTM maintains test accuracy above 90% up to depth 8, and remains significantly above random baseline (10%) even at depths 12 and 13, demonstrating robust long-range dependency capture.
- Gradient ratio analysis shows that the RNN suffers from severe gradient vanishing, with ratios consistently below 0.01 at depths 10–13, indicating poor error signal transmission.
- In contrast, the RLSTM exhibits stable gradient ratios that remain above 0.1 even at depth 13, with initial gradient explosion in early epochs followed by stabilization, indicating effective error signal propagation.
- The RLSTM’s gradient ratio stabilizes in parallel with its development accuracy, suggesting that the model learns to strengthen the connection between the keyword and the root node over time.
- The ratio of gradient norms between keyword and root nodes is a strong diagnostic indicator of backpropagation success, with values below 0.01 signaling vanishing gradients and values above 1 indicating explosion.
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.