Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Neural Turing Machines

Neural Turing Machines couple a network to external memory it can learn to use

  • Problem Recurrent networks can in principle run arbitrary procedures, but learning such procedures from examples is hard. Their storage sits inside the hidden state, which is too small and too tangled to act as a program memory.
  • Method The NTM pairs a recurrent controller with a large memory matrix that it reads and writes through soft addressing. Every step is differentiable, so the whole system trains end to end by gradient descent.
  • Results On copying and associative recall, NTM generalised to longer sequences than it saw in training, where LSTM degraded rapidly beyond length 20. On associative recall it stayed nearly perfect for up to 12 items, twice the training maximum of 6.

Why a recurrent controller needs an addressable memory

Recurrent networks can in principle simulate arbitrary procedures, yet making them learn such procedures from examples is difficult in practice. The authors respond by enlarging a recurrent controller with a large addressable memory, in the spirit of a Turing machine's tape, but one that can be trained by gradient descent.

The memory alone would not solve the problem, because the network also has to decide where to read and where to write. Digital addressing picks out a single element, which cannot be trained in the way a soft weighting over all locations can, so every addressing step is made differentiable.

LSTM already gives a recurrent network storage that lasts for long periods, through a gate that controls when an integrator accepts input. That storage sits inside the hidden state, which is the gap the external memory is meant to fill.

Controller and memory matrix

An NTM has two parts: a neural network controller that exchanges input and output vectors with the outside world, and a memory bank it accesses through read and write operations. The controller's outputs that drive these memory operations are called heads.

The memory is an N by M matrix \(M_t\), where N is the number of locations and M is the vector size at each location. Each read or write head emits a weighting \(w_t\) over the N locations, and these weights are non-negative and sum to one, which makes each head's weighting a normalised distribution.

A read vector is the weighted combination \( r_t = \sum_i w_t(i)\,M_t(i) \) of the memory rows, which is differentiable in both the memory and the weighting. A sharp weighting on one row returns that row, while a flat weighting returns a blend of many rows.

A write is split into an erase followed by an add, a design borrowed from the input and forget gates of LSTM. The erase step computes \(\tilde{M}_t(i) = M_{t-1}(i)\,[\mathbf{1} - w_t(i)\,e_t]\), where the erase vector \(e_t\) has elements in (0, 1), so a location is reset only where both the weighting and the erase element are one. The add step then gives \(M_t(i) = \tilde{M}_t(i) + w_t(i)\,a_t\), and the order in which several heads apply their erases or adds does not change the result.

How the weightings are produced

Two addressing mechanisms are combined: content-based addressing, which finds locations by similarity to a value the controller emits, and location-based addressing, which moves focus by position. Location addressing is needed because a variable can have arbitrary content yet still require a fixed name, as in the arithmetic example where the values of x and y are stored at addresses and retrieved later.

The content weighting is a softmax over the similarities, \(w^c_t(i) = \exp(\beta_t K[k_t, M_t(i)]) / \sum_j \exp(\beta_t K[k_t, M_t(j)])\), where \(k_t\) is the key and \(\beta_t\) the key strength that sharpens or flattens the focus. The similarity used is cosine similarity, \(K[u,v] = u\cdot v / (\|u\|\,\|v\|)\).

The content weighting is then blended with the previous weighting through an interpolation gate \(g_t\) in (0, 1): \(w^g_t = g_t w^c_t + (1 - g_t) w_{t-1}\). When the gate is zero the head keeps its previous weighting, and when it is one the head uses content addressing alone.

The gated weighting is rotated by circular convolution, \(\tilde{w}_t(i) = \sum_{j=0}^{N-1} w^g_t(j)\,s_t(i-j)\), with index arithmetic modulo N. Because a soft shift spreads weight over neighbouring locations, the head emits \(\gamma_t \geq 1\) and sharpens the result as \(w_t(i) = \tilde{w}_t(i)^{\gamma_t} / \sum_j \tilde{w}_t(j)^{\gamma_t}\).

The combined system can work in three modes: a content weighting used directly, a content weighting that is then shifted to a neighbour, and a previous weighting that is rotated without any content lookup. The third mode lets a head step through a sequence of addresses at a fixed distance at each time step.

Feedforward or recurrent controller

A recurrent controller such as LSTM keeps its own hidden state, which can complement the memory matrix in the way processor registers complement RAM. A feedforward controller can imitate a recurrent one by reading and writing the same location at each step, and it is usually easier to interpret.

The drawback of a feedforward controller is that the number of read and write heads limits the computation per step: one read head allows only a unary transform of one memory vector, and two read heads allow binary transforms. A recurrent controller can store earlier read vectors internally, so it does not face this limit.

Copy task: learning speed and generalisation

Training used eight-bit random vectors followed by a delimiter, with sequence lengths drawn between 1 and 20, and the target was the input without the delimiter. No input is given while the target is produced, so the network must recall the whole sequence from memory alone.

The authors regard the gap as large enough to suggest a qualitative difference in how the models solve the problem.

