Learning Dynamics of RNNs in Closed-Loop Environments
Yoav Ger, Omri Barak
TL;DR
The paper develops a mathematical theory for the learning dynamics of linear RNNs operating in closed-loop environments, showing that closed-loop training follows distinct trajectories from open-loop training due to the coupled agent–environment spectrum of the system matrix $\mathbf{P}$. It demonstrates a fundamental trade-off between short-term policy improvement and long-term stability, which organizes learning into three stages and a sequence of spectral transitions, including a dominant complex-conjugate pair and a slower real mode. By deriving a low-dimensional effective model $\mathbf{P}_{\mathrm{eff}}$ under rank-1 connectivity, the authors connect high-dimensional RNN dynamics to tractable analytic predictions that capture stage transitions, zig-zag optimization, and the emergence of internal world models. The results generalize to multi-frequency tracking tasks and align with human motor-learning patterns, highlighting the importance of closed-loop dynamics for biologically plausible learning and offering a framework for interpreting internal representations and spectral shifts during training.
Abstract
Recurrent neural networks (RNNs) trained on neuroscience-inspired tasks offer powerful models of brain computation. However, typical training paradigms rely on open-loop, supervised settings, whereas real-world learning unfolds in closed-loop environments. Here, we develop a mathematical theory describing the learning dynamics of linear RNNs trained in closed-loop contexts. We first demonstrate that two otherwise identical RNNs, trained in either closed- or open-loop modes, follow markedly different learning trajectories. To probe this divergence, we analytically characterize the closed-loop case, revealing distinct stages aligned with the evolution of the training loss. Specifically, we show that the learning dynamics of closed-loop RNNs, in contrast to open-loop ones, are governed by an interplay between two competing objectives: short-term policy improvement and long-term stability of the agent-environment interaction. Finally, we apply our framework to a realistic motor control task, highlighting its broader applicability. Taken together, our results underscore the importance of modeling closed-loop dynamics in a biologically plausible setting.
