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

Neural Turing Machines

Alex Graves, Greg Wayne, Ivo DanihelkaarXiv 2014

Abstract

Neural Turing Machines (NTMs) represent a class of neural network architectures that extend the capabilities of standard recurrent models by incorporating an external, addressable memory. Unlike traditional Recurrent Neural Networks (RNNs) or Long Short-Term Memory (LSTM) units, which store information within internal hidden states, NTMs utilize a differentiable memory bank coupled with a controller. This design allows the system to learn algorithmic solutions to complex tasks such as copying, sorting, and associative recall. Experimental results demonstrate that NTMs can generalize to sequence lengths far beyond those seen during training, effectively learning the underlying logic of a task rather than merely memorizing statistical patterns.

Introduction

While connectionist models like RNNs have seen immense success in sequence modeling, they often struggle with tasks that require precise, long-term data storage or complex logical flow. In practice, an LSTM might "remember" a sequence by squashing it into its internal hidden state, but it lacks a dedicated, addressable workspace to manipulate that data.

The Neural Turing Machine aims to bridge the gap between the pattern-recognition power of neural networks and the structured logic of classic computation. By making discrete computer operations—such as reading from or writing to a specific address—differentiable, NTMs can be trained via standard gradient descent to discover algorithms for tasks like sorting and copying.

Architecture and Methods

The NTM architecture consists of two primary components: a Controller and a Memory Bank. The controller is a neural network (either feedforward or recurrent) that interacts with external inputs and produces outputs. The memory bank is a large matrix ($N \times M$) where information is stored.

The high-level NTM architecture showing the interaction between the controller, memory heads, and the external environment.

Interaction with the memory occurs through Read and Write Heads. To maintain differentiability, the system avoids discrete addressing. Instead, the heads produce a "blurry" weighting over all memory locations, allowing the network to learn where to focus its attention through backpropagation.

Addressing Mechanism

The addressing process is a multi-stage pipeline that allows for both content-based and location-based retrieval:

  1. Content-based Addressing: The controller emits a "key" vector, and the system finds similar vectors in memory, acting like an associative memory.
  2. Location-based Addressing: This stage allows the controller to perform relative jumps (e.g., "move one step to the right"), enabling the creation of data structures like arrays and the execution of iterative loops.
The multi-stage addressing mechanism, incorporating content addressing, interpolation, convolutional shifting, and sharpening to produce the final weighting vector.

Experimental Evaluation

The authors evaluated the NTM on a battery of synthetic algorithmic tasks designed to test its ability to learn logic rather than just patterns:

  • Copy & Repeat Copy: Storing and repeating sequences of random binary vectors.
  • Associative Recall: Learning a list of items and returning the successor of a given prompt.
  • Priority Sort: Sorting a list of vectors based on randomly assigned priority scores.

Key Results and Discussion

NTMs demonstrated a remarkable ability to learn the underlying logic of a task. In the Copy task, while standard LSTMs failed when sequence lengths exceeded those seen in training (e.g., length 20), the NTM continued to copy accurately up to length 120. In the Priority Sort task, the NTM effectively implemented a version of a heap sort, vastly outperforming baseline models.

One significant insight was the choice of controller. Feedforward controllers often proved more "transparent" because they forced the network to use the external memory for all state-keeping, whereas LSTM controllers tended to hide some logic within their internal hidden states.

Limitations and Future Work

A primary limitation of the current NTM is computational cost. Because every memory access involves a weighted sum over the entire memory matrix, the cost scales linearly ($O(N)$) with memory size. This makes scaling to massive databases difficult. Future research directions include moving toward sparse memory access, where only a few locations are updated at a time, to improve efficiency and enable the handling of more complex, non-linear data structures.

Summary updated

BibTeX
@misc{graves2014neural,
  author = {Alex Graves and Greg Wayne and Ivo Danihelka},
  title = {{Neural Turing Machines}},
  year = {2014},
  eprint = {1410.5401},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1410.5401},
}
Figure