GridPE: Unifying Positional Encoding in Transformers with a Grid Cell-Inspired Framework
Boyang Li, Yulin Wu, Nuoxian Huang, Wenjia Zhang

TL;DR
This paper introduces GridPE, a novel positional encoding inspired by grid cells and Fourier analysis, which improves transformer performance by effectively encoding spatial information in high-dimensional spaces.
Contribution
We propose a neuroscience-inspired positional encoding scheme, GridPE, that unifies spatial encoding in transformers and demonstrates improved performance in high-dimensional tasks.
Findings
GridPE enhances transformer accuracy on spatial tasks.
Theoretical analysis confirms translational invariance of GridPE.
Optimal grid scale ratios improve encoding efficiency.
Abstract
Understanding spatial location and relationships is a fundamental capability for modern artificial intelligence systems. Insights from human spatial cognition provide valuable guidance in this domain. Neuroscientific discoveries have highlighted the role of grid cells as a fundamental neural component for spatial representation, including distance computation, path integration, and scale discernment. In this paper, we introduce a novel positional encoding scheme inspired by Fourier analysis and the latest findings in computational neuroscience regarding grid cells. Assuming that grid cells encode spatial position through a summation of Fourier basis functions, we demonstrate the translational invariance of the grid representation during inner product calculations. Additionally, we derive an optimal grid scale ratio for multi-dimensional Euclidean spaces based on principles of biological…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDNA and Biological Computing · Algorithms and Data Compression · Modular Robots and Swarm Intelligence
MethodsAttention Is All You Need · Softmax · Layer Normalization · Linear Layer · Byte Pair Encoding · Label Smoothing · Adam · Residual Connection · Multi-Head Attention · Position-Wise Feed-Forward Layer