On longer sequences than seen in training, NTM kept copying as the length grew, while LSTM degraded rapidly beyond length 20. When trained on sequences up to length 20, the NTM was tested on a length 120 sequence, where it made a few local errors and one global error in which a single vector was duplicated.

The authors summarise the learned behaviour as a write phase that moves the head forward one location per input vector, followed by a read phase that returns to the start and emits one vector per step. The algorithm uses content-based addressing to jump to the start of the sequence and location-based shifts to move along it. Read locations match the write locations, which the authors take as evidence that each input is stored at a specific location and read back in the same order.

The memory used in this experiment has 128 locations, and after that the cyclic shifts wrap around and overwrite earlier writes.

Repeat copy: counting and the end marker

NTM learned the task much faster than LSTM, and both solved the training problem perfectly. The difference between the two only became clear when the networks were tested beyond the training range.

When sequence length and repeat count were both increased, NTM handled longer sequences and more than ten repetitions, while LSTM failed both tests. The NTM did not predict the end marker correctly: it emitted the marker after every repetition beyond the eleventh. The authors attribute this to representing the repeat count numerically, which does not generalise easily beyond a fixed range.

The authors read the solution as an extension of the copy procedure, in which the sequential read is simply repeated as many times as needed. An intermediate memory location appears to redirect the head back to the start of the sequence.

Associative recall: following a pointer to the next item

Each item is a sequence of three six-bit binary vectors bounded by delimiters, and after several items a query item is shown and the network must produce the item that follows it. Training episodes contained a minimum of 2 and a maximum of 6 items.

NTM with a feedforward controller learned faster than NTM with an LSTM controller, which the authors read as external memory being a more effective way to hold the data structure than LSTM's internal state.

On longer item sequences, NTM with a feedforward controller was nearly perfect for up to 12 items, twice the maximum used in training, and kept an average cost below 1 bit per sequence at 15 items. The longer-sequence comparison covers item counts from 6 to 20 and shows NTM generalising better than LSTM.

The inspection of one test episode shows the controller writing a compressed representation of each item's three time slices at the delimiter. The reads contiguous locations that store the time slices of the target item, and the write weightings show that writes also happen at delimiters.

Dynamic N-Grams: comparison with a Bayesian estimator

Each training example draws a fresh 6-Gram distribution: a table of 32 probabilities, one for each length-five binary history, drawn from a Beta distribution with both parameters one half. A sequence of 200 bits is drawn from this table, with the first five bits drawn as independent Bernoulli samples with p = 0.5, and the network predicts each next bit as it observes the sequence.

This gives a reference cost against which the NTM and LSTM predictions can be compared.

On a validation set of 1000 sequences of length 200 drawn from the training distribution, NTM achieved a small advantage over LSTM but never reached the optimal cost. Predictions of NTM are almost indistinguishable from the optimal ones in most positions, while the errors appear at a few points where the memory was read from the wrong location.

The authors postulate that the NTM uses writes to keep a count of how often ones and zeros follow each context, and the add vectors look like a distributed counter.

Priority sort: writes placed by priority

Each input has 20 binary vectors, each with a scalar priority drawn uniformly from [-1, 1], and the target is the 16 highest-priority vectors in priority order. The authors limited the output to 16 vectors because they wanted to see whether the NTM would use a binary heap sort of depth 4.

The authors hypothesise that the priorities set the relative location of each write, and a linear function of the priority fitted to the observed write locations closely matches them. The read locations are visited in increasing order, so the network traverses the sorted sequence.

Both NTM variants, with feedforward and LSTM controllers, substantially outperformed LSTM on this task. The feedforward variant needed eight parallel read and write heads to perform best, which the authors connect to the difficulty of sorting with unary vector operations.

Training setup and parameter counts

All experiments were trained with RMSProp in the form described by Graves (2013), with momentum 0.9, and all LSTM networks had three stacked hidden layers. Gradient components were clipped elementwise to the range (-10, 10) during the backward pass.

The number of LSTM parameters grows quadratically with the number of hidden units because of the recurrent connections, whereas the NTM parameter count does not grow with the number of memory locations.

Limitations

The experiments are described as preliminary and cover the five tasks reported in the paper. Generalisation was tested only up to the lengths and counts noted in each task: a length 120 copy, item sequences up to 15 for recall, and repeat counts beyond ten.

On repeat copy, the NTM could not count its repetitions and did not predict the end marker correctly. On associative recall the LSTM performed better than on copy, which the authors connect to the shorter sequences and to the larger LSTM network having more memory capacity.

On dynamic N-Grams the NTM never reached the cost of the optimal estimator. The priority sort feedforward variant depended on eight heads, and the authors did not test whether fewer heads would suffice with a different controller.

Paper info

Authors
Alex Graves, Greg Wayne, Ivo Danihelka
Venue
arXiv · Preprint
First published
2014-10-20
Added
2026-11-12
Updated
2014-12-10
Version
v2
arXiv
1410.5401
Category
cs.NE
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Alex Graves, Greg Wayne, Ivo Danihelka (2014). Neural Turing Machines. arXiv:1410.5401v2. https://arxiv.org/abs/1410.5401v2

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

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up