[Paper Review] RRA: Recurrent Residual Attention for Sequence Learning
This paper proposes RRA, a recurrent residual attention mechanism that enhances long-range sequence modeling by introducing attention-over-residual connections across multiple timesteps in RNNs. By enabling direct error back-propagation through these residual paths and learning dynamic attention weights over past hidden states, RRA achieves faster convergence, more stable training, and superior performance over standard LSTMs on sequence tasks like MNIST and IMDB sentiment analysis.
In this paper, we propose a recurrent neural network (RNN) with residual attention (RRA) to learn long-range dependencies from sequential data. We propose to add residual connections across timesteps to RNN, which explicitly enhances the interaction between current state and hidden states that are several timesteps apart. This also allows training errors to be directly back-propagated through residual connections and effectively alleviates gradient vanishing problem. We further reformulate an attention mechanism over residual connections. An attention gate is defined to summarize the individual contribution from multiple previous hidden states in computing the current state. We evaluate RRA on three tasks: the adding problem, pixel-by-pixel MNIST classification and sentiment analysis on the IMDB dataset. Our experiments demonstrate that RRA yields better performance, faster convergence and more stable training compared to a standard LSTM network. Furthermore, RRA shows highly competitive performance to the state-of-the-art methods.
Motivation & Objective
- Address the gradient vanishing problem in RNNs when learning long-range dependencies across timesteps.
- Overcome the limitation of standard RNNs and LSTMs in explicitly capturing semantic relationships between non-adjacent sequence elements.
- Introduce a novel attention mechanism over residual connections across multiple timesteps to improve error back-propagation and context modeling.
- Demonstrate that RRA outperforms standard LSTMs and achieves competitive results with state-of-the-art methods on sequence learning benchmarks.
- Provide a more flexible and parameter-efficient alternative to existing methods that use higher-order recurrence or global attention in RNNs.
Proposed method
- Introduce residual connections across timesteps in RNNs, allowing direct back-propagation of training error signals from current to distant hidden states.
- Reformulate the residual function to include attention over multiple past hidden states: $\mathbf{h}_t = \mathcal{M}(\mathbf{x}_t, \mathbf{h}_{t-1}) + \mathcal{F}(\mathbf{h}_{t-2}, \mathbf{h}_{t-3}, \dots, \mathbf{h}_{t-K-1}; \mathbf{W}_a)$, where $\mathcal{F}$ applies learned attention weights $\mathbf{W}_a$.
- Define an attention gate that dynamically controls the relative contribution of each past hidden state to the current state, enabling selective focus on semantically relevant long-range dependencies.
- Use a differentiable attention mechanism over residual connections, allowing end-to-end training via back-propagation through time (BPTT).
- Maintain a standard RNN cell for $\mathcal{M}(\mathbf{x}_t, \mathbf{h}_{t-1})$ while adding the attention-weighted residual component.
- Visualize attention weights to analyze how the model learns to attend to relevant past timesteps, such as capturing dependencies between non-adjacent words in a sentence.
Experimental results
Research questions
- RQ1Can residual connections across timesteps improve gradient flow and alleviate vanishing gradients in RNNs?
- RQ2Can attention over multiple past hidden states enhance modeling of long-range dependencies in sequential data?
- RQ3Does the proposed RRA mechanism lead to faster convergence and more stable training compared to standard LSTMs?
- RQ4How does RRA perform relative to state-of-the-art methods on sequence learning tasks without pre-training or word embeddings?
- RQ5To what extent can RRA capture semantic dependencies between non-adjacent elements in sequences, such as pronouns and their antecedents?
Key findings
- RRA achieves faster convergence and more stable training than standard LSTM networks on the adding problem, pixel-by-pixel MNIST, and IMDB sentiment analysis.
- On the adding problem, RRA successfully learns long-range dependencies that standard LSTMs struggle with, particularly when the gap between relevant inputs is large.
- On pixel-by-pixel MNIST, RRA achieves higher test accuracy than LSTM, demonstrating improved generalization and sequence modeling capability.
- On the IMDB sentiment analysis task, RRA shows competitive performance to state-of-the-art methods, even without using word2vec embeddings or pre-training.
- Visualization of attention weights shows that RRA learns to assign higher importance to semantically relevant past timesteps, such as attending to 'girl' when predicting 'her' in a sentence.
- Despite slightly slower training speed (e.g., 760s per epoch on permuted MNIST with K=5), RRA reaches convergence earlier than LSTM when early stopping is applied, indicating better sample efficiency.
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.