Abstract
Recurrent neural networks (RNNs) are wide-spread machine learning tools for modeling sequential and time series data. They are notoriously hard to train because their loss gradients backpropagated in time tend to saturate or diverge during training. This is known as the exploding and vanishing gradient problem. Previous solutions to this issue either built on rather complicated, purpose-engineered architectures with gated memory buffers, or - more recently - imposed constraints that ensure convergence to a fixed point or restrict (the eigenspectrum of) the recurrence matrix. Such constraints, however, convey severe limitations on the expressivity of the RNN. Essential intrinsic dynamics such as multistability or chaos are disabled. This is inherently at disaccord with the chaotic nature of many, if not most, time series encountered in nature and society. It is particularly problematic in scientific applications where one aims to reconstruct the underlying dynamical system. Here we offer a comprehensive theoretical treatment of this problem by relating the loss gradients during RNN training to the Lyapunov spectrum of RNN-generated orbits. We mathematically prove that RNNs producing stable equilibrium or cyclic behavior have bounded gradients, whereas the gradients of RNNs with chaotic dynamics always diverge. Based on these analyses and insights we suggest ways of how to optimize the training process on chaotic data according to the system's Lyapunov spectrum, regardless of the employed RNN architecture.
Introduction
Recurrent Neural Networks (RNNs) are essential for time-series modeling, yet their training is plagued by the Exploding and Vanishing Gradient Problem (EVGP). When backpropagating errors through time (BPTT), gradients often diminish to zero or escalate to infinity, hindering the learning of long-term dependencies. While architectural innovations like LSTMs or weight constraints (e.g., orthogonality) offer partial solutions, they often come at the cost of "expressivity." Specifically, these constraints can prevent an RNN from capturing chaotic dynamics, which are ubiquitous in natural systems like weather patterns, brain activity, and financial markets. This paper bridges dynamical systems theory and deep learning to explain why chaos and stable gradients are often mutually exclusive and proposes a novel training strategy to overcome this.
Theoretical Linkage: Gradients and the Lyapunov Spectrum
The core contribution of this work is a rigorous mathematical proof relating the product of Jacobians used in BPTT to the Lyapunov spectrum of the dynamical system. Lyapunov exponents measure the rate of divergence or convergence of nearby trajectories. The authors demonstrate that if an RNN converges to a stable fixed point or limit cycle, gradients remain bounded. However, for chaotic dynamics—characterized by at least one positive Lyapunov exponent—the gradients are mathematically guaranteed to diverge exponentially as the state separation $T$ increases.
This insight reveals that standard gradient clipping is merely a "band-aid." While it prevents numerical overflow, it truncates the very information required to learn the complex "folds" and "stretches" of a chaotic attractor.
Sparsely Forced BPTT
To address the EVGP without sacrificing the model's ability to represent chaos, the authors introduce Sparsely Forced BPTT. Instead of standard BPTT or continuous "Teacher Forcing," this method recalibrates the RNN’s hidden state using ground-truth data only at discrete intervals, denoted as $\tau$.
The selection of $\tau$ is not arbitrary. The authors suggest it should be aligned with the system's predictability time ($\tau_{pred} = \ln 2 / \lambda_{max}$), where $\lambda_{max}$ is the maximal Lyapunov exponent. By limiting the backpropagation window to the duration over which the system is naturally predictable, the training process captures essential dynamics before the gradients become numerically unstable.
Experimental Results and Validation
The proposed method was tested on several benchmark chaotic systems, including the Lorenz, Duffing, and Rössler systems, as well as high-dimensional Mackey-Glass equations. It was also applied to real-world datasets, such as Jena weather station temperatures and human EEG recordings.
The effectiveness of the reconstruction was evaluated using metrics like "Attractor Overlap" ($D_{stsp}$) and "Power Spectrum Similarity" ($D_H$). Across various architectures—including vanilla RNNs, LSTMs, and Piecewise-Linear RNNs (PLRNNs)—the results consistently showed that the best performance occurred when the forcing interval $\tau$ was near the theoretical predictability time $\tau_{pred}$.
Conclusion
This research provides a theoretical foundation for understanding the challenges of training RNNs on chaotic data. By linking gradient behavior to the Lyapunov spectrum, the authors offer a principled way to optimize training. Sparsely forced BPTT emerges as an architecture-agnostic strategy that preserves the expressivity needed for scientific machine learning while maintaining numerical stability. Future work may explore annealing the forcing interval to further enhance the capture of multi-scale dynamics.
Summary updated