Computing Library › Neural Architectures
Neural Architectures

Neural Turing Machines

A Neural Turing Machine couples a neural controller to a differentiable memory using content and location-based addressing, learning simple algorithms end to end.

A learnable computer

The Neural Turing Machine (NTM) is an early memory-augmented network designed to resemble a computer with a learnable program. It has a controller, usually a recurrent or feedforward network, and an external memory matrix. The controller emits read and write heads that access the memory through fully differentiable operations, so the entire machine, controller and memory access alike, trains by gradient descent on input-output examples. The goal was to show a network could learn algorithmic procedures rather than only pattern recognition.

Addressing mechanisms

Kronos motion — three machines

The NTM's distinctive feature is how its heads choose where to read and write, blending two mechanisms. Content-based addressing produces weights by comparing a key the controller emits against each memory slot's contents, focusing on similar slots. Location-based addressing then lets the head shift its focus along the memory by a learned amount, enabling iteration and relative movement. Interpolation and sharpening steps combine and concentrate these weights into a final distribution over slots.

What it learned

NTMs learned to perform tasks such as copying a sequence and reproducing it, repeated copying, associative recall, and simple sorting, generalizing to longer sequences than seen in training in some cases. These results were significant because they showed a neural network could induce a reusable procedure with memory, not just a fixed mapping.

Legacy and successors

The NTM inspired the Differentiable Neural Computer, which added dynamic memory allocation and a mechanism to track the order in which slots were written, improving its handling of complex data structures like graphs. The content-based read is a close relative of the attention that later became central to transformers. A model that outputs positions into its input, rather than reading a memory, is described in pointer networks.