MEMO: A Deep Network for Flexible Combination of Episodic Memories

Andrea Banino, Adrià Puigdomènech Badia, Raphael Köster, Martin J. Chadwick, Vinícius Flores Zambaldi, Demis Hassabis, Caswell Barry, Matthew M. Botvinick, Dharshan Kumaran, Charles Blundell

TL;DR

MEMO is a novel memory-augmented architecture designed to solve "inferential reasoning" tasks—connecting disparate facts learned at different times to solve a new problem. By separating stored facts from their constituent items and employing an adaptive "halting" mechanism for memory retrieval, MEMO outperforms state-of-the-art models on complex associative tasks and matches top performance on the bAbI benchmark.

The Challenge of Inferential Reasoning

While modern neural networks are excellent at pattern recognition and direct recall, they often struggle with inferential reasoning. In neuroscience, this is the ability to link separate experiences to reach a conclusion. For example, if you know "A is related to B" and later learn "B is related to C," inferential reasoning allows you to deduce that "A is related to C."

Existing memory-augmented architectures, such as End-to-End Memory Networks (EMN) or the Differential Neural Computer (DNC), frequently fail when relationships are distributed across multiple "hops" or long distances. They often rely on superficial regularities in training data rather than true relational abstraction. To bridge this gap, the authors drew inspiration from the human hippocampus, which keeps memories distinct to avoid interference but integrates them flexibly during retrieval.

The MEMO Architecture

MEMO introduces two major architectural innovations over standard memory networks to facilitate deep reasoning:

  1. Fact-Item Separation: Standard models often sum or average word embeddings to represent a "fact" in memory. MEMO instead preserves the individual items within a fact. It uses a common embedding for each input, which is then projected into keys and values. This allows the model to flexibly weight specific elements within a memory during a lookup, rather than treating the whole memory as an inseparable, monolithic block.
  2. Adaptive Retrieval (Halting Policy): Instead of performing a fixed number of "memory hops," MEMO learns how many steps are needed to answer a specific query. It uses a halting policy trained via REINFORCE.
  3. The input to this policy is the Bhattacharyya distance between attention weights at the current and previous time steps.
  4. If the attention distribution hasn't changed much, the network has likely "settled" on an answer and halts.
  5. A novel loss term encourages the network to minimize the number of hops, favoring computational efficiency.

Technically, MEMO utilizes multi-head attention (similar to Transformers) but maintains a linear complexity relative to the number of input sentences, making it more scalable than quadratic self-attention models for long contexts.

Evaluating Reasoning Capabilities

The authors evaluated MEMO on three distinct challenges designed to test different facets of reasoning:

  • Paired Associative Inference (PAI): A task derived from neuroscience using ImageNet images. The model is shown pairs (e.g., A-B, B-C) and must identify the relationship between distant nodes (e.g., A and C). The authors tested sequences of length 3, 4, and 5.
Illustration of the Paired Associative Inference (PAI) task, showing training pairs and inference testing.
  • Shortest Path Finding: A synthetic task requiring the model to find the shortest path between nodes in randomly generated graphs of varying complexity and connectivity.
  • bAbI: A standard benchmark suite of 20 reasoning tasks (e.g., deduction, induction, spatial reasoning).

Key Insights and Results

  • Reasoning as Recurrent Retrieval: The core insight of MEMO is that the integration of knowledge doesn't have to happen during storage. By recirculating retrieved content as a new query (recurrent retrieval), the model can "chain" memories together on the fly.
  • The Power of Separation: Keeping memories "pattern separated" prevents interference. MEMO’s ability to solve length-5 PAI sequences—where every other model failed—suggests that maintaining the integrity of individual items within facts is crucial for deep reasoning.
  • Dynamic Compute: Not all questions are equally hard. The halting policy allows the model to spend more "ponder time" on complex inferences (like a length-5 chain) while quickly answering direct questions.

Performance Highlights: * PAI Dominance: On the hardest PAI tasks (length 5), MEMO achieved 84.5% accuracy, while EMN, DNC, and Universal Transformers (UT) all hovered between 45% and 62%. * Graph Scalability: In complex graphs (20 nodes, high connectivity), MEMO outperformed the DNC by over 20% in predicting the shortest path. It proved much better at iterating through potential paths as the number of hops increased. * bAbI SOTA: MEMO solved 20/20 tasks in the 10k training regime, achieving a mean error of just 0.21%, matching or slightly exceeding the performance of the Universal Transformer.

Limitations and Future Work

While MEMO represents a significant step forward, it has limitations. The halting policy relies on REINFORCE, which can be high-variance and harder to tune than standard supervised learning. Scaling this to even more complex environments might be challenging. Additionally, for the bAbI tasks, the authors had to add a specific time-encoding vector to the memory; developing a more "native" way for MEMO to handle the chronological order of facts remains an area for future improvement. Finally, while linear in memory size, the adaptive hopping mechanism adds sequential processing time, leaving the parallelization of these "hops" as an open question.

Summary updated

BibTeX
@inproceedings{banino2020memo,
  author = {Andrea Banino and Adrià Puigdomènech Badia and Raphael Köster and Martin J. Chadwick and Vinícius Flores Zambaldi and Demis Hassabis and Caswell Barry and Matthew M. Botvinick and Dharshan Kumaran and Charles Blundell},
  title = {{MEMO: A Deep Network for Flexible Combination of Episodic Memories}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=Ie_96BU24hM},
}
Figure