[Paper Review] Learning Numeracy: Binary Arithmetic with Neural Turing Machines
This paper investigates Neural Turing Machines (NTMs) for learning binary addition and multiplication—two fundamental algorithmic tasks—demonstrating that NTMs can learn and generalize these operations better than standard LSTMs despite training challenges. The models use differentiable external memory to store intermediate results, with the LSTM-NTM showing clearer memory interaction patterns than the FF-NTM, though both generalize poorly beyond training length, highlighting limitations in interpretability and scalability.
One of the main problems encountered so far with recurrent neural networks is that they struggle to retain long-time information dependencies in their recurrent connections. Neural Turing Machines (NTMs) attempt to mitigate this issue by providing the neural network with an external portion of memory, in which information can be stored and manipulated later on. The whole mechanism is differentiable end-to-end, allowing the network to learn how to utilise this long-term memory via stochastic gradient descent. This allows NTMs to infer simple algorithms directly from data sequences. Nonetheless, the model can be hard to train due to a large number of parameters and interacting components and little related work is present. In this work we use NTMs to learn and generalise two arithmetical tasks: binary addition and multiplication. These tasks are two fundamental algorithmic examples in computer science, and are a lot more challenging than the previously explored ones, with which we aim to shed some light on the real capabilities on this neural model.
Motivation & Objective
- To evaluate the capability of Neural Turing Machines (NTMs) in learning complex algorithmic tasks like binary addition and multiplication.
- To assess whether NTMs can generalize beyond training sequence lengths, especially for structured arithmetic operations.
- To compare NTM performance against a strong LSTM baseline in terms of learning efficiency and generalization.
- To analyze memory interaction patterns in NTMs to understand how they store and retrieve intermediate computation states.
- To explore the limitations of current NTM architectures in learning interpretable, scalable algorithms.
Proposed method
- The NTM architecture uses a neural network controller with differentiable read and write operations over an external memory matrix of size N×M.
- The controller processes input sequences and memory states using attention-based addressing to select memory locations for reading and writing.
- Two NTM variants were trained: one with a feedforward controller (FF-NTM) and one with an LSTM controller (LSTM-NTM).
- Training used RMSProp with a learning rate of 10⁻⁴ and 1,000,000 examples with variable-length binary numbers up to 8 bits.
- Generalization was tested on sequences up to 48 bits (98 elements) with outputs up to 96 bits, including special tokens for start and end.
- Memory interaction patterns were visualized to analyze how the controller accesses and manipulates stored information during computation.
Experimental results
Research questions
- RQ1Can NTMs learn and generalize binary addition and multiplication beyond the training sequence length?
- RQ2How do different controller architectures (FF vs. LSTM) affect learning and memory utilization in NTMs for algorithmic tasks?
- RQ3To what extent do NTMs rely on external memory versus internal recurrent connections for computation?
- RQ4What patterns emerge in memory read/write operations during arithmetic computation, and how do they relate to algorithmic structure?
- RQ5How does the performance of NTMs compare to a strong LSTM baseline in terms of generalization and error growth over longer sequences?
Key findings
- The FF-NTM and LSTM-NTM both showed better generalization than the LSTM baseline on binary addition, with errors increasing linearly beyond training length.
- For binary multiplication, both NTM models maintained a relatively low and stable error increase over longer sequences, outperforming the LSTM baseline, which showed a sharp rise in error beyond double the training length.
- The FF-NTM exhibited a sparse, structured memory interaction pattern, suggesting it learned to store and retrieve intermediate results in a rule-based manner.
- The LSTM-NTM displayed a less coherent memory access pattern, with scattered reads across the memory matrix, indicating greater reliance on internal recurrent dynamics than on external memory.
- Despite lower parameter counts, the NTM models generalized better than the LSTM baseline, suggesting external memory improves algorithmic generalization.
- The study highlights the difficulty in interpreting learned algorithms in NTMs, as the internal logic remains opaque despite functional performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.