Generalized Teacher Forcing for Learning Chaotic Dynamics

Florian Hess, Zahra Monfared, Manuel Brenner, Daniel Durstewitz

TL;DR

Training neural networks to model chaotic systems is notoriously difficult because gradients explode as trajectories diverge. This paper introduces Generalized Teacher Forcing (GTF), a simple interpolation technique that provably bounds gradients. When paired with a tractable RNN architecture, GTF allows low-dimensional, interpretable models to faithfully reconstruct complex real-world dynamics like heart and brain activity.

The Challenge of Learning Chaos

The "butterfly effect" is the hallmark of chaotic dynamical systems (DS): tiny changes in initial conditions lead to exponentially different outcomes. When researchers attempt to train Recurrent Neural Networks (RNNs) to reconstruct these systems using standard Backpropagation Through Time (BPTT), they hit a mathematical wall. Because chaotic trajectories inherently diverge, the gradients used for learning explode.

Most existing solutions attempt to fix this by heavily constraining the network's architecture (using LSTMs or GRUs). However, these constraints often "tame" the network so much that it loses the capacity to represent chaos at all. The authors argue that the root problem isn't the architecture, but the training algorithm. Their goal is to train models that are both mathematically tractable (interpretable) and capable of capturing the long-term "geometry" (attractors) of chaotic data without gradient explosion.

The Solution: Generalized Teacher Forcing

The authors propose two main innovations to tackle this problem:

1. Generalized Teacher Forcing (GTF) Traditional teacher forcing replaces a model's predicted state with the actual ground truth at every time step. GTF instead uses linear interpolation: $$\tilde{z}_t = (1 - \alpha)z_t + \alpha \bar{z}_t$$ where $z_t$ is the predicted state, $\bar{z}_t$ is the target, and $\alpha$ is a forcing parameter.

The principle of GTF: interpolating between predicted and data-inferred states to keep training on track.

By choosing the right $\alpha$, the authors mathematically prove that the product of Jacobians (the engine of the gradient) remains bounded. This effectively "reins in" the diverging trajectories during training. They also introduce Adaptive GTF (aGTF), an algorithm that automatically tunes $\alpha$ during training—starting with strong forcing and gradually relaxing it as the model learns the underlying dynamics.

2. Shallow PLRNN (shPLRNN) To ensure the resulting model is interpretable, the authors rearrange a Piecewise-Linear RNN into a one-hidden-layer structure. This "tractable" model allows researchers to semi-analytically calculate fixed points and limit cycles, making it far more useful for scientific insight than a standard "black box" neural network.

Key Insights and Results

The paper highlights a deep connection between chaos theory and deep learning: the condition for exploding gradients in an RNN is mathematically identical to the condition for chaos in the system it is trying to model. Unlike previous methods that limit network weights to prevent explosions, GTF allows the network to stay chaotic while keeping the learning process stable.

The method was evaluated on synthetic benchmarks (Lorenz-63, Lorenz-96) and challenging real-world data:

  • ECG (Electrocardiogram): Human heart muscle potential.
  • EEG (Electroencephalogram): Brain activity recorded via 64 electrodes, which is notoriously difficult due to high noise and multiple time scales.

A major breakthrough was the power of low-dimensional representations. Using GTF, the authors successfully reconstructed the 64-channel EEG data using only 16 latent variables. Competing state-of-the-art methods required hundreds of dimensions and still frequently failed to capture the system's long-term behavior.

Quantitative comparison across datasets. shPLRNN + GTF shows superior performance in reconstructing attractors (lower D_stsp and D_H).

As shown in the results, the shPLRNN trained with GTF consistently outperformed state-of-the-art methods like LSTMs, Reservoir Computing, SINDy, and Neural ODEs. On real-world EEG and ECG data, GTF-trained models achieved significantly lower state-space divergence ($D_{stsp}$) and temporal error ($D_H$), often by nearly an order of magnitude. In many cases, they were the only models able to reconstruct the long-term geometric structure of the data without collapsing into a single point or diverging to infinity.

Limitations and Future Directions

While GTF is theoretically general, the authors found it worked best with the shPLRNN architecture. Implementing it effectively for deeper networks or those with different activation functions (like tanh) may require further research. Additionally, the method requires mapping observations back into the model's latent space; while a simple linear model worked for these tasks, more complex systems might necessitate Invertible Neural Networks (INNs).

Ultimately, GTF presents a powerful new tool not just for chaotic reconstruction, but potentially for broader time-series tasks where long-term dependencies cause gradient issues.

Summary updated

BibTeX
@inproceedings{hess2023generalized,
  author = {Florian Hess and Zahra Monfared and Manuel Brenner and Daniel Durstewitz},
  title = {{Generalized Teacher Forcing for Learning Chaotic Dynamics}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=eyTrDtchE1},
}
Figure