Abstract
Mechanistic interpretability has historically struggled to explain the internal dynamics of Recurrent Neural Networks (RNNs) due to the temporal evolution of their hidden states and the phenomenon of superposition. This paper introduces Episodic Memory Theory (EMT), a framework that treats RNNs as discrete-time versions of biological memory models. By identifying "variable memories"—linear subspaces within the hidden state—the authors demonstrate how to "de-superpose" RNN activity to reveal interpretable circuits that store and manipulate information over time.
Introduction
While static models like Transformers and MLPs have become increasingly transparent through mechanistic interpretability, Recurrent Neural Networks (RNNs) remain a "black box." In an RNN, task-relevant information is not a static feature but is stored in a hidden state that evolves at every timestep. This presents two primary hurdles:
- The Representation Problem: Information is often stored in "superposition," where many neurons collectively represent multiple features, appearing as noise to individual neuron analysis.
- The Temporal Problem: There is no established mathematical blueprint for how RNNs transition information from the past to the future to perform computations.
Episodic Memory Theory (EMT) addresses these challenges by bridging artificial neural networks with computational neuroscience memory models.
Methods: The EMT Framework
The EMT framework is built upon three core pillars:
- Mathematical Equivalence: The authors prove that a standard Elman RNN is topologically conjugate to a discretized version of the General Sequential Episodic Memory Model (GSEMM). This allows RNN weights to be interpreted as mechanisms for retrieving sequences of memories.
- Variable Memories: The theory defines "variable memories" as specific linear subspaces within the RNN's hidden state. These act as "slots" or "registers" for holding external information.
- The Privileged Basis (Algorithm 1): Using a novel algorithm, the researchers identify a "privileged basis"—a coordinate system for the hidden state. Viewing the RNN through this lens transforms complex weight matrices into clear circuits where information flow is visible.
Experimental Validation
The researchers tested EMT using four "Variable Binding" tasks ($T_1$ through $T_4$), such as Repeat Copy and Compose Copy. These controlled "toy tasks" allow for verification against a known "ground truth" circuit.
Key Results
- Convergence: Trained RNNs consistently converged to the theoretical EMT circuits. In tasks $T_2, T_3,$ and $T_4$, the Mean Absolute Error (MAE) between learned weights and the EMT-predicted weights was as low as 0.0005.
- Interpretability: By applying the privileged basis, researchers visualized the weight matrix $W_{hh}$, revealing a structured organization that represents the network copying information between memory slots.
- Accuracy: Models achieved near-perfect test accuracy (>0.94), confirming the functional correctness of the interpreted circuits.
Key Insights and Ideas
- Universality in Dynamics: Different RNN architectures and initializations converged to the same "variable binding circuit," suggesting an optimal recurrent strategy for memory tasks.
- Disentangling Superposition: The basis transformation revealed that seemingly random hidden state activity is actually a highly organized movement of variables through memory slots.
- The Role of the Eigenspectrum: Long-term memory is maintained by eigenvalues of the weight matrix located near the unit circle in the complex plane, representing stable, non-decaying memory components.
Limitations and Future Work
Despite its success, EMT currently has limitations. The theory is primarily optimized for linear systems; while it can be applied to non-linear RNNs (e.g., tanh) via linearization, a fully non-linear theory is still needed. Additionally, when the hidden state is too small for the task, networks resort to "bottleneck superposition," which the current EMT circuit does not fully capture. Future research will explore scaling the theory to large-scale RNNs used in natural language processing and complex time-series forecasting.
Summary updated