Relating transformers to models and neural representations of the hippocampal formation
James C. R. Whittington, Joseph Warren, Timothy E. J. Behrens
TL;DR
The paper demonstrates that Transformers equipped with recurrent position encodings can replicate spatial representations observed in the hippocampal-entorhinal system, notably grid and place cells. It establishes a close mathematical relationship between Transformers and the Tolman-Eichenbaum Machine (TEM), mapping TEM memory retrieval to self-attention and interpreting path integration as learned position encodings. Introducing TEM-t, a Transformer analogue of TEM, the authors report improved sample efficiency and memory capacity along with emergent grid-like representations, supported by a biologically plausible account of place-cell remapping. The work bridges neuroscience and machine learning, offering insights into hippocampal indexing, the role of position encodings, and potential extensions to language and broader cognitive tasks. Overall, it presents a unified view where hippocampal computations can be viewed through the lens of transformer-like architectures, with implications for understanding cortical processing beyond the hippocampus.
Abstract
Many deep neural network architectures loosely based on brain networks have recently been shown to replicate neural firing patterns observed in the brain. One of the most exciting and promising novel architectures, the Transformer neural network, was developed without the brain in mind. In this work, we show that transformers, when equipped with recurrent position encodings, replicate the precisely tuned spatial representations of the hippocampal formation; most notably place and grid cells. Furthermore, we show that this result is no surprise since it is closely related to current hippocampal models from neuroscience. We additionally show the transformer version offers dramatic performance gains over the neuroscience version. This work continues to bind computations of artificial and brain networks, offers a novel understanding of the hippocampal-cortical interaction, and suggests how wider cortical areas may perform complex tasks beyond current neuroscience models such as language comprehension.
