Long Expressive Memory for Sequence Modeling

T. Konstantin Rusch, Siddhartha Mishra, N. Benjamin Erichson, Michael W. Mahoney

TL;DR

Long Expressive Memory (LEM) is a new recurrent neural network architecture that solves the classic "stability vs. expressivity" trade-off in sequence modeling. By discretizing a system of multiscale ordinary differential equations (ODEs), LEM effectively mitigates exploding and vanishing gradients while remaining powerful enough to outperform LSTMs and GRUs on complex tasks like language modeling and long-term time-series prediction.

What Problem Does This Paper Address?

Recurrent Neural Networks (RNNs) are the workhorses of sequential data, but they face a fundamental hurdle: the exploding and vanishing gradient problem. When processing very long sequences, the gradients used for training either blow up or disappear, making it nearly impossible to learn long-term dependencies.

Existing solutions usually fall into two camps:

  1. Gating Mechanisms (e.g., LSTMs, GRUs): These use "gates" to protect the gradient flow, but they can still suffer from instability and struggle with extremely long sequences.
  2. Structural Constraints: Some models force weight matrices to be orthogonal or unitary to ensure stability. While this prevents gradient issues, it often "lobotomizes" the model, reducing its expressivity—its ability to learn complex, nuanced patterns.

The authors seek a "Goldilocks" architecture: one that is mathematically guaranteed to be stable over long horizons without sacrificing the raw learning power needed for tasks like natural language processing.

Methods

The core innovation of LEM is its foundation in multiscale Ordinary Differential Equations (ODEs).

Instead of designing a black-box update rule, the authors started with a continuous-time system that models "fast" and "slow" variables interacting at different scales—similar to how biological neurons (like the famous Hodgkin-Huxley model) operate. To turn this into a deep learning model, they applied a specific numerical technique called an Implicit-Explicit (IMEX) time-discretization.

The resulting LEM architecture features:

  • Dual Hidden States: It maintains two states ($y_n$ and $z_n$) that represent different temporal scales.
  • Adaptive Gating: The "scales" are not hard-coded; the model learns them adaptively based on the input and current state.
  • Theoretical Guarantees: The authors provide rigorous proofs showing that LEM's hidden states remain bounded and that it can approximate a massive class of dynamical systems to high accuracy.

Datasets

The authors evaluated LEM across a diverse battery of benchmarks to test both long-term memory and high-level expressivity:

  • Synthetic: The "Adding Problem" with sequence lengths up to $N=10,000$.
  • Image Recognition: Sequential MNIST (sMNIST), Permuted MNIST (psMNIST), and Noisy CIFAR-10.
  • Genomics/Biological: The EigenWorms dataset, featuring extremely long sequences (length ~18,000).
  • Healthcare: Heart-rate prediction using PPG (photoplethysmogram) data.
  • Physical Systems: Predicting the FitzHugh-Nagumo system (a multiscale dynamical system).
  • Speech: Google12 (V2) keyword spotting.
  • Language Modeling: The Penn Tree Bank (PTB) corpus at both the character and word levels.

Key Insights and Ideas

  • Multiscale is Natural: Real-world data (like language or heart rates) doesn't happen at just one speed. By explicitly modeling multiple time scales, LEM can "zoom in" on immediate changes while "zooming out" to remember context from thousands of steps ago.
  • Stability via Discretization: The paper shows that the way you turn a continuous ODE into a discrete computer algorithm matters. The IMEX scheme is the "secret sauce" that keeps the gradients healthy.
  • Universal Approximation: Unlike some stable RNNs that are limited in what they can represent, the authors prove that LEM is a "universal approximator" for dynamical systems. This explains why it doesn't just work on simple memory tasks but also excels at complex language modeling.
  • Power-Law Decay: Analysis of the learned scales shows that LEM often learns a power-law distribution of time scales, suggesting it naturally finds the most efficient way to represent information across different temporal resolutions.

Key Results

LEM consistently outperformed or matched state-of-the-art (SOTA) models across the board:

  • The Adding Problem: On the hardest version ($N=10,000$), LEM was one of the only models to beat the baseline, converging faster than specialized "long-memory" models like chrono-LSTM.
Training curves for the Adding Problem across sequence lengths N=2000, 5000, and 10000. LEM converges faster and more reliably than other models.
  • Image Recognition: LEM achieved top-tier performance on sequential image classification tasks, demonstrating its ability to handle complex, high-dimensional inputs over long sequences.
Test accuracy on sequential MNIST, permuted MNIST, and noisy CIFAR-10. LEM achieves state-of-the-art results.
  • EigenWorms: LEM achieved 92.3% accuracy, surpassing the previous SOTA (UnICORNN at 90.3%) and obliterating standard LSTMs (38.5%).
  • Language Modeling: On the PTB word-level task, LEM reached a test perplexity of 72.8, a massive improvement over the standard LSTM (116.9) and even specialized models like TARNN (94.6).
  • Efficiency: LEM achieves these results with a parameter count comparable to a standard LSTM, meaning it doesn't require massive hardware overhead to gain these benefits.

Limitations and Future Work

While LEM shows remarkable robustness, the authors note a few areas for further exploration:

  • Hyperparameter Tuning: While a default $\Delta t = 1$ works well for many tasks, some extremely long-sequence tasks (like EigenWorms) require tuning this parameter to very small values (e.g., $1.6 \times 10^{-3}$).
  • Mechanistic Understanding: While the multiscale resolution clearly helps, the precise mathematical mechanism of how these learned scales enable superior performance on non-explicitly multiscale data (like text) warrants deeper investigation.
  • Scaling Up: The experiments focused on single-layer models to ensure a fair comparison of architectures; testing LEM in massive, multi-layer transformer-scale setups remains a future frontier.

Summary updated

BibTeX
@inproceedings{rusch2022long,
  author = {T. Konstantin Rusch and Siddhartha Mishra and N. Benjamin Erichson and Michael W. Mahoney},
  title = {{Long Expressive Memory for Sequence Modeling}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=QoV3s3iQph},
}
Figure