Abstract
Following the recent trend in explicit neural memory structures, we present a new design of an external memory, wherein memories are stored in an Euclidean key space $\mathbb R^n$. An LSTM controller performs read and write via specialized read and write heads. It can move a head by either providing a new address in the key space (aka random access) or moving from its previous position via a Lie group action (aka Lie access). In this way, the "L" and "R" instructions of a traditional Turing Machine are generalized to arbitrary elements of a fixed Lie group action. For this reason, we name this new model the Lie Access Neural Turing Machine, or LANTM. We tested two different configurations of LANTM against an LSTM baseline in several basic experiments. We found the right configuration of LANTM to outperform the baseline in all of our experiments. In particular, we trained LANTM on addition of $k$-digit numbers for $2 \le k \le 16$, but it was able to generalize almost perfectly to $17 \le k \le 32$, all with the number of parameters 2 orders of magnitude below the LSTM baseline.
Introduction
Standard Recurrent Neural Networks (RNNs) and LSTMs often struggle with precise algorithmic reasoning and maintaining long-term state. While Neural Turing Machines (NTMs) addressed this by incorporating an external memory "tape," they typically rely on discrete shifts or content-based addressing that can be difficult to scale. The Lie Access Neural Turing Machine (LANTM) proposes a paradigm shift: memory addresses are treated as vectors in a continuous Euclidean space ($\mathbb{R}^n$), and head movement is defined by smooth, geometric transformations.
The LANTM Architecture
The LANTM consists of an LSTM controller that manages an external memory dictionary. In this dictionary, keys are vectors in $\mathbb{R}^n$ and values are memory vectors in $\mathbb{R}^m$. This geometric approach allows the model to navigate memory using continuous actions rather than being confined to discrete slots.
A critical component of the reading process is the InvNorm weighting scheme. Unlike the standard exponential SoftMax, which can be too "blurry" in continuous space, InvNorm uses an inverse-squared distance law. This provides a sharper local focus, allowing the model to pinpoint specific memory entries without interference from distant vectors.
Addressing via Lie Group Actions
The core innovation of the LANTM is its Addressing Procedure, which combines two distinct modes of access:
- Random Access: The controller generates a completely new address, similar to a pointer jump.
- Lie Access: The controller moves the previous address using a Lie group action.
By utilizing Lie group actions—differentiable group operations—the model can learn rules for movement (such as straight-line translations in a 2D plane) rather than just memorizing specific locations. This allows the model to "walk" through memory indefinitely, facilitating generalization to sequences far longer than those encountered during training.
Experimental Results
The LANTM was evaluated against LSTM baselines across algorithmic tasks, Python program execution, and language modeling.
Algorithmic Generalization
The model demonstrated extraordinary performance on the addition of $k$-digit numbers. Trained on lengths $2 \le k \le 16$, the LANTM-InvNorm configuration achieved 100% accuracy. Remarkably, it maintained 99% accuracy when generalized to 32-digit numbers, whereas the LSTM baseline's performance collapsed to 6%.
Parameter Efficiency
One of the most striking findings is the model's efficiency. By baking geometric logic into the architecture, the LANTM achieved superior results with two orders of magnitude fewer parameters. In several experiments, a LANTM with approximately 20k parameters outperformed an LSTM with 1.9 million parameters.
Conclusion
The Lie Access Neural Turing Machine demonstrates that geometric priors in memory access can lead to significantly better algorithmic generalization and parameter efficiency. While the model excels in structured logical tasks, future work may explore non-Euclidean spaces, such as hyperbolic manifolds, to better handle the diffuse memory access patterns observed in natural language processing.
Summary updated