Sakana AI's CMM Beats Rivals on Memory Tasks With 61.6% Maze Accuracy
Sakana AI extends the Continuous Thought Machine with separate short- and long-term memory stores, plus a plasticity variant that rewires weights during inference.
Takeaways
- Sakana AI released the Continuous Memory Machine, extending the CTM with separate short- and long-term stores.
- A Transformer jointly updates both memory stores, allowing bidirectional read-write and self-reorganization.
- CMM raises maze accuracy from CTM's 37.4% to 61.6% and hits 72% on out-of-distribution sort.
- The companion Plastic CTM drives inference-time weight changes using neural synchronization.
- Plastic CTM beats MAML on 5-way 1-shot CIFAR-FS (60%) and MiniImageNet (52%).
- Code for both projects open-sourced at SakanaAI/continuous-memory-machines and SakanaAI/plastic-rnns.
Sakana AI has released two extensions to its CTM paper, which introduced the biologically inspired Continuous Thought Machine. Both address the architecture’s limited memory: a CTM retains only a short window of neuron activity, restricting how long it can preserve information and adapt during inference, when a trained model processes new inputs.
The CMM paper adds a persistent long-term store and a Transformer that moves information between long- and short-term memory. The Plastic CTM instead updates temporary model weights according to which neurons activate together. Sakana AI evaluated the approaches against 21 baselines across dozens of tasks and released the code, benchmarks, and tuning scripts.
The CTM’s short-memory ceiling
Each CTM neuron uses its own multilayer perceptron, or MLP, to map a history of activity to its next activation. The model represents information through synchronization between pairs of neurons over time rather than through individual activations alone. Those dynamics have produced interpretable attention patterns on tasks such as maze solving.
The architecture compresses its recent activation history into a decaying summary, leaving no persistent store for information needed much later. The complementary learning systems hypothesis in neuroscience predicts a similar tension: rapid encoding can interfere with stable retention when both depend on one memory system. Biological brains address that tension through faster hippocampal learning and slower neocortical learning.
Two stores, one Transformer
The Continuous Memory Machine retains the CTM’s short-term matrix of pre-activations, which are neuron inputs recorded before the next update, and adds a matrix of long-term memory tokens. Those tokens persist across recurrent processing steps.
At each step, a Transformer processes both stores alongside a learned sink token. Self-attention can move recent information into long-term memory, retrieve older information into the short-term window, or reorganize tokens within either store. The sink token gives attention heads a destination when no memory update is useful.
Neuron-level MLPs consume the transformed short-term state to calculate the next activations. The updated long-term state passes to the following recurrent step. The design combines three mechanisms:
- Separate short- and long-term recurrent states, as used by the Differentiable Neural Computer.
- Self-attention for memory reads and writes, as used by the Relational Memory Core.
- Per-neuron temporal processing inherited from the CTM.
The paper’s architecture comparison identifies CMM as the only evaluated system combining all three mechanisms.
Where persistent memory helps
CMM outperformed CTM on the copy, recall, sort, and parity tasks. It also recorded the lowest sorting loss among the 11 baselines in that experiment. Tests on sequences longer than those used for training showed how well each architecture could extend a learned algorithm.
| Task | CMM result | Comparison |
|---|---|---|
| Sort length 50 after training on lengths 4 to 16 | 72% accuracy | RMT: 68%; DNC: 56% |
| 39 × 39 maze, complete route | 61.6% accuracy | CTM: 37.4% |
| 39 × 39 maze, individual actions | 96.3% accuracy | 50 internal processing steps |
| Few-shot regression with 20 examples | 31% query accuracy | CTM: 9% |
| ImageNet-100 with frozen ViT features | 90% accuracy | CTM-style attention traces retained |
The maze model received limited cross-attention reads from the maze and had 50 internal steps to predict a path from start to finish. In the few-shot regression test, each model inferred a random 12-dimensional linear function from noisy examples and then predicted outputs for new inputs. CMM matched or slightly exceeded strong baselines including RMT and NAM-TM.
Attention traces from the memory Transformer showed different strategies by task. During copying, short-term memory drew almost entirely from long-term memory. During sorting, each store increasingly attended to itself as the model produced outputs. During maze solving, short-term memory attended to the sink token while the model largely bypassed long-term memory. The controller therefore learned task-specific read and write behavior without explicit rules for when to use the added store.
Plasticity moves memory into the weights
The TMLR paper gives the Plastic CTM a different adaptation mechanism. During inference, activity patterns modify the temporary effective weights in the network that connects CTM neurons.
The effective weight matrix combines a fixed matrix learned during training with a plastic matrix derived from outer products of recently activated states. An outer product records pairwise interactions between two activation vectors. Learned decay controls how quickly those updates fade, while a learned scalar normalizes their magnitude against the Frobenius norm, a measure of the fixed matrix’s overall size.
On 5-way, 1-shot classification, Plastic CTM improved CIFAR-FS accuracy from 51% to 60% and MiniImageNet accuracy from 47% to 52%. It outperformed MAML on both datasets. Prototypical Networks produced the highest overall scores, while Plastic CTM led the recurrent architectures.
A 5,700-run test of fast weights
The plasticity study also compared 15 recurrent architecture variants across more than 5,700 runs. Each model received a matched parameter budget and separately tuned hyperparameters, reducing the chance that one architecture benefited from a better search configuration.
- Plasticity depended on the architecture and task. It substantially improved LSTM performance on sequence copying while producing little gain for the standard CTM.
- The established maze-exploration benchmark was saturated. With PPO and Pop-Art normalization, nearly every tested architecture reached similar returns with and without plasticity.
Inference-time ablations tested whether models actually relied on their temporary weight updates. Disabling plasticity sharply reduced Sequential Split-MNIST accuracy for Plastic CTM, STPN, and Plastic RNNs. Plastic LSTM variants changed little, indicating that they had learned solutions with minimal dependence on fast weights. The ablation provides a direct way to distinguish available plasticity from plasticity the model uses.
What developers can take from the work
CMM demonstrates that CTM’s neuron-level temporal processing can work with a conventional memory-augmented design. Its matrix-shaped stores also make a Transformer a practical read-write controller because self-attention can address, transfer, and reorganize memory tokens through one operation.
The Plastic CTM results establish a stricter evaluation pattern for adaptive recurrent networks: compare architectures under matched budgets, tune each one separately, and disable plasticity at inference to measure whether the learned solution depends on it.
Reproduction materials are available in the CMM repository and plasticity repository, including baseline hyperparameter optimization scripts. The maze experiments used models with about 10 million parameters, and the benchmarks emphasize controlled algorithmic tasks. Language-model-scale behavior remains untested, but the released evaluations provide concrete ways to measure persistent state, retrieval, length generalization, and inference-time adaptation without gradient updates.