Continuous Memory Machines

Ciaran Regan, Kai Arulkumaran, Luke Darlow, Stefania Druga, Sebastian Risi, Llion JonesarXiv 2026

TL;DR

Continuous Memory Machines (CMM) introduce a dual-memory recurrent architecture that explicitly separates short-term neural dynamics from long-term persistent storage. By utilizing a shared Transformer to manage bidirectional interactions between these matrix-valued states, CMM achieves state-of-the-art generalization and reasoning capabilities across algorithmic, in-context learning, and spatial reasoning tasks.

What Problem Does This Paper Address?

Traditional Recurrent Neural Networks (RNNs) typically compress an entire sequence history into a single hidden vector. This creates a fundamental bottleneck: the same representation must simultaneously handle rapid, short-term computation and stable, long-term information retention. While Transformers dominate sequence processing, they often struggle with explicit state tracking and reasoning over long horizons.

Drawing inspiration from biology—specifically the Complementary Learning Systems framework, which posits that the brain uses distinct systems for fast hippocampal learning and slow neocortical storage—the authors seek to bridge this gap. They address the question: Can we combine the rich short-term dynamics of specialized neuron-level models with the robust storage capabilities of memory-augmented architectures?

Methods

The CMM builds upon the Continuous Thought Machine (CTM) but adds a persistent, addressable memory component. Its architecture consists of three main pillars:

  1. Matrix-Valued States: Instead of vectors, CMM maintains two matrices: a Short-Term Memory (STM), which is a sliding window of recent neural activity, and a Long-Term Memory (LTM), which acts as a persistent store.
  2. Joint Memory Update: At each timestep, a shared Transformer block processes the STM and LTM together. This allows for a bidirectional "read-write" mechanism: the STM can retrieve information from the LTM, and the LTM can be updated or reorganized based on recent STM activity. A "sink token" is included to allow the model to ignore irrelevant information.
  3. Neuron-Level Models (NLMs): After the Transformer update, the STM is passed through uniquely parameterized NLMs. Each "neuron" independently learns to process its own activation history, allowing the network to discover diverse temporal features.
Figure 1: The Continuous Memory Machine. At timestep t, the current observation ot and previous activated state zt are processed by the feedforward synapse model to produce a pre-activated state at. This state is appended to the sliding short-term memory (STM) At. At and the long-term memory Bt are jointly processed by a Transformer, producing updated memories ˜At and ˜Bt. ˜At is passed through the neuron-level models to produce the next activated state zt+1. From the activated-state history, the model computes the synchronization St+1 and output yt+1. At, ˜Bt = Bt+1, and zt+1 are carried forward to the next iteration.

Datasets

The authors evaluated CMM against a wide array of baselines (including LSTMs, DNCs, and RMTs) using:

  • Algorithmic Tasks: Copy, Associative Recall, Priority Sort, and Parity.
  • Recurrent Reasoning: A complex 39x39 maze-solving task requiring the prediction of a full action sequence.
  • In-Context Learning: Few-shot linear regression (meta-learning).
  • Image Classification: ImageNet-100, using a frozen ViT backbone to test how the model gathers visual information over time.

Key Insights and Ideas

  • Separation of Concerns: The LTM handles the "what" (storing and reordering data), while the STM and NLMs handle the "how" (extracting temporal features and performing computation).
  • Task-Dependent Flexibility: Analysis of attention patterns reveals that CMM learns when to use its LTM. In algorithmic tasks like sorting, it relies heavily on LTM; in reasoning tasks like mazes, it often bypasses LTM to focus on immediate spatial computation via the STM.
  • Superior Generalization: Unlike many memory-augmented networks that fail when sequence lengths increase beyond their training data, CMM exhibits robust out-of-distribution generalization, particularly in sorting and maze-solving.
  • Interpretability: By using "synchronization" (pairwise correlations between neurons) as a latent state, the model produces interpretable attention maps, such as "looking around" a maze to find a path.

Key Results

  • Algorithmic Mastery: CMM achieved near-zero loss on Copy, Recall, and Sort tasks where standard RNNs and even some MANNs struggled. On the Priority Sort task, CMM outperformed the Differentiable Neural Computer (DNC) and the standard Transformer.
  • Length Generalization: When trained on sorting sequences of length 16 and tested on length 50, CMM maintained 72.1% accuracy, significantly higher than RMT (68.2%) and DNC (55.8%).
Figure 3: The CMM generalizes best on sort.
  • Maze Solving: CMM increased full-maze accuracy from the CTM's 37.4% to 61.6%, showing a particular advantage on longer, more complex paths.
Table 1: Maze-solving test accuracy.
  • Few-Shot Learning: In regression tasks with 20 support examples, CMM reached 30.63% accuracy, nearly tripling the performance of the original CTM (8.78%).

Limitations and Future Work

  • Computational Overhead: The joint STM-LTM update via a Transformer at every timestep increases memory and compute requirements compared to simpler RNNs.
  • Parallelism: Like all recurrent models, CMM faces challenges with training parallelism compared to purely feedforward architectures.
  • Future Directions: The authors suggest exploring selective memory updates—running the Transformer update only every few steps or when triggered—to reduce the computational cost without sacrificing the benefits of persistent storage.

Summary updated

BibTeX
@misc{regan2026continuous,
  author = {Ciaran Regan and Kai Arulkumaran and Luke Darlow and Stefania Druga and Sebastian Risi and Llion Jones},
  title = {{Continuous Memory Machines}},
  year = {2026},
  eprint = {2610.07907},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.07907},
}
Figure