NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Episodic Memory Theory of Recurrent Neural Networks: Insights into Long-Term Information Storage and Manipulation

Arjun Karuvally, Peter DelMastro, Hava T Siegelmann

Abstract

Recurrent neural networks (RNNs) have emerged as powerful models capable of storing and manipulating external information over long periods in various domains. Yet, the mechanisms that underly this behavior remain a mystery due to the black-box nature of these models. This paper addresses this question by proposing an episodic memory theory of RNN dynamics, enabling a more comprehensive understanding of the RNN weights as memories and inter-memory interactions. This approach sheds light on the inner workings of RNNs and connects to existing research on memory representation and organization. The theory extends the current linearization approaches by providing alternative interpretations of the eigenspectrum and its connection to the long-term storage and manipulation of information. We discuss how the segregation, representation, and composition of the variable binding problem—a fundamental question in cognitive science and artificial intelligence—can be mechanistically interpreted within the theory. Using an elementary task - repeat copy, we demonstrate the validity of the theory in experimental settings. Our work represents a step towards opening the black box of RNNs, offering new insights into their functionality and bridging the gap between recurrent neural networks and memory models.

Introduction

Recurrent Neural Networks (RNNs) are fundamental to sequence modeling, yet their internal operations often remain "inscrutable." The high-dimensional non-linear dynamics of their hidden states make it difficult to understand how information is stored or retrieved over time. A core challenge in this domain is the variable binding problem: the mechanism by which a network takes external information (a "variable") and "binds" it to a specific slot for subsequent manipulation. This paper proposes an episodic memory theory to bridge the gap between connectionist neural networks and symbolic memory models, effectively turning the RNN "black box" into a structured, transparent memory system.

Theoretical Framework: RNNs as Episodic Memory

The authors demonstrate that a standard Elman RNN is mathematically equivalent—specifically, topologically conjugate—to a General Sequential Episodic Memory Model (GSEMM). This framework allows for a mechanistic interpretation of RNN dynamics through several key steps:

  1. Linearization and Fixed Points: By analyzing the RNN around its fixed points, the system is treated as a linear dynamical system, making its high-dimensional transitions more tractable.
  2. Memory Decomposition: Using a basis change inspired by Dirac notation, the hidden weight matrix ($W_{hh}$) is decomposed into a set of "stored memories" ($\Xi$) and an "interaction matrix" ($\Phi$). This interaction matrix dictates how memories transition or "shift" over time.
  3. Variable Binding via Subspaces: The theory posits that "binding" a variable involves allocating a specific geometric direction (a subspace) in the hidden state.
Mechanistic interpretation of RNN dynamics as episodic memory operations: (A) interaction via the Φ operator, (B) writing external information, and (C) reading/output phase.

Experimental Validation: The Repeat Copy Task

To validate the theory, the authors utilize elementary tasks like the Repeat Copy Task. In this task, the network receives a sequence of vectors, stores them, and must output the identical sequence after a delay. This provides a "ground truth" to verify if the network's internal logic aligns with the proposed memory model.

Mapping the symbolic 'Repeat Copy' algorithm to RNN operations, highlighting the write, compose, and read phases.

The analysis reveals "conveyor belt" dynamics: the RNN creates a series of subspaces and "shifts" information from one to the next at each timestep, functioning like a high-dimensional circular buffer. By projecting the hidden states onto the calculated "variable memory basis," researchers can clearly visualize the input being written into specific slots and moving through the network.

Key Insights and Results

The research successfully "decoded" trained RNNs, revealing that their weights function as a structured repository. Key findings include:

  • Spectral Signatures: The eigenspectrum of trained weights shows eigenvalues clustered on the unit circle, which serves as a mathematical signature of the network's internal "clock" or shifting mechanism.
  • Weights as Memory Banks: Weights are reinterpreted as structured repositories where columns represent individual "episodes" or memories.
  • Geometric Retrieval: The study demonstrates that we can move away from treating RNNs as black boxes and start viewing them as dynamic, geometric memory retrievers.

Conclusion and Future Directions

This episodic memory theory offers a path toward transparency in recurrent architectures. While robust for deterministic tasks like Repeat Copy, future work is required to scale this analysis to stochastic environments, complex natural language tasks, and the highly non-linear regimes found in massive modern models. Testing whether these "variable memory subspaces" remain clean and separable in large-scale models remains a crucial next step.

Summary updated

BibTeX
@inproceedings{karuvally2023episodic,
  author = {Arjun Karuvally and Peter DelMastro and Hava T Siegelmann},
  title = {{Episodic Memory Theory of Recurrent Neural Networks: Insights into Long-Term Information Storage and Manipulation}},
  booktitle = {TAGML @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=PYoEjBFAIM},
}
Figure