Skip to main content
QUICK REVIEW

[Paper Review] Resurrecting Recurrent Neural Networks for Long Sequences

Antonio Orvieto, Samuel Smith|arXiv (Cornell University)|Mar 11, 2023
Neural Networks and ApplicationsComputer Science43 citations
TL;DR

The paper shows that a deep RNN architecture with Linear Recurrent Units (LRUs), through careful linearization, diagonalization, stable initialization, and normalization, can match deep state-space models on long-range sequence tasks like Long Range Arena while maintaining training efficiency.

ABSTRACT

Recurrent Neural Networks (RNNs) offer fast inference on long sequences but are hard to optimize and slow to train. Deep state-space models (SSMs) have recently been shown to perform remarkably well on long sequence modeling tasks, and have the added benefits of fast parallelizable training and RNN-like fast inference. However, while SSMs are superficially similar to RNNs, there are important differences that make it unclear where their performance boost over RNNs comes from. In this paper, we show that careful design of deep RNNs using standard signal propagation arguments can recover the impressive performance of deep SSMs on long-range reasoning tasks, while also matching their training speed. To achieve this, we analyze and ablate a series of changes to standard RNNs including linearizing and diagonalizing the recurrence, using better parameterizations and initializations, and ensuring proper normalization of the forward pass. Our results provide new insights on the origins of the impressive performance of deep SSMs, while also introducing an RNN block called the Linear Recurrent Unit that matches both their performance on the Long Range Arena benchmark and their computational efficiency.

Motivation & Objective

  • Motivate investigation into using RNNs for long-range sequence modeling where Transformers and SSMs have shown strengths.
  • Identify whether deep RNNs can match deep SSMs on long-range tasks.
  • Isolate and ablate architectural and initialization choices that impact long-range reasoning in RNNs.
  • Provide a principled, scalable RNN design (LRU) that achieves competitive performance and efficiency on long sequences.

Proposed method

  • Compare vanilla RNNs with SSMs like S4 on the Long Range Arena benchmark.
  • Replace SSM layers with linear RNN layers and stack nonlinear MLP blocks to form the Linear Recurrent Unit (LRU).
  • Demonstrate that removing nonlinearities in the recurrence can improve performance in deep architectures.
  • Introduce complex diagonal recurrent matrices and an exponential parameterization to stabilize learning and enable long-range modeling.
  • Apply normalization of hidden activations to stabilize training on very long-range tasks.
  • Provide ablations showing the impact of diagonalization, initialization spectra, and normalization on task performance.
Figure 1: (Left) Deep Linear Recurrent Unit (LRU) architecture introduced in this paper, inspired by S4 (Gu et al., 2021a ) . The model is a stack of LRU blocks, with nonlinear projections in between, and also uses skip connections and normalization methods like batch/layer normalization. We expand
Figure 1: (Left) Deep Linear Recurrent Unit (LRU) architecture introduced in this paper, inspired by S4 (Gu et al., 2021a ) . The model is a stack of LRU blocks, with nonlinear projections in between, and also uses skip connections and normalization methods like batch/layer normalization. We expand

Experimental results

Research questions

  • RQ1Can deep RNNs match the performance of deep continuous-time SSMs on long-range reasoning tasks?
  • RQ2What architectural and initialization changes are necessary to achieve SSM-like performance with RNNs?
  • RQ3Does linear recurrence with appropriate diagonalization and normalization enable efficient training for long sequences?
  • RQ4How do stabilization strategies for eigenvalues affect long-range dependency learning in LRUs?

Key findings

  • A deep linear recurrence without recurrence nonlinearities can outperform nonlinear RNN variants on several Long Range Arena tasks.
  • Diagonalizing the recurrence with complex-valued diagonal matrices speeds up training and can match S4/S5 performance on LRA tasks.
  • An exponential parameterization of the diagonal spectrum enables stable training and improves long-range reasoning, especially on harder tasks like Pathfinder.
  • Normalization of hidden activations during forward passes is crucial to close the gap to deep SSMs on long-range tasks.
  • When initialized with a spectrum near the unit disk and with normalization, LRUs achieve competitive performance with deep SSMs on LRA benchmarks.
Figure 4: Evolution of $x\in\mathbb{R}^{3}$ under impulse input $u=(1,0,0,\dots,0)\in\mathbb{R}^{16k}$ . Plotted in different colors are the 3 components of $x$ . $\Lambda$ has parameters $\nu_{j}=0.00005$ and $\theta_{j}$ sampled uniformly in $[0,2\pi]$ or with small phase $[0,\pi/50]$ . For small
Figure 4: Evolution of $x\in\mathbb{R}^{3}$ under impulse input $u=(1,0,0,\dots,0)\in\mathbb{R}^{16k}$ . Plotted in different colors are the 3 components of $x$ . $\Lambda$ has parameters $\nu_{j}=0.00005$ and $\theta_{j}$ sampled uniformly in $[0,2\pi]$ or with small phase $[0,\pi/50]$ . For small

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.