Artificial neural networks are remarkably adept at sensory processing, sequence learning and reinforcement learning, but are limited in their ability to represent variables and data structures and to store data over long timescales, owing to the lack of an external memory. Here we introduce a machine learning model called a differentiable neural computer (DNC), which consists of a neural network that can read from and write to an external memory matrix, analogous to the random-access memory in a conventional computer. Like a conventional computer, it can use its memory to represent and manipulate complex data structures, but, like a neural network, it can learn to do so from data. When trained with supervised learning, we demonstrate that a DNC can successfully answer synthetic questions designed to emulate reasoning and inference problems in natural language. We show that it can learn tasks such as finding the shortest path between specified points and inferring the missing links in randomly generated graphs, and then generalize these tasks to specific graphs such as transport networks and family trees. When trained with reinforcement learning, a DNC can complete a moving blocks puzzle in which changing goals are specified by sequences of symbols. Taken together, our results demonstrate that DNCs have the capacity to solve complex, structured tasks that are inaccessible to neural networks without external read–write memory.
- Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems Vol. 25 (eds et al.) 1097–1105 (Curran Associates, 2012) , &
- http://arxiv.org/abs/1308.0850 (2013) Generating sequences with recurrent neural networks. Preprint at
- Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems Vol. 27 (eds et al.) 3104–3112 (Curran Associates, 2014) , &
- Human-level control through deep reinforcement learning. Nature 518, 529–533 (2015) et al.
- Memory and the Computational Brain: Why Cognitive Science Will Transform Neuroscience (John Wiley & Sons, 2011) &
- The Algebraic Mind: Integrating Connectionism and Cognitive Science (MIT Press, 2001)
- Indirection and symbol-like processing in the prefrontal cortex and basal ganglia. Proc. Natl Acad. Sci. USA 110, 16390–16395 (2013) , , &
- Learning distributed representations of concepts. In Proc. Eighth Annual Conference of the Cognitive Science Society Vol. 1, 1–12 (Lawrence Erlbaum Associates, 1986)
- From machine learning to machine reasoning. Mach. Learn. 94, 133–149 (2014)
- Cascade models of synaptically stored memories. Neuron 45, 599–611 (2005) , &
- Memory traces in dynamical systems. Proc. Natl Acad. Sci. USA 105, 18970–18975 (2008) , &
- Sparse Distributed Memory (MIT press, 1988)
- Characteristics of sparsely encoded associative memory. Neural Netw. 2, 451–457 (1989) .
- http://arxiv.org/abs/1410.3916 (2014) , & Memory networks. Preprint at
- Pointer networks. In Advances in Neural Information Processing Systems Vol. 28 (eds et al.) 2692–2700 (Curran Associates, 2015) , &
- http://arxiv.org/abs/1410.5401 (2014) , & Neural Turing machines. Preprint at
- http://arxiv.org/abs/1409.0473 (2014) , & Neural machine translation by jointly learning to align and translate. Preprint at
- DRAW: a recurrent neural network for image generation. In Proc. 32nd International Conference on Machine Learning (eds & ) 1462–1471 (JMLR, 2015) , , , &
- MINERVA 2: a simulation model of human memory. Behav. Res. Methods Instrum. Comput. 16, 96–101 (1984)
- http://arxiv.org/abs/1506.07285 (2015) et al. Ask me anything: dynamic memory networks for natural language processing. Preprint at
- End-to-end memory networks. In Advances in Neural Information Processing Systems Vol. 28 (eds et al.) 2431–2439 (Curran Associates, 2015) et al.
- A synaptically controlled, associative signal for Hebbian plasticity in hippocampal neurons. Science 275, 209–213 (1997) &
- Paradox of pattern separation and adult neurogenesis: a dual role for new neurons balancing memory resolution and robustness. Neurobiol. Learn. Mem. 129, 60–68 (2016) , , , &
- Hippocampal conjunctive encoding, storage, and recall: avoiding a trade-off. Hippocampus 4, 661–682 (1994) &
- A distributed representation of temporal context. J. Math. Psychol. 46, 269–299 (2002) &
- http://arxiv.org/abs/1502.05698 (2015) , , & Towards AI-complete question answering: a set of prerequisite toy tasks. Preprint at
- Long short-term memory. Neural Comput. 9, 1735–1780 (1997) &
- Curriculum learning. In Proc. 26th International Conference on Machine Learning (eds & ) 41–48 (ACM, 2009) , , &
- http://arxiv.org/abs/1410.4615 (2014) & Learning to execute. Preprint at
- Procedures as a Representation for Data in a Computer Program for Understanding Natural Language. Report No. MAC-TR-84 (DTIC, MIT Project MAC, 1971)
- Symbolic communication between two pigeons (Columba livia domestica). Science 207, 543–545 (1980) , &
- Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychol. Rev. 102, 419–457 (1995) , &
- What learning systems do intelligent agents need? Complementary learning systems theory updated. Trends Cogn. Sci. 20, 512–534 (2016) , &
- Considerations arising from a complementary learning systems perspective on hippocampus and neocortex. Hippocampus 6, 654–665 (1996) &
- Human-level concept learning through probabilistic program induction. Science 350, 1332–1338 (2015) , &
- One-shot generalization in deep generative models. In Proc. 33nd International Conference on Machine Learning (eds & ) 1521–1529 (JMLR, 2016) , , , &
- Meta-learning with memory-augmented neural networks. In Proc. 33nd International Conference on Machine Learning (eds & ) 1842–1850 (JMLR, 2016) , , , &
- The role of context in object recognition. Trends Cogn. Sci. 11, 520–527 (2007) &
- Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems Vol. 28 (eds et al.) 1693–1701 (Curran Associates, 2015) et al.
- The Hippocampus as a Cognitive Map (Oxford Univ. Press, 1978) &
- Speech recognition with deep recurrent neural networks. In IEEE International Conference on Acoustics, Speech and Signal Processing (eds et al.) 6645–6649 (Curran Associates, 2013) , &
- Memory Management (ed. ) 1–116 (Springer, 1995) , , & Dynamic storage allocation: a survey and critical review. In
- A reduction of imitation learning and structured prediction to no-regret online learning. In Proc. Fourteenth International Conference on Artificial Intelligence and Statistics (eds et al.) 627–635 (JMLR, 2010) , &
- Search-based structured prediction. Mach. Learn. 75, 297–325 (2009) , &
- Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn. 8, 229–256 (1992)
- Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems Vol. 12 (eds et al.) 1057–1063 (MIT Press, 1999) , , &
- http://arxiv.org/abs/1506.02438 (2015) , , , & High-dimensional continuous control using generalized advantage estimation. Preprint at
- Visualizing data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008) &
- Large scale distributed deep networks. In Advances in Neural Information Processing Systems Vol. 25 (eds et al.) 1223–1231 (Curran Associates, 2012) et al.
- Backpropagation through time: what it does and how to do it. Proc. IEEE 78, 1550–1560 (1990)
- RmsProp: divide the gradient by a running average of its recent magnitude. Lecture 6.5 of Neural Networks for Machine Learning (COURSERA, 2012); available at http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf &
Extended data figures and tables
Extended Data Figures
- Extended Data Figure 1: Dynamic memory allocation. (150 KB)
We trained the DNC on a copy problem, in which a series of 10 random sequences was presented as input. After each input sequence was presented, it was recreated as output. Once the output was generated, that input sequence was not needed again and could be erased from memory. We used a DNC with a feedforward controller and a memory of 10 locations—insufficient to store all 50 input vectors with no overwriting. The goal was to test whether the memory allocation system would be used to free and re-use locations as needed. As shown by the read and write weightings, the same locations are repeatedly used. The free gate is active during the read phases, meaning that locations are deallocated immediately after they are read from. The allocation gate is active during the write phases, allowing the deallocated locations to be re-used.
- Extended Data Figure 2: Altering the memory size of a trained network. (197 KB)
A DNC trained on the traversal task with 256 memory locations was tested while varying the number of memory locations and graph triples. The heat map shows the fraction of traversals of length 1–10 performed perfectly by the network, out of a batch of 100. There is a clear correspondence between the number of triples in the graph and the number of memory locations required to solve the task, reflecting our earlier analysis (Fig. 3) that suggests that DNC writes each triple to a separate location in memory. The network appears to exploit all available memory, regardless of how much memory it was trained with. This supports our claim that memory is independent of processing in a DNC, and points to large-scale applications such as knowledge graph processing.
- Extended Data Figure 3: Probability of achieving optimal solution. (137 KB)
a, DNC. With 10 goals, the performance of a DNC network with respect to satisfying constraints in minimal time as the minimum number of moves to a goal and the number of constraints in a goal are varied. Performance was highest with a large number of constraints in each goal. b, The performance of an LSTM on the same test.
- Extended Data Figure 4: Effect of link matrix sparsity on performance. (461 KB)
We trained the DNC on a copy problem, for which a sequence of length 1–100 of size-6 random binary vectors was given as input, and an identical sequence was then required as output. A feedforward controller was used to ensure that the sequences could not be stored in the controller state. The faint lines show error curves for 20 randomly initialized runs with identical hyper-parameters, with link matrix sparsity switched off (pink), sparsity used with K = 5 (green) and with the link matrix disabled altogether (blue). The bold lines show the mean curve for each setting. The error rate is the fraction of sequences copied with no mistakes out of a batch of 100. There does not appear to be any systematic difference between no sparsity and K = 5. We observed similar behaviour for values of K between 2 and 20 (plots omitted for clarity). The task cannot easily be solved without the link matrix because the input sequence has to be recovered in the correct order. Note the abrupt drops in error for the networks with link matrices: these are the points at which the system learns a copy algorithm that generalizes to longer sequences.
Extended Data Tables
- Video 1: Shortest Path Visualisation (2.54 MB, Download)
- This video shows a DNC successfully finding the shortest path between two nodes in a randomly generated graph. By decoding the memory usage of the DNC (as in Fig. 3) we were able to determine which edges were stored in the memory locations it was reading from and writing to at each timestep. The edges being read are shown in pink on the left, while the edges being written are shown in green on the right; the colour saturation indicates the relative strength of the operation. During the initial query phase, the DNC receives the labels for the start and end goal ("390" and "040" respectively). During the ten step planning phase it attempts to determine the shortest path. During this time it repeatedly reads edges close to or along the path, which are indicated by the grey shaded nodes. Beginning with edges attached to the start and end node, it appears to move further afield as the phase progresses. At the same time it writes to several of the edge locations, perhaps marking those edges as visited. Finally, during the answer phase, it successively reads the outgoing edges from the nodes along the shortest path, allowing it to correctly answer the query.
- Video 2: Mini-SHRDLU Visualisation (5.16 MB, Download)
- This video shows a DNC successfully performing a reasoning problem in a blocks world. A sequence of letter-labeled goals (S, K, R, Q, E) is presented to the network one step at a time. Each goal consists of a sequence of defining constraints, presented one constraint per time-step. For example, S is: 6 below 2 (6b2); 2 right of 5 (2r5); 6 right of 1 (6r1); 5 above 1 (5a1). On the right, the write head edits the memory, writing information about the goals down. Ultimately, the DNC is commanded to satisfy goal \Q", which it does subsequently by using the read heads to inspect the locations containing goal Q. The constraints constituting goal \Q" are shown below, and the final board position is correct.
- Supplementary Information (85 KB)
This file contains a glossary of symbols and the complete equations.