Non-Local Recurrent Neural Memory for Supervised Sequence Modeling

Canmiao Fu, Wenjie Pei, Qiong Cao, Chaopeng Zhang, Yong Zhao, Xiaoyong Shen, Yu-Wing Tai

Abstract

Traditional Recurrent Neural Networks (RNNs) are limited by their focus on one-order interactions, often failing to capture long-range dependencies in complex sequences. We present the Non-local Recurrent Neural Memory (NRNM), a novel architecture that integrates self-attention into a sliding temporal block. By modeling high-order interactions between non-adjacent time steps, NRNM effectively captures long-term relational context. Evaluated on action recognition and sentiment analysis tasks, NRNM significantly outperforms standard LSTM and GRU baselines.

Introduction

Standard recurrent neural networks (RNNs), including LSTMs and GRUs, are designed to process sequences step-by-step. While effective, they have a fundamental limitation: they primarily model one-order interactions—the relationship between the current state and the immediately preceding one. As sequences grow longer, these models suffer from "information dilution" and gradient vanishing. High-level features that emerge from the interaction of distant time steps (e.g., the beginning and end of a complex physical action) are often lost. NRNM addresses this by incorporating non-local operations to distill high-level features from distant interactions.

Methods

The NRNM framework introduces a specialized cell that augments a standard LSTM backbone. The core innovation lies in the Non-local Memory Block, which uses a self-attention mechanism to model interactions across all hidden states and inputs within a specific temporal window.

The NRNM architecture utilizes a sliding window to maintain a memory stream parallel to the standard LSTM stream.

As shown in the architecture diagram, the memory block slides across the sequence with a defined block size ($k$) and stride ($s$). A gated update mechanism ensures that the memory state ($M_t$) remains temporally consistent. Crucially, a memory gate ($g_m$) allows the distilled high-order features to refine the internal cell state ($C_t$) of the backbone LSTM, guiding the recurrent process with global context.

Key Insights and Results

The model was evaluated on two distinct sequence modeling tasks: NTU RGB+D for 3D skeleton-based action recognition and the IMDB Review dataset for sentiment analysis.

NRNM (ours) significantly outperforms standard RNN, GRU, and LSTM architectures on the NTU-CS action recognition benchmark.

Performance Benchmarks

On the NTU dataset, NRNM achieved 80.8% (Cross-Subject) and 89.2% (Cross-View) accuracy, significantly outperforming the baseline LSTM (70.3% and 84.0% respectively). On the IMDB dataset, the model reached 93.1% accuracy, surpassing several state-of-the-art methods. Qualitative analysis showed that NRNM successfully identified complex actions, such as "walking towards each other," where standard LSTMs failed due to the long-term tracking required.

Structural Findings

  • The "Goldilocks" Block Size: Performance increases with block size ($k$) up to a point (around 8 steps), after which it declines. This suggests that while non-local interactions are vital, too large a window introduces noise and information redundancy.
  • Middle-Layer Integration: NRNM performs best when integrated into the middle layer of a stacked LSTM. Researchers hypothesize that the first layer's features are too low-level and the third layer's are too abstracted, making the middle layer the ideal location for distilling high-order temporal features.

Conclusion

NRNM successfully bridges the gap between the structured temporal flow of RNNs and the relational modeling power of self-attention. While it introduces some computational overhead and requires hyperparameter tuning for block size, its ability to capture high-order interactions makes it a powerful tool for complex sequence modeling in video and text domains. Future work may explore more sophisticated ways of selecting information for the memory block beyond simple sliding windows.

Summary updated

BibTeX
@inproceedings{fu2019non,
  author = {Canmiao Fu and Wenjie Pei and Qiong Cao and Chaopeng Zhang and Yong Zhao and Xiaoyong Shen and Yu-Wing Tai},
  title = {{Non-Local Recurrent Neural Memory for Supervised Sequence Modeling}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00641},
}
Figure