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

Metalearned Neural Memory

Tsendsuren Munkhdalai, Alessandro Sordoni, Tong Wang, Adam Trischler

Introduction

This paper introduces Metalearned Neural Memory (MNM), a novel approach that replaces traditional memory "tables" with a rapidly adaptable deep neural network. By treating memory as a function—where writing is a fast parameter update and reading is a forward pass—the model achieves superior scaling, better generalization, and state-of-the-art performance on complex reasoning and reinforcement learning tasks.

The Problem with Traditional Memory Networks

Most Memory-Augmented Neural Networks (MANNs), such as the Neural Turing Machine (NTM) or Differentiable Neural Computer (DNC), rely on "soft look-up tables." In these systems, information is stored as rows in a matrix, and retrieval happens via an attention mechanism.

While successful, these table-based memories have three major drawbacks:

  1. Scaling Issues: As the number of stored items increases, the computational cost of attending to every "slot" grows, making them slow for long sequences.
  2. Poor Generalization: These models can only retrieve values that are convex combinations of what was explicitly stored; they struggle to "fill in the gaps" for unseen cues.
  3. Storage Inefficiency: Tables often grow without bound or require complex, heuristic "deallocation" schemes to manage fixed-size slots.

The authors ask a fundamental question: Can we build a memory that compresses information into the weights of a function instead of just stacking vectors in a list?

Methods: Memory as a Function

The authors propose the Metalearned Neural Memory (MNM). The system consists of two main parts: a Controller (an LSTM) and a Neural Memory Function (a feed-forward MLP).

Architecture of the Metalearned Neural Memory (MNM) system.
  • Reading as Inference: To "read" from memory, the controller provides a "key" vector. This key is passed through the memory MLP, and the output is the "recalled" value.
  • Writing as Optimization: To "write" to memory, the controller generates a (key, value) pair. The model then performs a rapid parameter update on the memory MLP's weights to minimize the error between the MLP's current output for that key and the desired target value.
  • The "MNM-p" Local Update: Standard gradient descent is slow and computationally expensive to "meta-learn" because it requires backpropagating through the gradient steps. To solve this, the authors introduced a Learned Local Update rule. They use a "Backward Feedback Prediction Function" (BFPF) that predicts what the internal activations should be, allowing the weights to be updated in parallel using a perceptron-like rule. This makes "writing" incredibly fast and hardware-friendly.
  • Meta-Training: The entire system is trained end-to-end. The controller learns how to generate the right keys and values so that the memory MLP can store and retrieve them reliably to solve the ultimate task.

Key Insights

  • Memory as Compression: By storing information in weights rather than slots, MNM acts as a compressor. It doesn't need a new "slot" for every new piece of data; it just adjusts its internal function.
  • Generalization via Function Approximation: Because the memory is a deep network, it can generalize. If it learns a pattern in the data, it can potentially "recall" useful information for a key it has never seen before, something a standard look-up table cannot do.
  • Linear Scaling: Unlike attention-based memories that become computationally heavier as they store more items, MNM’s cost is tied to the size of the MLP, which remains constant regardless of the sequence length.

Key Results

The model was evaluated on a diverse set of benchmarks, including synthetic dictionary inference, algorithmic tasks, bAbI question answering, and maze exploration.

Performance comparison on algorithmic tasks (Double Copy and Priority Sort).
  • Algorithmic Tasks: On standard "stress tests" for memory like Double Copy and Priority Sort, MNM variants (MNM-g and MNM-p) significantly outperformed standard LSTMs and other baselines, demonstrating robust sequence memorization and manipulation.
  • bAbI QA: MNM-p achieved a mean error of 0.55%, solving all 20 synthetic reasoning tasks. This significantly outperformed the DNC (12.8% error) and the previous state-of-the-art TPR-RNN.
  • Reinforcement Learning: In a maze exploration task where an agent must find an invisible goal in a grid world, the MNM agent reached peak performance in just 250,000 episodes, whereas models using Hebbian "plastic weights" required nearly 1,000,000 episodes to reach the same level.
  • Efficiency: In the dictionary task, as input length increased, traditional soft-attention models showed quadratic growth in computation time, while MNM showed linear growth, proving it is much more efficient for long-context tasks.

Limitations and Future Work

  • Initialization Sensitivity: The authors found that trying to meta-learn the initial weights of the memory network led to severe overfitting. Instead, they had to initialize the memory from scratch ("tabula rasa") for every episode.
  • Architectural Constraints: The current memory function is a simple feed-forward network. Exploring more complex architectures (like recurrent or convolutional memory functions) could further improve performance.
  • Recall Delays: While they introduced a "recall delay" parameter in their meta-objective to help the model remember older information, they found its impact was task-specific and requires more investigation.

Summary updated

BibTeX
@inproceedings{munkhdalai2019metalearned,
  author = {Tsendsuren Munkhdalai and Alessandro Sordoni and Tong Wang and Adam Trischler},
  title = {{Metalearned Neural Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=8fqexcHG1X},
}
Figure