NTM
A controller network wired to a differentiable external memory, trained to copy and sort.
4,152 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 62.9K
- Operations
- 4,152
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- 2014
- Paper
- Neural Turing Machines
- Cited by
- 3,153 (as of 29 November 2026)
- Authors
- Alex Graves, Greg Wayne, Ivo Danihelka
- License
- BSD-3-Clause
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1852
- Graph hash
- db10e9d585ac216cf8679d43ac3812bfad2bbc2896cd00ad1cd9935559c7152b
- Skeleton hash
- 422c291b8079a5724e7407f07ec83244ac9a8a524bfd66068aa645c13a6e9547
- Architecture hash
- b48e973e970ebe52882074202e6be3f5ad0308fa1a92deb76979c7b51192a185
- Diagram SHA-256
- 7093f689a37499da7e086b6ea1c4df87486df9809a9f77f45a701f3ebda2d7ee
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
A Neural Turing Machine couples a neural network controller to an external memory it reads and writes through attention, with every step kept differentiable so the whole system trains by gradient descent. The point of the design is to learn small programs from examples: the paper shows it inferring copying, sorting and associative recall.
Reads and writes are deliberately 'blurry': rather than touching one slot, each head interacts to some degree with every memory location, and an attentional focus keeps that interaction concentrated. Writes borrow from the LSTM's gates: each is split into an erase followed by an add. Content-based addressing finds locations by similarity between their contents and a key the controller emits. Location-based addressing rotates the previous weighting instead, which gives the machine simple iteration over memory and random-access jumps. The controller can be feedforward or an LSTM, and with a feedforward controller the number of read heads bounds what it can compute per step.
The member traced here is the pytorch-ntm implementation set up for the copy task: a random bit sequence ending in a delimiter that the network must reproduce. That implementation shows a network trained on lengths 1 to 20 still copying a sequence of length 80.
Key idea. An end-to-end differentiable external memory with content- and location-based attentional read and write heads, letting a network learn algorithms such as copy and sort from examples.
- Neural Turing Machine
- NTM
- memory-augmented neural network
- external memory
- differentiable memory
- copy task
- repeat copy
- pytorch-ntm
- Graves
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{graves2014neuralturingmachines,
title={Neural Turing Machines},
author={Alex Graves and Greg Wayne and Ivo Danihelka},
year={2014},
eprint={1410.5401},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/1410.5401},
}