Positional Encoding via Token-Aware Phase Attention

Yu Wang, Sheng Shen, Rémi Munos, Hongyuan Zhan, Yuandong Tian
9/16/2025
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

We prove under practical assumptions that Rotary Positional Embedding (RoPE) introduces an intrinsic distance-dependent bias in attention scores that limits RoPE's ability to model long-context. RoPE extension methods may alleviate this issue, but they typically require post-hoc adjustments after pretraining, such as rescaling or hyperparameters retuning. This paper introduces Token-Aware Phase Attention (TAPA), a new positional encoding method that incorporates a learnable phase function into the attention mechanism. TAPA preserves token interactions over long range, extends to longer contexts with direct and light fine-tuning, extrapolates to unseen lengths, and attains significantly lower perplexity on long-context than RoPE families.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{wang2025positional,
  title  = {Positional Encoding via Token-Aware Phase Attention},
  author = {Yu Wang and Sheng Shen and Rémi Munos and Hongyuan Zhan and Yuandong Tian},
  year   = {2025},
  eprint = {2509.12635},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.12635v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.12635.svg)](https://codeofpaper.com/paper/2509.12635)

Discussion