Skip to main content
QUICK REVIEW

[Paper Review] Implementing Neural Turing Machines

Mark Collier, Joeran Beel|arXiv (Cornell University)|Jul 23, 2018
Domain Adaptation and Few-Shot LearningComputer Science9 references9 citations
TL;DR

This paper presents a stable, high-performing implementation of Neural Turing Machines (NTMs) that successfully replicates the original NTM's performance on three benchmark sequence learning tasks—Copy, Repeat Copy, and Associative Recall. The key contribution is identifying constant initialization of memory contents as the critical factor enabling fast, reliable training, with convergence 2× faster than alternative schemes, and releasing a publicly available, stable TensorFlow-based implementation.

ABSTRACT

Neural Turing Machines (NTMs) are an instance of Memory Augmented Neural Networks, a new class of recurrent neural networks which decouple computation from memory by introducing an external memory unit. NTMs have demonstrated superior performance over Long Short-Term Memory Cells in several sequence learning tasks. A number of open source implementations of NTMs exist but are unstable during training and/or fail to replicate the reported performance of NTMs. This paper presents the details of our successful implementation of a NTM. Our implementation learns to solve three sequential learning tasks from the original NTM paper. We find that the choice of memory contents initialization scheme is crucial in successfully implementing a NTM. Networks with memory contents initialized to small constant values converge on average 2 times faster than the next best memory contents initialization scheme.

Motivation & Objective

  • To address the lack of stable, reproducible open-source implementations of Neural Turing Machines (NTMs) that replicate the original results.
  • To identify and evaluate key implementation choices—especially memory contents initialization—that significantly impact NTM training stability and convergence speed.
  • To develop and release a reliable, performant NTM implementation using TensorFlow that matches published performance on standard sequence learning tasks.
  • To demonstrate that constant initialization of memory contents leads to faster convergence than random or learned initialization schemes.

Proposed method

  • The implementation uses a controller network with read and write heads that access an external memory matrix via a soft attentional addressing mechanism combining content-based and location-based addressing.
  • The addressing mechanism computes attention weights through a sequence of operations: content-based weighting (Equation 1), temporal interpolation (Equation 3), shift-based iteration (Equation 4), and sharpening (Equation 5).
  • Memory updates are performed using erase and add vectors (Equations 7–8), allowing precise write operations with attention-weighted influence.
  • The study compares five memory initialization schemes: constant, random, learned, Xavier, and He initialization, evaluating convergence speed and stability across three sequence tasks.
  • The final implementation uses constant initialization for memory contents, with optimized controller head parameter computation and interface design to improve training stability and integration with TensorFlow.
  • Training is evaluated on three standard tasks: Copy, Repeat Copy, and Associative Recall, with median error curves reported over 10 training runs.

Experimental results

Research questions

  • RQ1What impact does memory contents initialization have on the convergence speed and training stability of Neural Turing Machines?
  • RQ2Why do many open-source NTM implementations fail to replicate the performance reported in the original NTM paper?
  • RQ3Can a stable, high-performing NTM implementation be developed and released that matches the original results and enables further research?
  • RQ4How does constant memory initialization compare to random or learned initialization in terms of learning speed and reliability?
  • RQ5Does the proposed implementation achieve convergence speeds comparable to the original NTM and other MANNs like the Differentiable Neural Computer (DNC)?

Key findings

  • Constant initialization of memory contents results in convergence that is, on average, 2 times faster than the next best initialization scheme (learned initialization) across the three tasks.
  • The NTM implementation with constant memory initialization converges to near-zero error on the Copy task in a number of steps comparable to the best published results and the official DNC implementation.
  • On the Repeat Copy task, the NTM converges 1.44 times slower than the LSTM but 1.06 times faster than the DNC, with both MANNs outperforming the LSTM overall.
  • The NTM implementation successfully solves the Associative Recall task at a speed nearly identical to the original NTM and DNC, while the LSTM fails to solve it within the time limit.
  • The implementation is stable, with no reported gradient explosion (NaN gradients), and is released as open source under an open license for broader research use.
  • The study concludes that memory initialization is a crucial, previously overlooked factor in NTM success, and that constant initialization should be the default choice for new implementations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.