---
title: "Neural Turing Machines — paper by Graves et al. (2014)"
description: "How Neural Turing Machines learn to use external memory for copying, recall, prediction and sorting, and where generalisation fails."
canonical: "https://research.elamur.ai/free/en/papers/graves-2014-neural-turing-machines/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/graves-2014-neural-turing-machines/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2014](https://md.research.elamur.ai/free/en/papers/2014/) / Neural Turing Machines

# Neural Turing Machines

Paper · 2014 · Alex Graves, Greg Wayne and Ivo Danihelka

**Authors:** [Alex Graves](https://md.research.elamur.ai/free/en/authors/alex-graves/), Greg Wayne and [Ivo Danihelka](https://md.research.elamur.ai/free/en/authors/ivo-danihelka/) · **Year:** 2014 · **Venue:** arXiv:1410.5401 · **Licence:** [arXiv — non-exclusive licence to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**102** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2167839676) · [arXiv:1410.5401](https://openalex.org/S4306400194) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1410.5401)
- [arXiv 1410.5401](https://arxiv.org/abs/1410.5401)
- [OpenAlex](https://openalex.org/W2167839676)

Citations: OpenAlex, 2026-10-14.

## Deep dive: Neural Turing Machines

How Neural Turing Machines learn to use external memory for copying, recall, prediction and sorting, and where generalisation fails. · about 38 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A network that learns to reproduce a short sequence has not necessarily learned how copying works. It may have found a way to compress the training examples into its internal state, with little ability to handle longer inputs. Neural Turing Machines addresses that distinction by giving a neural network a separate memory that it can read, modify and revisit. The aim is to make simple algorithmic behaviour easier to learn: storing an unfamiliar sequence, traversing it in order, retrieving something associated with a query, or arranging data according to a priority. The central question is whether examples of the desired input and output are enough to teach a network useful procedures for operating on temporary data.

The proposed architecture, abbreviated NTM, combines a neural controller with a memory matrix. Each row of the matrix holds a vector, and specialised controller outputs determine where reading and writing occur. These outputs act like the heads of a computing machine, but they distribute attention across memory locations instead of selecting an address through a discrete decision. Reading takes a weighted mixture of stored vectors. Writing selectively removes old information and adds new information. Because these operations are differentiable, errors at the output can train both the controller and its memory-access behaviour through gradient descent. The controller can be feedforward or recurrent; the latter also has an internal state alongside the external memory.

The experiments compare these alternatives with a standalone Long Short-Term Memory network, or LSTM, on copying, repeated copying, associative recall, adaptation to changing binary-sequence statistics, and priority sorting. Both NTM variants generally learn faster than the standalone LSTM, although the advantage varies by task. More revealingly, some learned behaviours transfer beyond the training range. A copying NTM continues reproducing sequences longer than those used during training. In associative recall, the feedforward-controller NTM performs almost perfectly with lists containing 12 items, although training lists contain at most 6. These results support the authors’ interpretation that the architecture can acquire compact procedures, rather than merely fit particular sequence lengths.

The memory traces make that interpretation concrete while also exposing its limits. Copying resembles writing an array and later scanning it. Associative recall combines a content lookup with movement to a neighbouring location. Priority sorting appears to use priorities to organise write addresses, followed by reading in address order. Yet successful extrapolation is not universal: repeated copying extends to longer inputs more reliably than it extends to unfamiliar repetition counts, and the statistical prediction task remains short of its optimal reference. The paper establishes a trainable architecture for simple memory-dependent procedures under controlled conditions. It does not establish unrestricted program learning, unlimited memory, or dependable generalisation on every part of a task.

### Ideas worth borrowing

Separate the procedure from its workspace. The controller learns how to act, while the memory holds information belonging to the current episode. This separates the capacity needed to store temporary data from the parameters needed to govern access. In the NTM, adding memory locations does not itself enlarge the learned parameter set. That distinction is useful whenever a fixed operation must handle varying amounts of temporary information. An engineer can ask whether a system really needs a larger internal representation or instead needs an explicit place to retain intermediate results. The paper also supplies a useful experimental test: vary the amount of data while keeping the learned procedure fixed, then examine where performance starts to fail.

Combine content lookup with relative movement. Finding a record and navigating within its neighbourhood are different operations. The NTM supports both, and associative recall shows why the combination matters: a query can locate a stored item representation, after which an address shift reaches the following data. This pattern applies to structured storage in which related entries have a useful arrangement. A system need not rediscover each element independently if it can first identify the relevant region and then traverse it. The important design choice is to expose both operations explicitly, rather than assume that a general similarity mechanism will easily learn reliable navigation on its own.

Make discrete-looking operations trainable through weighted access. A hard address choice creates a discontinuity between a controller’s decision and the resulting memory operation. The NTM instead assigns weights to locations, allowing learning signals to pass through access decisions. Its experiments show that soft access can nevertheless become sharply concentrated during operation. The reusable idea is to distinguish the mechanism used for learning from the precision eventually exhibited by the learned behaviour. This can help when designing trainable interfaces to structured resources. The qualification is equally useful: weighted access introduces mixtures and interference, so a practical design must control how attention spreads.

Treat precision as part of the algorithm. Repeatedly shifting a broad weighting can gradually destroy the distinction between neighbouring memory locations. The NTM therefore includes a sharpening operation after shifting. This is more than a numerical convenience: an otherwise sensible traversal procedure can fail if its addressing becomes less precise at each step. The same concern applies to any repeated operation on approximate state. Testing only a short trajectory may conceal accumulated dispersion. The paper suggests examining the evolution of the access distribution itself, alongside the final output, to determine whether a procedure remains stable when execution lasts longer.

Test generalisation along separate dimensions. Repeated copying requires retaining the input, traversing it, counting completed repetitions and deciding when to stop. Increasing sequence length challenges a different part of that procedure from increasing the requested repetition count. The NTM handles these changes differently. This makes the task a useful example of why a single claim of generalisation can be too broad. For a reusable evaluation strategy, identify the quantities that govern distinct subprocedures and vary them independently. A system may have learned a reliable data traversal while still relying on a range-specific numerical representation for its stopping rule.

Use internal traces to challenge a behavioural explanation. The authors do not infer an algorithm solely from low output error. They inspect read and write locations, stored vectors and their changes over time. These observations support explanations involving arrays, compressed lookup keys and context-specific counters. They also reveal an apparent addressing mistake in the statistical task. This approach belongs to [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/), but its practical value is immediate: an explanation should account for both successful outputs and characteristic failures. Explicit memory interfaces can make such explanations easier to investigate, especially when the controller has less hidden state in which to conceal intermediate computation.

### How Mova uses it

For [Mova](https://md.research.elamur.ai/free/en/projects/mova/), the small transparent language system implemented in Rust, the clearest connection is an architectural possibility: keep temporary working information in an explicit structure, and make the operations on that structure inspectable. The NTM provides a precise example of how a learned controller can be separated from the information it manipulates during a particular episode. That separation could help Mova distinguish persistent system knowledge from temporary records created while processing an input. No implemented NTM component in Mova is established here, so these connections are design proposals rather than claims about existing functionality.

A concrete proposal would be a traceable working-memory interface. Each access could record the query used to find an entry, the locations receiving attention, the information read, and the information changed. In the NTM experiments, access traces help explain how an input sequence becomes a sequence of stored vectors and how a later query reaches the relevant information. Mova could use the same principle of explicit records even if its storage and access rules were deterministic. Borrowing the separation between controller and workspace does not require reproducing every differentiable operation in the paper.

A further possibility concerns structured records. Mova could keep an item’s identifying representation near data that belong to it, then distinguish finding the record from selecting a field or neighbouring entry. The paper’s associative-recall analysis offers a compact example of that distinction. The controller retrieves a compressed representation through similarity and then uses an offset to reach subsequent data. For Mova, this suggests an interface whose trace can explain both why a record was selected and how the requested information was reached. Whether learned similarity, explicit keys or another mechanism would serve that role remains an implementation decision.

The evaluation strategy is also directly reusable. A proposed Mova memory component could first be tested on controlled operations whose correct behaviour is unambiguous: retaining arbitrary input, retrieving an associated item, and preserving order during repeated access. Increasing the amount of stored information would then test the workspace separately from the rule used to traverse it. Requiring a clear stopping condition would test another part of the procedure. The NTM’s repeated-copy result is especially relevant: producing the right content for longer does not by itself show that the system knows when to finish.

Transparency should remain an evaluation requirement instead of an architectural promise. A memory matrix is visible, but its vectors can still have a distributed meaning that is difficult to interpret. Even the NTM counter explanation is presented tentatively. For Mova, a useful borrowing would therefore combine explicit storage with checks on the proposed explanation: repeat an input context, inspect whether the same record is accessed, and verify that the update corresponds to the information received. The paper offers a way to organise these questions; it does not supply a ready-made language component or evidence that the same mechanisms will solve Mova’s language tasks.

### The problem and its context

#### Capacity in principle does not guarantee learnability

The paper begins from a gap between what recurrent neural networks can represent and what they readily learn. Earlier theoretical work had established that appropriately configured recurrent networks can carry out arbitrary computational procedures. That result concerns possible configurations. It does not explain how ordinary training will discover a useful procedure, how easily temporary values can be retained, or how reliably a learned operation will transfer to longer inputs.

Conventional programs make these issues more explicit. They apply operations to data, select what happens next, and use storage that can be revisited as computation proceeds. The authors argue that contemporary [machine learning](https://md.research.elamur.ai/free/en/concepts/machine-learning/) had made comparatively little use of explicit control flow and writable external memory. Their contribution concentrates on the latter. Rather than requiring every temporary value to be encoded inside a recurrent network’s evolving state, they provide an addressable resource outside the controller.

This changes the practical structure of a learning problem. To copy a sequence, a network with only internal state must preserve enough information about all its inputs until output begins. A controller with an external workspace can instead learn a recurring operation: put the current input at the current location, advance, and later revisit the stored sequence. That procedure still has to be learned, but the architecture makes its component actions available.

The comparison with a Turing machine expresses this motivation. The paper adds addressable storage to a neural controller, much as an external tape changes the capabilities of a finite-state device. The analogy is architectural rather than literal. The NTM experiments use finite memory, and their access operations are continuous. The authors seek a differentiable computing system that can be trained from examples, rather than an exact recreation of a classical machine.

#### Working memory as an organising idea

The psychological concept of working memory supplies another motivation. In the account reviewed by the paper, working memory supports temporary retention together with operations on what has been retained. An executive process directs attention and acts on information in a buffer. The NTM follows this broad organisation: a controller governs access, while a separate resource holds the data being manipulated.

The relevant information is frequently created during the task itself. A system might receive unfamiliar values, place them into temporary roles, and apply a familiar operation to them. The authors connect this requirement to rapid variable creation. Learning an operation is different from learning every possible value to which it might be applied. A useful architecture should allow new data to occupy the roles required by an already learned procedure.

The paper reviews neuroscience research associating working memory with interactions involving prefrontal cortex and basal ganglia. It describes experiments in which an animal observes a cue, waits, and later responds in a cue-dependent way. Persistent activity and more complex population dynamics provide possible substrates for retaining the relevant information. These observations motivate the general problem of controlled temporary storage; they do not determine the NTM’s exact implementation.

The distinction matters because the authors are willing to depart from human constraints. They discuss psychological work on limits to working-memory capacity but do not attempt to reproduce those limits. Nor do they claim that their memory matrix establishes how the brain addresses stored information. The biological connection provides a functional analogy: selective storage and rule-governed manipulation under attentional control.

Among the computational accounts reviewed, the work of Hazy and colleagues is particularly relevant because it includes gates controlling entry into memory slots. The NTM’s proposed advance is a more developed addressing mechanism. Gating determines whether information enters storage; addressing determines which stored information an operation concerns. The paper treats that additional capability as essential for moving beyond relatively simple stored items.

#### Variable binding and variable-length structure

The cognitive-science discussion concerns another version of the same problem. A system must distinguish an operation from the particular entities filling its roles. In a sentence, for example, different names can occupy the roles of participant and recipient while the relational structure remains comparable. In a computation, arbitrary values can occupy different variable slots while the operation stays fixed.

The paper revisits criticisms that connectionist approaches lacked adequate mechanisms for such binding and for handling structures of varying length. It also describes earlier neural proposals that addressed these concerns through distributed representations and specialised mechanisms. The NTM is presented as extending that line of work, instead of originating the question of how a neural system can represent structured, temporary information.

The authors distinguish this issue from a demand that every composite structure be built as an explicit tree. Recurrent networks already accept sequences whose lengths vary, because processing unfolds over time. They therefore question whether greedy construction of explicit parse structures is always necessary. Their discussion includes [Semantic Compositionality through Recursive Matrix-Vector Spaces](https://md.research.elamur.ai/free/en/papers/socher-2012-semantic-compositionality-through-recursive-matrix/) among approaches using recursive structure, while their own experiments pursue sequential processing with addressable memory.

This is a claim about architectural options, not evidence that the NTM has resolved linguistic structure. The experiments contain binary vectors, delimiters, scalar controls and priorities. They make variable storage and traversal easy to isolate. Their relevance to the cognitive discussion lies in the operations they require, rather than in direct demonstrations of language understanding.

#### What recurrence and attention already provided

Recurrent networks bring a dynamic state to sequence processing. The response to a current input can depend on earlier inputs because those inputs have changed the network’s state. The paper contrasts this distributed state with the state representation of hidden Markov approaches and emphasises its expressive computational capacity.

LSTM addresses a particular difficulty in training such systems: sensitivity can shrink or grow excessively as it propagates through time. The paper explains its memory principle through integration and context-dependent gates. A retained value can persist, while a gate determines when new information is allowed to alter it. This makes LSTM an important baseline because it already has mechanisms designed for retaining information over extended intervals.

The reviewed applications include speech recognition, generated sequences and [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/). [Sequence to Sequence Learning with Neural Networks](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/) appears as an example of recurrent processing applied to translation. The NTM does not begin from the claim that recurrence is ineffective. It asks whether an additional addressable workspace makes particular algorithmic tasks easier to acquire and extrapolate.

Differentiable attention is another direct precursor. The paper cites [Neural Machine Translation by Jointly Learning to Align and Translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/) alongside earlier attention work. The shared ingredient is a trainable weighting over information sources. The NTM extends this principle into a writable resource: attention determines both what information is read and where new information changes the current memory.

### The method, step by step

#### Follow the information through the machine

An NTM contains a controller and a matrix of memory vectors. At an update, the controller processes information from its input and memory interface, produces an external output, and emits the quantities needed to govern memory access. Separate heads can perform parallel reads and writes. A head is therefore a set of controller outputs specifying an operation, rather than a physical device moving over storage.

The memory matrix has N rows, each containing M components. Here N measures the number of locations, while M measures the width of an individual stored vector. Keeping these dimensions distinct is important. A system may need more locations to retain a longer sequence without needing a wider representation for each sequence element.

A read head produces a weighting over rows. A write head also produces a weighting, together with vectors specifying what to erase and what to add. An addressing mechanism constructs these weightings from content similarity, previous attention and allowed movements. The controller learns how to coordinate these operations through the same training objective that evaluates its external predictions.

An update through the NTM memory interface The steps in order.

The diagram separates operations for explanation. The important architectural property is their trainable connection. A useful read depends on where earlier writes placed information; a useful write depends on what later computation needs. Training must therefore coordinate storage, retrieval and output across the episode.

#### Why a recurrent controller already has memory

Before introducing the external workspace, the paper uses a simple integrator to explain the storage principle behind LSTM:

```
x(t + 1) = x(t) + i(t)
```

Here x(t) is the state at time t, x(t + 1) is its next value, and i(t) is an input increment. The direct carry-over of x(t) lets information persist without being repeatedly contracted or amplified by a changing transformation.

The paper then adds a context-dependent gate:

```
x(t + 1) = x(t) + g(context) i(t)
```

The function g determines how much of i(t) enters the state, using the surrounding context to make that decision. The other symbols retain their previous meanings. This equation explains selective accumulation: the system can preserve a value while declining to incorporate an irrelevant input.

These equations motivate the recurrent baseline and the NTM’s selective write operation. They are not a complete specification of an LSTM controller. The crucial distinction is that LSTM supplies gated internal state, whereas the NTM additionally provides multiple externally addressable locations.

#### Read through a normalised weighting

For each head, the address weighting must satisfy a normalisation requirement:

```
Σ_i w_t(i) = 1, with 0 ≤ w_t(i) ≤ 1 for every i
```

The quantity w_t(i) is the weight assigned to location i at time t, and Σ_i means summation across memory locations. These constraints make the weights a distribution over rows. A concentrated distribution approximates selecting an individual location; a spread-out distribution reads from several locations at once.

The read operation is:

```
r_t ← Σ_i w_t(i) M_t(i)
```

The symbol r_t denotes the returned vector, M_t(i) is row i of the memory at time t, and w_t(i) is its contribution to the read. The arrow indicates that the weighted sum defines the read result. Since every row has M components, the returned vector also has M components.

This is a convex combination of stored rows. The head can retrieve a row approximately unchanged when its weight dominates, but uncertain attention produces a mixture. That mixture is the price and the opportunity of continuous access: it permits gradients with respect to both the stored values and the weights, while also making precise addressing important.

The experiments sometimes show very concentrated read weights. Such concentration supports the interpretation that the machine has learned a near-discrete access pattern. It does not change the underlying operation, which remains the same differentiable weighted sum.

#### Write by erasing and adding

Writing first reduces selected parts of the existing memory:

```
M̃_t(i) ← M_(t−1)(i) ⊙ [1 − w_t(i)e_t]
```

Here M_(t−1)(i) is the previous content of row i, M̃_t(i) is the intermediate content after erasure, and e_t is the erase vector. The symbol 1 represents a vector of ones, and ⊙ denotes componentwise multiplication. The write weighting w_t(i) determines how strongly the erase vector affects that location.

The components of e_t lie between zero and one. A component is strongly removed when both the location weight and the corresponding erase value are large. If either is zero, that part of the old content is preserved. Thus the head controls selection at different levels: which row is affected and which components within that row are changed.

The second stage adds information:

```
M_t(i) ← M̃_t(i) + w_t(i)a_t
```

The vector a_t contains the new information supplied by the write head. The final row M_t(i) combines the erased intermediate content with a location-weighted addition. Each component of a_t can vary independently, just as each component of the erase vector can.

Multiple heads can write in parallel. The paper notes that the erase multiplications commute with one another, and the additions also commute with one another. This observation concerns the organisation of their combined operation; erasing and adding still play different roles.

The design supports more than replacing an entire stored record. A head can preserve some components while modifying others, or distribute a weak update across locations. Such flexibility is useful for counters and incremental statistics, although it also creates the possibility that imperfect addressing will change unrelated information.

#### Find relevant content

Content-based addressing compares a controller-generated key with each stored row. The implementation uses cosine similarity:

```
K(u, v) = (u · v) / (‖u‖ ‖v‖)
```

The vectors u and v are the quantities being compared. Their dot product is u · v, and ‖u‖ and ‖v‖ are their lengths. K is the resulting similarity measure. In memory access, these vectors are the key and a memory row.

The similarities become a normalised weighting through:

```
w_t^c(i) ← exp(β_t K(k_t, M_t(i))) / Σ_j exp(β_t K(k_t, M_t(j)))
```

The vector k_t is the key produced at time t. The positive scalar β_t controls the strength of similarity differences. The superscript c identifies the content-derived weighting, exp is the exponential function, and j ranges over every row included in the normalising denominator. M_t(i) and M_t(j) denote the compared memory rows.

A stronger β_t can make the best-matching rows receive more concentrated attention. A weaker setting spreads attention more broadly. The controller therefore learns both what to search for and how decisive the search should be.

The attraction of this mechanism is that an approximate cue can recover a stored value. The controller need not preserve a literal address for every item. However, a cue alone does not solve every access problem. Arbitrary data can fill a variable’s role, and an algorithm may need the next entry in a sequence regardless of what that entry contains.

#### Preserve a position or initiate a new lookup

The addressing system blends the content result with the head’s previous weighting:

```
w_t^g ← g_t w_t^c + (1 − g_t)w_(t−1)
```

The scalar g_t is an interpolation gate between zero and one. The vector w_(t−1) is the weighting used by the same head at the preceding step, while w_t^g is the blended result. The superscript g marks this gated intermediate weighting.

When the gate favours previous attention, the head can continue a traversal without locating its position again from content. When it favours the current content result, it can jump to a newly identified record. Intermediate values blend the alternatives.

The paper argues that explicit location-based operations were essential for some of its observed generalisation. In principle, stored content could encode an address, making content lookup sufficiently general. In practice, making relative movement available directly can simplify the procedure the controller must learn.

This distinction is particularly clear for copying. Each input vector may be arbitrary, but the rule for storing the next vector need not depend on its content. The controller can use the current position and advance through storage according to a repeated movement.

#### Move attention through memory

A head supplies a normalised distribution s_t over permitted integer shifts. The paper describes both a softmax implementation over shifts and an alternative construction from a scalar specifying a width-one uniform distribution. These are alternative ways of parameterising movement, rather than different memory read equations.

The shift is applied through circular convolution:

```
w̃_t(i) ← Σ_(j=0)^(N−1) w_t^g(j)s_t(i − j)
```

The quantity w̃_t(i) is the shifted weight at location i. With N denoting the number of memory locations, the summation visits each location j from 0 to N−1. The factor s_t(i − j) supplies the weight for moving from j to i. Index calculations wrap around modulo N.

A concentrated shift distribution can move a concentrated attention pattern to a neighbouring location. A distribution spread across movements produces a mixture of shifted patterns. Circular indexing gives the operation a consistent definition at the boundary, but it also means that continued traversal eventually returns to previously visited locations.

For copying, this boundary behaviour becomes a practical capacity limit. The reported memory contains 128 locations. Once traversal wraps around and writes revisit occupied locations, earlier information can be overwritten. Successful extrapolation within that workspace does not imply an unbounded storage procedure.

#### Restore focus after movement

Soft shifting can gradually disperse attention. The final addressing stage counters this effect:

```
w_t(i) ← w̃_t(i)^γ_t / Σ_j w̃_t(j)^γ_t
```

The scalar γ_t is at least 1 and controls sharpening. The shifted weights w̃_t are raised to that power and normalised across locations j. The result w_t is the final access weighting supplied to a read or write operation.

When γ_t exceeds 1, larger weights become more dominant relative to smaller weights. This lets the controller maintain concentrated attention despite uncertainty introduced during shifting. Sharpening does not identify the correct address on its own; it reinforces the distribution produced by earlier stages.

Together, the stages support distinct access patterns. A head can retrieve by content, retrieve and then move to a nearby location, or keep moving relative to its previous position. The experiments interpret copying mainly through repeated movement, associative recall through lookup followed by an offset, and dynamic prediction through repeated access to context-dependent storage.

#### Choose what belongs inside the controller

A recurrent controller can hold intermediate information internally as well as in the memory matrix. The authors compare this state to processor registers alongside a larger random-access store. Information read earlier can remain available for later operations without being retrieved again at the same moment.

A feedforward controller lacks that private recurrent state, but the complete NTM is still stateful. It can use the external memory to carry information forward. This makes its access traces potentially easier to understand because more of the computation must pass through the visible memory interface.

The tradeoff concerns simultaneous access. With an individual read head, a feedforward controller operates on an individual retrieved vector at an update. More heads make more vectors concurrently available. A recurrent controller can instead retain earlier read results and combine them later. Head count therefore changes the effective computational interface, especially for tasks requiring comparisons or combinations of stored items.

#### Train on episodes with known targets

All experiments use supervised episodes with binary target values. Logistic sigmoid outputs supply the predictions, and cross-entropy measures their disagreement with the targets. Reported prediction error is expressed as bits-per-sequence. This measure evaluates predictive quality across the episode; it is not a percentage of completely correct sequences.

The dynamic state is reset at the start of every episode. For standalone LSTM networks, the initial hidden state is a learned bias. For an NTM, the controller state, previous read vectors and memory contents are reset to bias values. This makes the intended adaptation occur within the current episode rather than through unrestricted carry-over from earlier examples.

Training uses RMSProp with momentum 0.9. During back-propagation, individual gradient components are clipped to the interval (-10, 10). The LSTM networks have three stacked hidden layers. The paper also distinguishes parameter scaling: increasing LSTM hidden width brings quadratic growth through recurrent connections, whereas increasing the NTM’s number of storage locations does not add controller parameters merely because the workspace is larger.

The task generators supply the training data. Depending on the experiment, they create binary vectors, delimiters, repeat controls, changing transition probabilities or priorities. The controller receives examples of the required behaviour, without annotated memory addresses or a supplied sequence of algorithmic instructions.

### Experiments and results

#### What the comparisons measure

The experimental comparison uses a standalone LSTM and NTMs with either feedforward or LSTM controllers. This separates the effect of external memory from the choice of controller. The central questions are how quickly each architecture learns, what prediction cost it reaches, and whether the learned behaviour survives changes beyond the training range.

The paper presents learning curves and memory visualisations rather than a comprehensive numerical results table. Its prose gives some exact evaluation conditions and selected performance statements, but not exact endpoint losses for every comparison. The strongest account therefore combines the stated numbers with the qualitative relationships established by the curves, without assigning invented numerical scores.

Generalisation receives particular attention. A new random vector within the training length range tests whether the system memorised particular inputs. A substantially longer sequence asks something stronger: whether the operation itself can be reused for a longer execution. The experiments use both kinds of evidence, and the distinction is central to interpreting their results.

#### Copying arbitrary vectors

The copy task supplies random eight-bit vectors, followed by a delimiter. During training, sequence lengths range from 1 to 20. The desired output repeats the vectors and omits the delimiter. No further input is supplied while the output targets are presented, so the network must rely on retained information.

Both NTM variants learn markedly faster than the standalone LSTM and reach a lower cost in the learning curves. The authors interpret the size of the qualitative separation as evidence that the systems may be solving the task differently, rather than merely learning the same strategy at different speeds.

The longer-sequence tests sharpen that interpretation. The NTM figure includes sequences of length 10, 20, 30 and 50, followed by a longer case of length 120. The shorter displayed cases are reproduced confidently with few mistakes, including lengths beyond the training maximum. The longest displayed sequence contains local errors and a duplicated vector that displaces subsequent outputs.

That duplication illustrates an important property of sequence loss. Much of the output may resemble the intended copy, yet a displaced suffix can receive a high cost because subsequent predictions are compared with targets at the original positions. A recognisable procedure and low measured loss are related but not interchangeable observations.

The standalone LSTM reproduces examples within the training range well, then deteriorates on longer sequences. Its accurate prefix also becomes shorter as total sequence length increases. The authors take this as evidence of difficulty maintaining the earlier information across the extended delay.

For the NTM, the practical limit eventually comes from its 128 memory locations. Circular traversal revisits storage and overwrites previous writes. The result therefore supports extrapolation of a learned copying procedure within finite resources, rather than copying at arbitrary length.

#### Repeating a stored sequence

Repeated copying adds a control value specifying how frequently to reproduce the input. It also requires an end marker after the requested output is complete. The input vectors are random and eight-dimensional, while both sequence length and repetition count are sampled from one to ten during training. The numerical repetition input is normalised to mean zero and variance one.

The NTM learns faster, although the paper reports that both the NTM and standalone LSTM can solve the training task perfectly. The authors note that the LSTM’s stronger showing here than in ordinary copying may reflect the shorter input sequences and the larger LSTM configuration used for this experiment.

Extrapolation exposes different weaknesses. The tests increase input length and repetition count separately. The NTM handles longer inputs almost perfectly. It also continues reproducing the stored sequence when asked for more repetitions, but its stopping behaviour breaks down outside the familiar count range.

The figure description states that, beyond the eleventh repetition, the NTM emits the end marker after each repetition rather than locating the requested end correctly. Thus retaining and repeatedly traversing the input transfers more successfully than interpreting the unfamiliar control value and tracking completion.

The LSTM struggles with both enlarged dimensions, diverging from the required content. This gives the external-memory architecture a clear advantage, but the NTM result is still partial. It has learned reusable copying behaviour without a correspondingly reliable extrapolating counter and termination rule.

#### Retrieving what follows a queried item

Associative recall tests a more structured relationship between stored data. The input contains a sequence of delimited items. Afterward, the network sees an item from that sequence as a query and must return the following item. It must therefore identify where the query occurred and use that identification to retrieve different data.

Each item contains three binary vectors with six bits each, making 18 bits per item. Training episodes contain between 2 and 6 items. The task is harder than simply reproducing a sequence because the answer depends on both a content match and the order in which items were supplied.

The NTM reaches near-zero cost within roughly 30,000 episodes. The standalone LSTM still has not reached zero cost after a million episodes. Among the NTM variants, the feedforward controller learns faster than the LSTM controller. The authors interpret these results as evidence that explicit memory is particularly useful for retaining the required structure.

For longer lists, the feedforward-controller NTM is nearly perfect at 12 items. At 15 items, its average prediction cost remains below 1 bit per sequence. These are specific conditions, not a universal capacity claim: the item representation and task stay fixed while the number of stored items increases.

The chart compares training coverage with the longer list size reported as almost perfectly handled. Its metric is item-sequence length, not error or accuracy; it shows the extent of the tested extrapolation.

Associative recall: training coverage and near-perfect test length The feedforward NTM retains near-perfect recall beyond the training list range.

**The numbers**

| System or setting | items per sequence |
| --- | --- |
| Feedforward NTM, maximum training length | 6 |
| Feedforward NTM, near-perfect test length (this paper) | 12 |

The standalone LSTM generalises less successfully to longer lists, while both external-memory variants extend further. The feedforward result is especially informative because its controller cannot conceal the entire task history in a private recurrent state. The memory interface must support the relevant retention and access.

#### Adapting to a new binary process

The dynamic [N-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/) experiment asks whether an NTM can learn from observations within an episode. The generator uses binary 6-Gram distributions: the probability of the next bit depends on the preceding five-bit context. Every possible context has its own probability of being followed by a one.

The size of the probability table is:

```
2^5 = 32
```

The base 2 represents the binary alternatives at each context position, the exponent 5 is the context length, and 32 is the number of possible contexts. The equation counts contexts; it does not describe the memory size of the NTM.

At the start of a training example, the generator independently samples 32 transition probabilities from a Beta distribution with parameters 1/2 and 1/2. It then generates a sequence containing 200 bits. The initial 5 bits are independent Bernoulli draws with p=0.5 because the full conditioning context is not yet present.

The network observes each bit and predicts the next. Since the transition table changes between examples, successful prediction requires adapting to the current sequence. Persistent training can teach how to estimate a distribution, but it cannot supply the exact episode-specific probabilities in advance.

The paper provides an optimal Bayesian reference:

```
P(B = 1 | N_1, N_0, c) = (N_1 + 1/2) / (N_1 + N_0 + 1)
```

Here B is the next bit, c is the preceding five-bit context, N_1 counts observed ones following that context, and N_0 counts observed zeros following it. P is the conditional probability estimate. The fractional terms express the prior associated with the generator’s Beta distribution.

This reference makes the task unusually diagnostic. It is possible to compare the network’s evolving predictions with an estimator that uses the relevant sufficient counts. The question is not merely whether prediction improves, but whether the temporary memory supports something resembling the appropriate online calculation.

Validation uses 1000 sequences, each of length 200, sampled in the same way as the training examples. The NTM obtains a modest advantage over LSTM, described by the authors as significant, but remains above the optimal cost. The paper does not supply an exact numerical margin in its prose.

The prediction traces often place the NTM close to the optimal estimator. They also include clear mistakes. One is associated with access to storage corresponding to an inappropriate context. This connects an external prediction error to a plausible internal cause and shows why a near-optimal-looking trajectory should not be mistaken for exact implementation of the Bayesian rule.

#### Sorting by supplied priorities

Priority sorting supplies a sequence of random binary vectors, each accompanied by a scalar priority. Priorities are drawn uniformly from [-1, 1]. An input contains 20 vectors, and the target contains the 16 with highest priorities, arranged according to priority order.

The task therefore combines selection and ordering. Reproducing every input vector in its original position is insufficient. The system must use the accompanying scalar to determine which vectors belong in the output and how the retained vectors should be arranged.

The authors chose an output size of 16 in part because they wanted to investigate whether the network would discover a heap-based procedure with depth 4. The memory analysis instead supports a different account: write locations vary approximately as a linear function of priority, and reads then proceed through locations in increasing order.

Both NTM controller variants substantially outperform the standalone LSTM in the learning curves. For the feedforward controller, the best performance requires eight parallel read and write heads. The authors suggest that the need for these heads may reflect the difficulty of sorting with only unary vector operations available at an update.

No exact final sorting cost is stated in the prose. The supported conclusions are that the external-memory systems learn substantially better under the reported conditions and that their storage pattern has an interpretable relationship to priority. The experiment does not demonstrate that the learned strategy is a general-purpose comparison sort for arbitrary input sizes.

### What the ablations show

The paper does not provide a systematic component-removal ablation study; it instead offers controller comparisons, extrapolation tests and analyses of memory access.

#### External memory and controller choice

Comparing standalone LSTM with LSTM-controlled NTM asks what happens when a recurrent controller gains a writable external workspace. The broad improvement across the algorithmic tasks supports the usefulness of that workspace. However, these are configured architecture comparisons, not perfectly matched interventions differing only in an isolated operation.

The feedforward-controller NTM supplies a complementary comparison. Its success shows that a private recurrent controller state is not necessary for the demonstrated behaviours. In associative recall, it even learns faster than the recurrent-controller NTM. This suggests that adding internal recurrence does not automatically make the external resource easier to use.

At the same time, the feedforward interface imposes a bottleneck through head count. The priority-sort result, where eight parallel heads give the best performance, is consistent with the authors’ discussion of simultaneous access. It does not isolate exactly which comparison or storage operation benefits from each additional head.

#### Copying exposes a traversal procedure

The copy traces show concentrated writes progressing through memory and concentrated reads revisiting the corresponding locations. The added vectors resemble the later read vectors, linking storage directly to output. This makes an array-like explanation more persuasive than a claim based only on successful predictions.

The inferred procedure is to move to a starting position, store incoming vectors while advancing, return to the start, and read them in order. Content addressing helps recover the start, while location shifts govern traversal. The authors also argue that maintaining previous attention is important for longer executions and that sharpening likely prevents focus from becoming diffuse.

These are mechanistic interpretations supported by traces. The paper does not present a complete set of experiments removing interpolation, shifting and sharpening independently. As a consequence, the evidence for the full procedure is stronger than the evidence assigning a measured contribution to every addressing component.

#### Associative recall exposes lookup followed by movement

In the analysed associative-recall episode, the controller writes information even when an item delimiter arrives. Those delimiter-associated writes differ across items. The authors interpret them as compressed representations of the preceding item’s constituent vectors.

When the query appears, the controller appears to reconstruct the corresponding compressed representation and locate its earlier occurrence through content similarity. It then shifts the resulting attention to reach the next stored item. This explains how querying one item produces another without requiring the controller to maintain an explicit symbolic pointer in its internal state.

The analysis supports a particular combination of content and position. It does not establish that all trained NTMs use identical compressed representations or that those representations will distinguish every possible item without error. Its value is that the proposed mechanism accounts for the observed write events, lookup key and subsequent reads.

#### Statistical adaptation and sorting suggest different storage organisations

The dynamic prediction traces suggest repeated access to context-specific records. When the same context recurs, the read head returns to the same location, followed by a write at the next step. Add vectors respond differently to observed zeros and ones, supporting the interpretation of a distributed counting mechanism.

The authors remain cautious about its exact form. Weaker write weights after repeated observations might indicate storage of a proportion rather than literal accumulated counts. This matters because a useful predictive statistic can be represented in several ways; the traces do not uniquely identify the numerical code.

For priority sorting, fitting a linear relationship between priority and write location tests a more specific hypothesis. The fit closely follows the observed addresses, and ascending reads explain the output order. The evidence therefore favours priority-dependent placement over the particular heap-based solution the authors had initially considered. It is an analysis of the discovered procedure, rather than proof that the architecture has acquired a conventional sorting algorithm.

### Limitations

#### Limits explicitly identified by the authors

The authors describe the experiments as preliminary and focus on simple algorithmic tasks. This scope matters. Binary vectors and controlled markers make the intended operation clear and allow memory behaviour to be inspected. Success in these settings establishes useful capabilities, but it leaves open how the architecture behaves when inputs are ambiguous, noisy or less explicitly structured.

Finite storage is an acknowledged limit on copying. The tested memory has 128 locations, and circular movement eventually revisits earlier writes. The system’s ability to extend an operation beyond its training length therefore depends on remaining within the resources required by its learned storage scheme.

The repeated-copy experiment reveals another stated limitation: unfamiliar repetition counts are not handled reliably. The system continues producing copies but fails to place the final marker correctly. The authors suggest that the numerical representation of the requested count makes extrapolation beyond the trained range difficult. This is a proposed explanation, instead of an independently established cause.

The statistical task also remains below its optimal reference. The memory visualisation identifies an apparent access error, while the broader account of counts and ratios remains tentative. The architecture can acquire a useful adaptive strategy without implementing the reference estimator exactly.

The authors explicitly discuss a feedforward-controller constraint as well. Its available simultaneous operations depend on how many vectors can be read at once. Recurrent controllers can retain earlier read results internally, whereas a feedforward controller may need more heads or additional external-memory operations to combine information.

#### Limits visible in the experimental setup

The tasks are strongly structured. Delimiters identify boundaries, a dedicated channel supplies the repetition control, and priorities accompany the vectors to be sorted. A careful reader should therefore separate learning a procedure over clearly marked inputs from discovering the relevant organisation in unconstrained data.

The experiments also reset dynamic state between episodes. The temporary memory supports learning within the current problem instance, but the results do not demonstrate indefinite accumulation across a continuous stream. In particular, the dynamic prediction experiment tests adaptation to a newly sampled process within an episode, not persistent management of an evolving knowledge store.

Length generalisation is conditional on the rest of the task staying comparable. In associative recall, longer lists contain items of the same form. In copying, the vector format stays fixed while the number of vectors increases. These are meaningful tests of repeated execution, but they do not show transfer to a new representation, a new operation or an unfamiliar combination of tasks.

Different generalisation dimensions can also expose different learned subprocedures. The repeated-copy result prevents a broad conclusion that the NTM has learned the entire task in an algorithmically unrestricted sense. Its traversal transfers more successfully than its control of repetition and termination. The paper’s evidence is strongest when attached to those individual behaviours.

#### What the comparisons cannot isolate

Architecture comparisons combine several choices: controller type, internal state, head count and task-specific configurations. The paper explains these choices and reports learning curves, but it does not provide a comprehensive factorial study separating their contributions. The advantage over standalone LSTM should therefore be understood as an advantage of the reported systems under their chosen settings.

Parameter scaling is informative but incomplete as an efficiency argument. Memory locations can be added without expanding the learned parameter set, whereas larger LSTM hidden layers introduce more recurrent parameters. That does not establish equal computational cost, equal training time or equal resource use for every memory size.

The prose does not provide exact final losses for all tasks, repeated-run variability, or a uniform set of numerical margins between systems. The authors’ statement of a significant advantage in dynamic prediction should be retained at that level of specificity. It cannot support an invented confidence interval or an unstated effect size.

There is also a difference between inspecting a memory interface and fully understanding a computation. Concentrated reads make traversal visible, but the meanings of stored components can remain distributed. The associative item representations and statistical updates require interpretation. The most convincing explanations are those that connect several observations, instead of assigning a symbolic meaning to a vector solely because the output is correct.

#### What the machine analogy leaves open

An NTM is differentiable and finite in these experiments. Its addresses can remain distributed, its stored information can be mixed, and approximate operations can accumulate error. The machine analogy usefully identifies controller, storage and access, but it does not supply the guarantees associated with an exact discrete program.

The paper also does not demonstrate arbitrary program composition. Repeated copying is motivated as a move toward nesting a learned operation inside another procedure, yet the count-generalisation failure shows how demanding that objective remains. There is no broad test here of learning independently reusable subroutines and reliably combining them into new programs.

Finally, the connection to human working memory is functional. The architecture borrows selective attention and temporary storage as organising ideas. The authors do not show that its equations describe biological memory mechanisms, nor do the synthetic experiments establish a theory of human reasoning or language.

### What came after

The later citation record connects Neural Turing Machines with research on explicit memory, attention, retrieval and learned computation. A citation does not on its own establish that a later system adopts NTM addressing or its erase-and-add equations. The useful distinction is between sharing the broader problem—how a learned system accesses and manipulates information—and reusing the particular architecture. For the works below, the supported connections vary in specificity.

#### Memory becomes a more explicit research direction

[Ask Me Anything: Dynamic Memory Networks for Natural Language Processing](https://md.research.elamur.ai/free/en/papers/kumar-2015-ask-me-anything-dynamic-memory/) proposes treating a range of language tasks as answering a question about an input. Among the examples it states are translation, coreference, tagging and sentiment classification. This connects with the NTM’s broader concern about retaining input-dependent information and retrieving what a later request requires. The later work changes the application setting toward language tasks; the citation alone does not establish that it uses the same addressing pipeline.

[Dynamic Key-Value Memory Networks for Knowledge Tracing](https://md.research.elamur.ai/free/en/papers/zhang-2017-dynamic-key-value-memory-networks/) places an explicit memory architecture in the setting of knowledge tracing. Its title identifies a distinction between keys and values, making it a relevant continuation of the broader question of how access cues relate to stored information. The available citation information does not establish how its update rules compare with the NTM, so it should not be described as a direct reproduction of the earlier mechanism.

[Memorizing Normality to Detect Anomaly: Memory-Augmented Deep Autoencoder for Unsupervised Anomaly Detection](https://md.research.elamur.ai/free/en/papers/gong-2019-memorizing-normality-detect-anomaly-memory/) carries the memory-augmentation theme into anomaly detection. The title supports that application-level connection. It does not establish that temporary episodic storage, learned traversal or location shifts play the same role there. Read alongside the NTM, the relevant question becomes what a memory is intended to retain and how that stored information constrains the system’s output.

[Recurrent Attention Network on Memory for Aspect Sentiment Analysis](https://md.research.elamur.ai/free/en/papers/chen-2017-recurrent-attention-network-memory-aspect/) provides another application-level connection, joining memory and recurrent attention in aspect-based sentiment analysis. The NTM had made selective access to an explicit store a central architectural operation. The later title shows that the combination of memory and attention also appears in task-focused language research, while leaving its precise relationship to NTM storage operations unspecified.

#### Retrieval broadens the question of where information lives

[Reading Wikipedia to Answer Open-Domain Questions](https://md.research.elamur.ai/free/en/papers/chen-2017-reading-wikipedia-answer-open-domain/) studies factoid [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/) over a large text collection, using English Wikipedia as its knowledge source. It excludes knowledge bases and redundancy across several sources. This is a different storage setting from the NTM’s episode-specific writable matrix, but it makes the separation between a reasoning system and the information it accesses especially clear.

The connection is therefore conceptual rather than an assertion of shared equations. NTM memory is written during the current computation and then selectively revisited. A [question-answering](https://md.research.elamur.ai/free/en/topics/question-answering/) system over Wikipedia works with an existing collection. Both settings require useful access, but the construction, persistence and supervision of the information resource differ.

[REALM: Retrieval-Augmented Language Model Pre-Training](https://md.research.elamur.ai/free/en/papers/guu-2020-realm-retrieval-augmented-language-model/) also belongs to this wider retrieval direction, as its title indicates. It concerns retrieval augmentation during pretraining. The citation record supports placing it near the question of how a learned system uses information outside its immediate internal state; it does not establish adoption of the NTM’s writable workspace or relative address shifts.

#### Copying and attention become specialised mechanisms

[Incorporating Copying Mechanism in Sequence-to-Sequence Learning](https://md.research.elamur.ai/free/en/papers/gu-2016-incorporating-copying-mechanism-sequence-sequence/) takes copying into a sequence-to-sequence setting. The relation to the NTM is clear at the level of the operation being studied: preserving input information and producing it later is important enough to merit an explicit mechanism. The citation information does not specify whether that mechanism uses an NTM-style memory bank, so the commonality should remain at the level of the copying problem.

[Attention-Based Models for Speech Recognition](https://md.research.elamur.ai/free/en/papers/chorowski-2015-attention-based-models-speech-recognition/) places attention in speech recognition. The NTM uses attention to regulate access to writable storage; the later title places attention within a different task. Their shared research question concerns selective access during sequential computation, while the precise resources attended to and the relevant movement rules cannot be inferred from the citation alone.

[Efficient Content-Based Sparse Attention with Routing Transformers](https://md.research.elamur.ai/free/en/papers/roy-2020-efficient-content-based-sparse-attention/) names content-based sparse access as its focus. This gives a useful point of comparison with the NTM’s content-derived weighting and its frequently concentrated access patterns. It does not establish that the later work uses writable episodic memory or the NTM’s interpolation, circular convolution and sharpening sequence.

#### Learned computation remains a distinct line of inquiry

[Show your work: Scratchpads for intermediate computation with language models](https://md.research.elamur.ai/free/en/papers/al-2021-show-your-work-scratchpads-intermediate/) concerns intermediate computation expressed through scratchpads, according to its title. The connection to the NTM is the broader idea that a learned system can benefit from a place to maintain work in progress. A textual scratchpad and a differentiable matrix are different interfaces, so one should not assume that their storage, supervision or execution properties coincide.

[Adaptive Computation Time for Recurrent Neural Networks](https://md.research.elamur.ai/free/en/papers/graves-2016-adaptive-computation-time-recurrent-neural/) names a complementary concern: how much computation a recurrent system performs. The NTM concentrates on access to temporary storage. Reading the two directions together raises a broader architectural question about the resources required by learned procedures: where intermediate information is kept and how execution is controlled. The later citation supplies a connection to that question without establishing a combined solution.

These later works place the NTM within several continuing research problems rather than a single uniform architectural lineage. Some concern memory, some selective access, some retrieval, and others copying or intermediate computation. The lasting contribution visible in the original experiments is a precise demonstration that storage operations themselves can be learned—and that inspecting those operations reveals both the reach and the fragility of the resulting procedures.

## Cite

Cite as Alex Graves, Greg Wayne and Ivo Danihelka. 2014. Neural Turing Machines. arXiv:1410.5401.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.1410.5401](https://doi.org/10.48550/arxiv.1410.5401) · [arXiv 1410.5401](https://arxiv.org/abs/1410.5401)

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

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
