Towards Scalable and Stable Parallelization of Nonlinear RNNs

Xavier Gonzalez, Andrew Warrington, Jimmy T. H. Smith, Scott W. Linderman
7/26/2024
cs.LG

No official code found. Best implementation: lindermanlab/elk (31 stars, BSD-3-Clause, last commit 2026-03-06).

Abstract

Transformers and linear state space models can be evaluated in parallel on modern hardware, but evaluating nonlinear RNNs appears to be an inherently sequential problem. Recently, however, Lim et al. '24 developed an approach called DEER, which evaluates nonlinear RNNs in parallel by posing the states as the solution to a fixed-point problem. They derived a parallel form of Newton's method to solve the fixed-point problem and achieved significant speedups over sequential evaluation. However, the computational complexity of DEER is cubic in the state size, and the algorithm can suffer from numerical instability. We address these limitations with two novel contributions. To reduce the computational complexity, we apply quasi-Newton approximations and show they converge comparably to Newton, use less memory, and are faster. To stabilize DEER, we leverage a connection between the Levenberg-Marquardt algorithm and Kalman smoothing, which we call ELK. This connection allows us to stabilize Newton's method while using efficient parallelized Kalman smoothing algorithms to retain performance. Through several experiments, we show that these innovations allow for parallel evaluation of nonlinear RNNs at larger scales and with greater stability.

View on arXivView PDF

Code Implementations(1)

lindermanlab/elkCommunity100%
BSD-3-Clause

Scalable and Stable Parallelization of Nonlinear RNNS

311Python, Jupyter NotebookNov 19, 20247 months agoBSD-3-Clause

Similar Papers

Cite this paper

@article{gonzalez2024towards,
  title  = {Towards Scalable and Stable Parallelization of Nonlinear RNNs},
  author = {Xavier Gonzalez and Andrew Warrington and Jimmy T. H. Smith and Scott W. Linderman},
  year   = {2024},
  eprint = {2407.19115},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2407.19115},
  url    = {http://arxiv.org/abs/2407.19115v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.19115.svg)](https://codeofpaper.com/paper/2407.19115)

Discussion