Do traveling waves make good positional encodings?

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: van de Geijn, Chase, Paliwal, Ayush, Lüddecke, Timo, Ecker, Alexander S.
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866918202353647616
author van de Geijn, Chase
Paliwal, Ayush
Lüddecke, Timo
Ecker, Alexander S.
author_facet van de Geijn, Chase
Paliwal, Ayush
Lüddecke, Timo
Ecker, Alexander S.
contents Transformers rely on positional encoding to compensate for the inherent permutation invariance of self-attention. Traditional approaches use absolute sinusoidal embeddings or learned positional vectors, while more recent methods emphasize relative encodings to better capture translation equivariances. In this work, we propose RollPE, a novel positional encoding mechanism based on traveling waves, implemented by applying a circular roll operation to the query and key tensors in self-attention. This operation induces a relative shift in phase across positions, allowing the model to compute attention as a function of positional differences rather than absolute indices. We show this simple method significantly outperforms traditional absolute positional embeddings and is comparable to RoPE. We derive a continuous case of RollPE which implicitly imposes a topographic structure on the query and key space. We further derive a mathematical equivalence of RollPE to a particular configuration of RoPE. Viewing RollPE through the lens of traveling waves may allow us to simplify RoPE and relate it to processes of information flow in the brain.
format Preprint
id arxiv_https___arxiv_org_abs_2511_11668
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Do traveling waves make good positional encodings?
van de Geijn, Chase
Paliwal, Ayush
Lüddecke, Timo
Ecker, Alexander S.
Machine Learning
Artificial Intelligence
Transformers rely on positional encoding to compensate for the inherent permutation invariance of self-attention. Traditional approaches use absolute sinusoidal embeddings or learned positional vectors, while more recent methods emphasize relative encodings to better capture translation equivariances. In this work, we propose RollPE, a novel positional encoding mechanism based on traveling waves, implemented by applying a circular roll operation to the query and key tensors in self-attention. This operation induces a relative shift in phase across positions, allowing the model to compute attention as a function of positional differences rather than absolute indices. We show this simple method significantly outperforms traditional absolute positional embeddings and is comparable to RoPE. We derive a continuous case of RollPE which implicitly imposes a topographic structure on the query and key space. We further derive a mathematical equivalence of RollPE to a particular configuration of RoPE. Viewing RollPE through the lens of traveling waves may allow us to simplify RoPE and relate it to processes of information flow in the brain.
title Do traveling waves make good positional encodings?
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2511.11668