TL;DR
The Non-local Recurrent Neural Memory (NRNM) is a novel memory module that enhances recurrent neural networks by capturing both local "full-order" interactions and global temporal dependencies. By combining the all-to-all modeling power of self-attention within sliding temporal blocks with a gated recurrent update mechanism, NRNM effectively overcomes the information dilution and gradient vanishing problems that plague standard LSTMs and GRUs.
What Problem Does This Paper Address?
Sequence representation learning—the backbone of tasks like video action recognition, sentiment analysis, and protein structure prediction—relies on capturing temporal dependencies. Traditional Recurrent Neural Networks (RNNs) and their gated variants (LSTMs, GRUs) typically model "one-order" interactions, meaning they explicitly relate a time step only to its immediate predecessor.
This creates a bottleneck: high-order interactions between non-adjacent time steps are not fully exploited. As a sequence grows longer, temporal information is diluted, and gradients vanish, making it nearly impossible for the model to "remember" crucial cues from the distant past. For example, in a video of someone slowly throwing a ball, a standard LSTM might focus too much on the final frames and fail to capture the long-range motion patterns necessary to distinguish a "throw" from a "reach" (see Figure 1).
Methods
The authors propose the Non-local Recurrent Neural Memory (NRNM), which can be integrated into existing recurrent backbones like LSTMs. Its architecture rests on two pillars:
- Block-wise Non-local Operations: Instead of looking only at the previous step, the NRNM cell uses a self-attention mechanism within a sliding temporal window (a "memory block"). This allows every time step within the block to interact with every other step, capturing high-resolution, full-order local dependencies.
- Gated Global Interactions: To maintain a global view across the entire sequence, the memory states are updated in a gated recurrent manner as the window slides. This is analogous to how an LSTM manages its internal cell state but applied to the distilled high-level features from the non-local blocks.
The NRNM cell (detailed in Figure 3) takes both the hidden states of the backbone and the raw input features to distill high-level memory embeddings. The authors also introduced a multi-scale dilated NRNM (Figure 4) that uses different strides to capture temporal features at varying granularities, much like dilated convolutions in CNNs.
Datasets
The model was evaluated across three distinct modalities to prove its generalization:
- Action Recognition: The NTU RGB+D dataset (using 3D skeleton joints) and the Charades dataset (using RGB features).
- Sentiment Analysis: The IMDB Review dataset, a standard benchmark for binary text classification.
- Protein Secondary Structure (PSS) Prediction: Using the CB6133 dataset for training and CB513, CASP10, and CASP11 for testing.
- Sequence Similarity Learning: A custom-constructed dataset based on pairs from the NTU skeleton data.
Key Insights and Ideas
- Enlarging the "Direct Interacting Field": In a standard LSTM, the "receptive field" for a hidden state is effectively 2 steps (current and previous). NRNM expands this to the size of the memory block, allowing the model to distill semantic features that are invisible to one-order models.
- Recurrence vs. Position Encoding: Interestingly, NRNM outperformed Transformers on the NTU dataset. The authors suggest that for certain sequence tasks, explicit recurrent structures are more effective at modeling global temporal dependencies than the position encodings used in pure attention models.
- Feature Distillation: NRNM acts as a "feature distiller" mounted on the backbone. By modeling high-order interactions, it extracts latent high-level features that standard RNNs miss due to information dilution.
Key Results
NRNM consistently outperformed standard recurrent baselines and SOTA methods across all tested applications:
- Action Recognition (NTU): Achieved 89.9% accuracy in the Cross-View setting, significantly higher than the LSTM baseline (84.0%) and other attention-enhanced LSTMs like EleAtt-LSTM (85.0%).
- Sentiment Analysis (IMDB): Reached 93.1% accuracy, surpassing specialized models like BCN+Char+CoVe (92.1%).
- Protein Prediction: Achieved 69.6% Q8 accuracy on the CB513 benchmark, outperforming specialized biological engineering models like DeepCNF and DCRNN.
- Efficiency: Despite the added complexity, NRNM is relatively efficient. On NTU, it achieved SOTA results with only 3.8M parameters, compared to the 82.3M parameters required by the Long-Term Feature Bank (LFB) model.
Limitations and Future Work
While NRNM shows strong performance on generic sequence data, the authors noted that on RGB video data (Charades), it performs slightly worse than models specifically optimized for video, such as SlowFast. This suggests that while NRNM is a powerful general-purpose sequence learner, task-specific architectural priors (like the dual-pathway approach in SlowFast) still hold an edge in specialized domains.
Future work could involve exploring more efficient non-local operations to handle even larger block sizes or integrating NRNM into different types of neural architectures beyond recurrent backbones.
Summary updated