Abstract
Recurrent Neural Networks (RNNs) are powerful tools for reconstructing dynamical systems from time-series data. However, vanilla RNNs struggle with long-range dependencies due to vanishing gradients, while gated architectures like LSTMs lack the mathematical transparency needed for rigorous scientific analysis. We present a novel regularization technique for Piecewise-Linear RNNs (PLRNNs) that induces "line attractors" in a subset of hidden units. This Manifold Attractor Regularization enables the capture of multiple time scales and long-term memory while preserving the interpretability of the underlying dynamical system. Our regularized PLRNN (rPLRNN) outperforms LSTMs on standard benchmarks and successfully reconstructs complex biophysical models.
Introduction
In the natural sciences, researchers often seek to reverse-engineer the mathematical equations governing observed time-series data, such as neural activity or atmospheric patterns. While RNNs are theoretically universal approximators of such dynamical systems, they face a significant practical hurdle: the "vanishing and exploding gradients" problem. This issue prevents vanilla RNNs from learning long-term dependencies. While LSTMs and GRUs mitigate this, their complex gating mechanisms act as "black boxes," making it difficult to extract meaningful scientific insights like fixed points or bifurcations. This work introduces a method to build RNNs that are both mathematically interpretable and capable of capturing long-range dependencies.
Methods: Manifold Attractor Regularization
The proposed model builds upon Piecewise-Linear RNNs (PLRNNs), which utilize ReLU activation functions. The piecewise-linear nature of these networks allows for the analytical calculation of fixed points and stability, providing a level of interpretability not found in gated architectures.
To solve the memory problem, we introduce Manifold Attractor Regularization. Instead of modifying the architecture, a specific penalty is added to the loss function during training. This penalty is applied to a subset of the hidden units, pushing their weights toward an identity mapping. In dynamical systems terms, this creates a "line attractor"—a configuration where the system can integrate inputs and maintain memory indefinitely.
This approach offers a "division of labor": regularized units handle slow, long-term dependencies, while non-regularized units model fast, complex dynamics. Mathematically, this regularization bounds the network's gradients, formally preventing them from vanishing or exploding.
Results
The regularized PLRNN (rPLRNN) was evaluated on both machine learning benchmarks and complex dynamical systems tasks.
Performance on Long-Range Dependencies
On standard tests like the Addition and Multiplication problems, the rPLRNN demonstrated superior performance compared to LSTMs and orthogonal RNNs. As shown in the figure below, the rPLRNN maintains high accuracy even as the sequence length ($T$) increases, whereas other architectures see a sharp decline in performance. The large error bars at certain transition points reflect the model's "all-or-none" learning behavior on these benchmarks. Notably, the rPLRNN achieved these results with approximately four times fewer trainable parameters than a comparable LSTM.
Reconstructing Complex Dynamics
The model's ability to capture multiple time scales was tested using a bursting cortical neuron model, which features fast voltage spikes on top of slow oscillations. While standard PLRNNs and orthogonal RNNs failed to capture this behavior, the rPLRNN successfully reconstructed the system's geometry, accurately modeling both high-frequency (>50 Hz) and low-frequency (≤50 Hz) components.
Discussion
By employing soft regularization rather than hard architectural constraints, the rPLRNN can learn arbitrarily slow time scales rather than just static memory. This flexibility, combined with the inherent interpretability of the PLRNN framework, allows researchers to not only predict future states but also to reconstruct the underlying physical laws of a system. Future work may explore extending this manifold attractor regularization to other network architectures to further enhance their scientific utility.
Summary updated