Linear Dynamical Systems as a Core Computational Primitive

Shiva KaulNeurIPS 2020

Nonlinear Recurrent Neural Networks (RNNs) have long been a staple of sequence modeling, but they are increasingly being replaced by Transformers and dilated convolutions. This shift is largely due to the inherent limitations of standard RNNs. This paper introduces LDStack, a novel method designed to approximate nonlinear RNNs using a stack of Linear Dynamical Systems (LDS). By shifting nonlinearity from the time dimension to the depth dimension, LDStack enables the parallel computation of sequences in $O(\log T)$ time, offering massive speedups over traditional sequential RNNs while maintaining mathematical tractability.

The Problem with Nonlinear RNNs

Despite their historical success, nonlinear RNNs suffer from two major flaws:

  1. Computational Bottlenecks: They are inherently sequential. To process a sequence of length $T$, the model must compute $T$ steps one after another, leading to $\Omega(T)$ time complexity. This sequential dependency makes them significantly slower than highly parallelizable architectures like Transformers or CNNs on modern hardware (GPUs).
  2. Analytical Opacity: Nonlinear systems act as "black boxes." It is notoriously difficult to prove that a nonlinear RNN will behave desirably, guarantee stability, or gain clear intuition about its internal state transitions.

This paper aims to "save" the RNN architecture by rebuilding it from linear primitives that are both exceptionally fast and mathematically well-understood.

The LDStack Approach

The authors propose a three-step construction to transform a slow, opaque nonlinear RNN into a fast, parallelizable linear stack:

1. Stacking for Nonlinearity

Instead of applying a nonlinear activation function at every time step, the authors approximate the RNN using a stack of Multiple-Input, Multiple-Output (MIMO) LDS. Each layer in the stack measures the "error"—the deviation of its linear step from the desired nonlinear target—and passes this residual as a correction to the next layer.

Geometric intuition of the LDStack error correction step across layers.

This effectively replaces nonlinearity across time with nonlinearity across depth. Because of the "Correct from the Start" property, the first layer gets the first time step correct, the second layer gets the first two steps correct, and so on. With sufficient layers, the stack exactly recovers the nonlinear RNN.

2. MIMO to SIMO Reduction

Because MIMO systems are complex and computationally heavy, the authors demonstrate that a MIMO LDS can be approximated by aggregating (averaging or concatenating) simpler Single-Input, Multiple-Output (SIMO) LDS.

Matrix structures illustrating the approximation of the system dynamics matrix A.

They justify this reduction using techniques from randomized numerical linear algebra (random projections) and control theory, specifically leveraging Luenberger canonical forms to structure the matrices efficiently.

3. Parallel Linear Recurrences (PLR)

Finally, the model utilizes a "scan and reduction" algorithm to run the SIMO LDS. Because the core operations are strictly linear, the state at any time $t$ can be computed in $O(\log T)$ parallel time, conceptually similar to calculating a parallel prefix sum.

Experimental Validation

The authors evaluated LDStack on three classic sequence modeling benchmarks: the Copy Memory Problem, Sequential Permuted MNIST (sPMNIST), and the Adding Problem.

Key Results

  • Massive Speedups: LDStack is significantly faster than traditional RNNs. On long sequences, it even outperforms highly optimized, fused CuDNN LSTM implementations. For example, on the sPMNIST benchmark, the LDS steps took 73ms compared to 324ms for an unfused RNN.
  • Parameter Efficiency: On the Copy Memory problem ($T=2000$), a simple unitary SIMO LDS achieved zero error using only 3,380 parameters. Standard RNNs typically struggle with this task or require vastly more parameters to solve it.
  • Competitive Accuracy: Despite relying on a much simpler linear primitive, LDStack achieved 91.8% accuracy on sPMNIST, remaining highly competitive with a standard LSTM (92.3%).

Insights and Future Directions

By using LDS as the core primitive, the model bridges deep learning with decades of research in control theory. The authors parameterize the LDS using complex eigenvalues (poles), allowing them to easily constrain the system to be stable (e.g., keeping eigenvalues on the unit circle). This is crucial for learning long-term dependencies without suffering from vanishing or exploding gradients, and it provides a way to interpret the network's memory characteristics.

While LDStack offers a compelling path forward, it does have limitations. Memory usage scales with the depth of the stack ($\Delta$), and the current parameter scaling of $O(n^2d)$ can be inefficient for very large input dimensions. Furthermore, while the forward pass avoids sequential bottlenecks, training still faces standard deep network optimization challenges. Future work will likely focus on developing custom CUDA kernels specifically optimized for these linear primitives to unlock even greater hardware performance.

Summary updated

BibTeX
@inproceedings{kaul2020linear,
  author = {Shiva Kaul},
  title = {{Linear Dynamical Systems as a Core Computational Primitive}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=8HIpBoQxKb},
}
Figure