Complete Technical Paper Content β Neural Turing Machines
1. Executive Abstract, Problem Formulation & Background
A neural Turing machine (NTM) is a recurrent neural network model of a Turing machine. The approach was published by Alex Graves et al. in 2014. NTMs combine the fuzzy pattern matching capabilities of neural networks with the algorithmic power of programmable computers. An NTM has a neural network controller coupled to external memory resources, which it interacts with through attentional mechanisms. The memory interactions are differentiable end-to-end, making it possible to optimize them using gradient descent. An NTM with a long short-term memory (LSTM) network controller can infer simple algorithms such as copying, sorting, and associative recall from examples alone. The authors of the original NTM paper did not publish their source code. The first stable open-source implementation was published in 2018 at the 27th International Conference on Artificial Neural Networks, receiving a best-paper award. Other open source implementations of NTMs exist but as of 2018 they are not sufficiently stable for production use. The developers either report that the gradients of their implementation sometimes become NaN during training for unknown reasons and cause training to fail; report slow convergence; or do not report the speed of learning of their implementation. Differentiable neural computers are an outgrowth of Neural Turing machines, with attention mechanisms that control where the memory is active, and improve performance.
A quantum Turing machine (QTM) or universal quantum computer is an abstract machine used to model the effects of a quantum computer. It provides a simple model that captures all of the power of quantum computationβthat is, any quantum algorithm can be expressed formally as a particular quantum Turing machine. However, the computationally equivalent quantum circuit is a more common model. Quantum Turing machines can be related to classical and probabilistic Turing machines in a framework based on transition matrices. That is, a matrix can be specified whose product with the matrix representing a classical or probabilistic machine provides the quantum probability matrix representing the quantum machine. This was shown by Lance Fortnow.
A way of understanding the quantum Turing machine (QTM) is that it generalizes the classical Turing machine (TM) in the same way that the quantum finite automaton (QFA) generalizes the deterministic finite automaton (DFA). In essence, the internal states of a classical TM are replaced by pure or mixed states in a Hilbert space; the transition function is replaced by a collection of unitary matrices that map the Hilbert space to itself. That is, a classical Turing machine is described by a 7-tuple M = β¨ Q , Ξ , b , Ξ£ , Ξ΄ , q 0 , F β© {\displaystyle M=\langle Q,\Gamma ,b,\Sigma ,\delta ,q_{0},F\rangle } . See the formal definition of a Turing Machine for a more in-depth understanding of each of the elements in this tuple. For a three-tape quantum Turing machine (one tape holding the input, a second tape holding intermediate calculation results, and a third tape holding output):
The set of states Q {\displaystyle Q} is replaced by a Hilbert space. The tape alphabet symbols Ξ {\displaystyle \Gamma } are likewise replaced by a Hilbert space (usually a different Hilbert space than the set of states). The blank symbol b β Ξ {\displaystyle b\in \Gamma } is an element of the Hilbert space. The input and output symbols Ξ£ {\displaystyle \Sigma } are usually taken as a discrete set, as in the classical system; thus, neither the input nor output to a quantum machine need be a quantum system itself. The transition function Ξ΄ : Ξ£ Γ Q β Ξ β Ξ£ Γ Q β Ξ Γ { L , R } {\displaystyle \delta :\Sigma \times Q\otimes \Gamma \to \Sigma \times Q\otimes \Gamma \times \{L,R\}} is a generalization of a semiautomaton and is understood to be a collection of unitary matrices that are automorphisms of the Hilbert space Q {\displaystyle Q} . The initial state q 0 β Q {\displaystyle q_{0}\in Q} may be either a mixed state or a pure state. The set F {\displaystyle F} of final or accepting states is a linear subspace of the Hilbert space Q {\displaystyle Q} . The above is merely a sketch of a quantum Turing machine, rather than its formal definition, as it leaves vague several important details: for example, how often a measurement is performed; see for example, the difference between a measure-once and a measure-many QFA. This question of measurement affects the way in which writes to the output tape are defined.
DAerosol-NTM This repository provides a refined implementation of the DAerosol-NTM framework β a deep learning architecture integrating Neural Turing Machines (NTM) and LSTM for particulate matter and air quality forecasting. π Based on the research article: Zahra-Sadat Asaei-Moamam, Faramarz Safi-Esfahani, Seyedali Mirjalili, et al. Applying deep learning and neural Turing machine in aerosol prediction. Neural Computing and Applications, 2023. DOI: https://doi.org/10.1007/s00521-023-08868-4 π§ Motivation Pollution forecasting is a time-sensitive and data-intensive challenge. This project builds on memory-augmented neural networks using NTMs to allow long-term dependency learning for accurate early prediction of PM2.5, PM10, and AQI. 𧬠Model Architecture Overview The following diagram represents the end-to-end architecture of the DAerosol-NTM system. It includes: Data preprocessing , LSTM parameter initialization , and external memory NTM Controller for interacting with memory (read/write operations) Error correction via RMSE and TIBAAE metrics Final classification of pollution levels using deep learning + memory-augmented outputs Fig. 3 from the paper, illustrating all functions (1β5) of the aerosol prediction pipeline. π Repository Structure DAerosol-NTM/ βββ DL-LSTM.py # Core prediction model βββ DataSet-train&test-OK.xlsx # Input dataset βββ ntm-master/ # Imported NTM module (Google DeepMind) β βββ model.py, copy_task.py, utils.py β βββ images/ # Performance visuals βββ daerosol-ntm-v2-framework.png # Model architecture diagram βββ README.md π Getting Started Dependencies pip install numpy pandas keras tensorflow Run the model python DL-LSTM.py π Metrics Root Mean Squared Error (RMSE) TIBAAE β a novel metric evaluating detection before/after surge events Accuracy and Precision for PM2.5, PM10, and AQI π Citation @article { asaei2023daerosolntm , title = { Applying deep learning and neural Turing machine in aerosol prediction } , author = { Asaei-Moamam, Zahra-Sadat and Safi-Esfahani, Faramarz and Mirjalili, Seyedali and Mohammadpour, Reza and Nadimi-Shahraki, Mohamad-Hosein } , journal = { Neural Computing and Applications } , year = { 2023 } , doi = { doi.org/10.1007/s00521-023-08868-4 } , publisher = { Springer } } π¬ Contact Faramarz Safi-Esfahani β faramarz.safiesfahani@uts.edu.au Zahra-Sadat Asaei-Moamam β zahraasaei@sco.iaun.ac.ir π‘ License For research and academic use only. Contact authors for commercial applications.
This repository provides a refined implementation of the DAerosol-NTM framework β a deep learning architecture integrating Neural Turing Machines (NTM) and LSTM for particulate matter and air quality forecasting.
Zahra-Sadat Asaei-Moamam, Faramarz Safi-Esfahani, Seyedali Mirjalili, et al. Applying deep learning and neural Turing machine in aerosol prediction. Neural Computing and Applications, 2023. DOI: https://doi.org/10.1007/s00521-023-08868-4
Pollution forecasting is a time-sensitive and data-intensive challenge. This project builds on memory-augmented neural networks using NTMs to allow long-term dependency learning for accurate early prediction of PM2.5, PM10, and AQI.
The following diagram represents the end-to-end architecture of the DAerosol-NTM system. It includes:
2. Related Work, Literature Survey & Algorithmic Foundations
Fig. 3 from the paper, illustrating all functions (1β5) of the aerosol prediction pipeline.
DAerosol-NTM/ βββ DL-LSTM.py # Core prediction model βββ DataSet-train&test-OK.xlsx # Input dataset βββ ntm-master/ # Imported NTM module (Google DeepMind) β βββ model.py, copy_task.py, utils.py β βββ images/ # Performance visuals βββ daerosol-ntm-v2-framework.png # Model architecture diagram βββ README.md
@article { asaei2023daerosolntm , title = { Applying deep learning and neural Turing machine in aerosol prediction } , author = { Asaei-Moamam, Zahra-Sadat and Safi-Esfahani, Faramarz and Mirjalili, Seyedali and Mohammadpour, Reza and Nadimi-Shahraki, Mohamad-Hosein } , journal = { Neural Computing and Applications } , year = { 2023 } , doi = { doi.org/10.1007/s00521-023-08868-4 } , publisher = { Springer } }
DAerosol-NTM framework β a deep learning architecture integrating Neural Turing Machines (NTM) and LSTM for particulate matter and air quality forecasting.
Neural Turing Machines : Neural Algorithmic Reasoning Modern AI is extraordinary at recognising patterns it has seen before. But ask it to reliably count, sort, or trace a 10-step logical chain and it starts to fail. This project dives into the architecture that first proposed a solution: the Neural Turing Machine first introduced in GoogleDeepmind's 2014 paper with the same name. By attaching a differentiable external memory to a neural controller, the NTM can learn algorithms via gradient descent not just patterns. We demonstrate this with two experiments: Copy Task the classical benchmark from the original paper Drug Interaction Reasoning : connecting NTMs to a real healthcare problem with 125,000 annual deaths at stake; High-level Architecture : The NTM is an analogy to a classical computer, but every component is a differentiable neural network, so the entire system can be trained end-to-end with backpropagation. Component Breakdown Component Neural Equivalent Classical Computer Equivalent LSTMCell controller Sequential processor CPU External memory Differentiable 2D matrix RAM Content addressing Similarity search Associative lookup Location addressing Circular shift conv Pointer arithmetic Read operation Weighted sum Memory fetch Write operation Erase + add Memory store Experiment 1 : Copy Task Task : Read a random binary sequence β delimiter β reproduce the sequence. This tests whether the NTM learns a genuine scan algorithm. A successful model will show a diagonal pattern in its attention weights confirming it writes left-to-right and reads back in the same order. A vanilla LSTM cannot do this for sequences longer than those seen during training. Training : Curriculum learning that start at length 1, advance to length 10 as the model masters each length (loss < 0.05). Experiment 2 : Drug Interaction Reasoning Task : Each drug is represented as a binary pharmacological fingerprint β a vector of bits encoding which enzyme pathways, receptor classes, and metabolic routes the drug uses (inspired by real molecular fingerprints used in cheminformatics). Rule : Drug i is flagged as dangerous if it shares β₯ K active bits with any previously administered drug in the sequence. This models the real CYP450 enzyme competition mechanism (the most common cause of pharmacokinetic drug interactions). Quick Start # Install dependencies pip install -r requirements.txt # Run the full interactive report (recommended for exam presentation) jupyter notebook notebooks/NTM_Project_Report.ipynb # OR run experiments standalone python experiments/exp1_copy_task.py python experiments/exp2_drug_interaction.py Our Team : We are Lina Raoui , Mouhsine Elaoula , Aymane Amraoui and Soufiane Eloulji 4 junior data engineers from ENSIAS. This project was made during our Introduction to deep learning course.
Modern AI is extraordinary at recognising patterns it has seen before. But ask it to reliably count, sort, or trace a 10-step logical chain and it starts to fail.
This project dives into the architecture that first proposed a solution: the Neural Turing Machine first introduced in GoogleDeepmind's 2014 paper with the same name. By attaching a differentiable external memory to a neural controller, the NTM can learn algorithms via gradient descent not just patterns.
The NTM is an analogy to a classical computer, but every component is a differentiable neural network, so the entire system can be trained end-to-end with backpropagation.
This tests whether the NTM learns a genuine scan algorithm. A successful model will show a diagonal pattern in its attention weights confirming it writes left-to-right and reads back in the same order. A vanilla LSTM cannot do this for sequences longer than those seen during training.
3. Dataset Ingestion, Preprocessing & Stochastic Augmentations
Training : Curriculum learning that start at length 1, advance to length 10 as the model masters each length (loss < 0.05).
Task : Each drug is represented as a binary pharmacological fingerprint β a vector of bits encoding which enzyme pathways, receptor classes, and metabolic routes the drug uses (inspired by real molecular fingerprints used in cheminformatics).
Rule : Drug i is flagged as dangerous if it shares β₯ K active bits with any previously administered drug in the sequence. This models the real CYP450 enzyme competition mechanism (the most common cause of pharmacokinetic drug interactions).
# Install dependencies pip install -r requirements.txt # Run the full interactive report (recommended for exam presentation) jupyter notebook notebooks/NTM_Project_Report.ipynb # OR run experiments standalone python experiments/exp1_copy_task.py python experiments/exp2_drug_interaction.py
We are Lina Raoui , Mouhsine Elaoula , Aymane Amraoui and Soufiane Eloulji 4 junior data engineers from ENSIAS.
This project implements the architecture proposed in the 2014 Neural Turing Machines paper by Google DeepMind. By separating computational logic from a differentiable external memory, the NTM moves beyond simple recognition to "learn" programs. It effectively allows a model to develop its own algorithms to solve complex, structured tasks.
What is this? This is a collection of free e-books about Artificial Intelligence(Machine Learning, Planning) and Data Science etc. . keywords: ML, ebook, ebooks, books, book, machine learning, statistics, free Books Handbook of Bayesian Deep Learning https://zenodo.org/records/22086450 Probabilistic Machine Learning: An Introduction. 2022 https://probml.github.io/pml-book/book1.html Machine Learning Systems - Principles and Practices of Engineering Artificially Intelligent Systems https://mlsysbook.ai/book/ Pattern Recognition and Machine Learning Understanding Deep Learning 2023 Deep Learning - Foundations as Concepts 2023 - Chris Bishop Dive into Deep Learning good book has chapters about attention and transformers Mathematics for Machine Learning Deep Learning by Ian Goodfellow and Yoshua Bengio and Aaron Courville The Elements of Statistical Learning: Data Mining, Inference, and Prediction 2009 Machine learning with neural networks https://web.stanford.edu/~jurafsky/slp3/ -> Speech and Language Processing - An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition Neural Networks - A Systematic Introduction http://mmds.org/#ver21 -> Mining of Massive Datasets 2014 (The principles of deep learning theory)[ https://arxiv.org/abs/2106.10165 ] https://www.statlearning.com/ -> An Introduction to Statistical Learning with Applications in R 2014 Deep Learning 2015 Algebra, Topology, Differential Calculus, and Optimization Theory for Computer Science and Machine Learning license: non-commercial Introduction to machine learning 2024 License: CC-BY Advanced Applications for Artificial Neural Networks Think Bayes Bayesian Data Analysis Bayesian Methods for Hackers Bayesian Methods for Statistical Analysis Neural Network Design how to design neural networks Understanding Machine Learning: From Theory to Algorithms 2014 Neural Networks and Deep Learning Graph Representation Learning 2020 - William L. Hamilton [pdf] graph neural networks Reinforcement learning: an introduction reinforcement learning Essentials of Metaheuristics Artificial Neural Networks (springer link) Bayesian Modeling and Computation in Python License: CC-NC Handbook of Digital Face Manipulation and Detection computer vision Computer Vision: Algorithms and Applications, 2nd ed. Neural-Symbolic Cognitive Reasoning An Introduction to Datascience Machine Learning Information Theory, Inference, and Learning Algorithms A Programmer's Guide to Data Mining Machine Learning β The Complete Guide A collection of wikipeda articles as a book about Machine Learning Bayesian Reasoning and Machine Learning 2012 A Course in Machine Learning Information Theory, Inference and Learning Algorithms 2003 Modeling With Data Neural Networks - A Systematic Introduction Understanding Machine Learning: From Theory to Algorithms by Shai Shalev-Shwartz and Shai Ben-David Think Stats Natural Language Processing with Python A Brief Introduction to Neural Networks Machine Learning Yearning Search and Optimization by Metaheuristics 2016 Doing Bayesian Data Analysis: A Tutorial with R and BUGS bayesian data analysis Handbook of Nature-Inspired Optimization Algorithms: The State of the Art - Volume II: Solving Constrained Single Objective Real-Parameter Optimization Problems Nature-Inspired Optimizers - Theories, Literature Reviews and Applications Nature-Inspired Computing and Optimization Handbook of data compression Deep Learning in Natural Language Processing Soft Computing for Knowledge Discovery and Data Mining Introduction to Applied Linear Algebra Efficient Learning Machines Graphical Models, Exponential Families, and Variational Inference Computer Vision: Models, Learning, and Inference 2012 computer vision Artificial Intelligence 2e - foundations of computational agents https://www.marl-book.com/download/marl-book.pdf RL > multi Agent RL link RL Machine Learning Engineering Open Book License: CC-BY-SA-4.0 license Gaussian Processes for Machine Learning Gaussian processes Neuroevolution: Harnessing Creativity in AI Agent Design evolutionary algorithms free book The Handbook of Rationality rationality Active Inference: The Free Energy Principle in Mind, Brain, and Behavior Free Energy Principle Active inference https://direct.mit.edu/books/oa-monograph/5372/The-Cortex-and-the-Critical-PointUnderstanding-the Regression and Other Stories https://hefferon.net/linearalgebra/ https://en.m.wikibooks.org/wiki/Artificial_Neural_Networks License: CC-BY http://neuralnetworksanddeeplearning.com/index.html License: CC-NC https://atcold.github.io/NYU-DLSP20/ https://fairmlbook.org/ https://christophm.github.io/interpretable-ml-book/ interpretable ML https://www.inference.org.uk/itprnn/book.pdf https://opentechbook.com/book/gaussian-processes-for-machine-learning/ Gaussian Process (Bayesian) https://opentechbook.com/book/the-principles-of-deep-learning-theory/ https://alex.smola.org/drafts/thebook.pdf https://neuroevolutionbook.com/ https://causalai-book.net/ https://hutter1.net/ai/uaibook2.htm algorithmic information theory
This is a collection of free e-books about Artificial Intelligence(Machine Learning, Planning) and Data Science etc. .
Machine Learning Systems - Principles and Practices of Engineering Artificially Intelligent Systems
4. Neural Network Backbone, Layer Specifications & Loss Formulations
https://web.stanford.edu/~jurafsky/slp3/ -> Speech and Language Processing - An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition
https://www.statlearning.com/ -> An Introduction to Statistical Learning with Applications in R 2014
Algebra, Topology, Differential Calculus, and Optimization Theory for Computer Science and Machine Learning
Understanding Machine Learning: From Theory to Algorithms by Shai Shalev-Shwartz and Shai Ben-David
Handbook of Nature-Inspired Optimization Algorithms: The State of the Art - Volume II: Solving Constrained Single Objective Real-Parameter Optimization Problems
https://direct.mit.edu/books/oa-monograph/5372/The-Cortex-and-the-Critical-PointUnderstanding-the
TODO integrate https://dlabs.ai/blog/free-ebooks-on-artificial-intelligence-to-read/ TODO integrate https://towardsdatascience.com/list-of-free-must-read-machine-learning-books-89576749d2ff TODO integrate https://www.globalsqa.com/free-machine-learning-ebooks/
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/05/Bishop-PRML-sample.pdf free sample chapters
https://towardsdatascience.com/springer-has-released-65-machine-learning-and-data-books-for-free-961f8181f189 to integrate
5. Training Protocol, Convergence Behavior & Experimental Evaluation
Actua como un radiologista y revisa la seguintes radiografias para mi: [ paciente de 6 aΓ±os con crisis bronquiales repetitivas, con presencia de sibilancia desde hace 24h. Optimizalo para hacerlo lo mejor y haz las preguntas que consideres necesarias antes de proceder]
Act as a radiologist and review the following x-rays for me: [6-year-old patient with repetitive bronchial attacks, wheezing for 24 hours. Optimize it to do the best and ask any questions you feel necessary before proceeding]
Act as a radiologist and review the following x-rays for me: [6-year-old patient with repetitive bronchial attacks, wheezing for 24 hours. Optimize it to do the best and ask any questions you feel necessary before proceeding]
Act as a radiologist and review the following x-rays for me: [6-year-old patient with repetitive bronchial attacks, wheezing for 24 hours. Optimize it to do the best and ask any questions you feel necessary before proceeding]
Neural Turing Machine Neural Turing Machine is a neural network (LSTM Cell) coupled with an external memory with which the neural network interacts (read and write) using attention processes. NTMs can be used as a model-based technique for meta-learning. Requirements PyTorch Torchvision Numpy Tqdm Usage Run the train.py script for training the model with default settings. For options, python train.py -h Run the Predict.ipynb notebook for making predictions and visualizing the results. Alternatively, run this repository directly in colab Credits Neural Turing Machines https://arxiv.org/abs/1410.5401 Code is based on https://github.com/vlgiitr/ntm-pytorch https://www.niklasschmidinger.com/posts/2019-12-25-neural-turing-machines/ Implementing Neural Turing Machines https://arxiv.org/abs/1807.08518
Neural Turing Machine is a neural network (LSTM Cell) coupled with an external memory with which the neural network interacts (read and write) using attention processes. NTMs can be used as a model-based technique for meta-learning.
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .
Model Figures & Evaluation Curves (4 Images)
Deep Learning Execution Pipeline
(Preprocessing)
(Feature Extraction)
(Self-Attention)
(Loss Optimization)