[Paper Review] Reverse engineering recurrent neural networks with Jacobian switching linear dynamical systems
This paper introduces Jacobian Switching Linear Dynamical Systems (JSLDS), a co-trained framework that reverse engineers recurrent neural networks (RNNs) by learning fixed points and local linear approximations directly during training. By integrating a learnable auxiliary function with a switching linear system based on first-order Taylor expansions of the RNN, JSLDS eliminates post-training fixed point optimization, enables state-space-wide dynamics approximation, and regularizes RNNs toward solutions well-described by linearized dynamics around fixed points.
Recurrent neural networks (RNNs) are powerful models for processing time-series data, but it remains challenging to understand how they function. Improving this understanding is of substantial interest to both the machine learning and neuroscience communities. The framework of reverse engineering a trained RNN by linearizing around its fixed points has provided insight, but the approach has significant challenges. These include difficulty choosing which fixed point to expand around when studying RNN dynamics and error accumulation when reconstructing the nonlinear dynamics with the linearized dynamics. We present a new model that overcomes these limitations by co-training an RNN with a novel switching linear dynamical system (SLDS) formulation. A first-order Taylor series expansion of the co-trained RNN and an auxiliary function trained to pick out the RNN's fixed points govern the SLDS dynamics. The results are a trained SLDS variant that closely approximates the RNN, an auxiliary function that can produce a fixed point for each point in state-space, and a trained nonlinear RNN whose dynamics have been regularized such that its first-order terms perform the computation, if possible. This model removes the post-training fixed point optimization and allows us to unambiguously study the learned dynamics of the SLDS at any point in state-space. It also generalizes SLDS models to continuous manifolds of switching points while sharing parameters across switches. We validate the utility of the model on two synthetic tasks relevant to previous work reverse engineering RNNs. We then show that our model can be used as a drop-in in more complex architectures, such as LFADS, and apply this LFADS hybrid to analyze single-trial spiking activity from the motor system of a non-human primate.
Motivation & Objective
- To address the limitations of post-training fixed point analysis in reverse engineering RNNs, such as ambiguous fixed point selection and error accumulation in linear approximations.
- To develop a method that enables continuous, state-space-wide mapping of fixed points to local linear dynamics without relying on numerical optimization after training.
- To regularize RNN training such that the network's nonlinear dynamics are well-approximated by switching between linearizations around fixed points.
- To generalize switching linear dynamical systems (SLDS) to continuous manifolds of switching points while sharing parameters across switches.
- To enable the use of this framework in complex architectures like LFADS for analyzing neural spiking data.
Proposed method
- Co-train a standard RNN with a novel switching linear dynamical system (SLDS) that uses first-order Taylor expansions of the RNN's update function around learned fixed points.
- Introduce a learnable auxiliary function that predicts the RNN's fixed or slow points for any given state in the state space.
- Define a joint loss function that regularizes the SLDS to approximate the RNN’s dynamics and ensures switches occur at the predicted fixed points.
- Use the Jacobian of the RNN’s update function as the linear transition matrix in the SLDS, enabling local linear dynamics to reflect the RNN’s behavior near fixed points.
- Enable parameter sharing across switches by using a single set of linear parameters that are conditionally activated based on the auxiliary function’s output.
- Apply the framework end-to-end in architectures like GRUs and LFADS, allowing direct analysis of neural dynamics in single-trial spiking data.
Experimental results
Research questions
- RQ1Can a jointly trained SLDS model accurately approximate the nonlinear dynamics of an RNN without post-training fixed point optimization?
- RQ2Can a learnable auxiliary function map any point in the RNN’s state space to a corresponding fixed or slow point, enabling global dynamics interpretation?
- RQ3Does co-training with the JSLDS framework regularize the RNN toward solutions better described by switching between linearized dynamics around fixed points?
- RQ4Can the JSLDS framework be successfully integrated into complex architectures like LFADS to analyze real neural data?
- RQ5To what extent does the JSLDS improve the accuracy of linear approximations compared to standard reverse engineering methods?
Key findings
- The JSLDS framework successfully eliminates the need for post-training fixed point optimization, enabling direct, state-space-wide mapping of fixed points to linear dynamics.
- The model generalizes SLDS to continuous manifolds of switching points while maintaining a constant number of parameters, enabling efficient and scalable dynamics approximation.
- In synthetic tasks, the JSLDS achieved accurate reconstruction of RNN dynamics with significantly reduced error compared to standard linearization-based reverse engineering.
- On single-trial primate motor cortex spiking data, the LFADS-JSLDS hybrid revealed a single, condition-independent linear system governing movement dynamics, with eigenvalues and subspaces highly overlapping with jPCA results.
- The co-training process altered the fixed point structure of the RNN in the 3-bit memory task, leading to improved linearized dynamics approximation and evidence of regularization toward switching-linear solutions.
- The method demonstrated robustness in capturing dynamics across diverse tasks and architectures, including GRUs and LFADS, with consistent alignment between JSLDS eigenvalues and neural data analysis techniques like jPCA.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.