|国家预印本平台
首页|Rethinking RoPE: A Mathematical Blueprint for N-dimensional Positional Encoding

Rethinking RoPE: A Mathematical Blueprint for N-dimensional Positional Encoding

Rethinking RoPE: A Mathematical Blueprint for N-dimensional Positional Encoding

来源:Arxiv_logoArxiv
英文摘要

Rotary Position Embedding (RoPE) is widely adopted in Transformers due to its ability to encode relative positions with high efficiency and extrapolation capability. However, existing RoPE variants lack a unified theoretical foundation, especially in higher dimensions. In this paper, we propose a systematic mathematical framework for RoPE grounded in Lie group and Lie algebra theory. We identify two core properties of RoPE, named relativity and reversibility, and derive general constraints and constructions for valid RoPE in 1D, 2D, and N-dimensional (ND). We prove that RoPE must lie in the basis of a maximal abelian subalgebra (MASA) of the special orthogonal Lie algebra, and show that standard RoPE corresponds to the maximal toral subalgebra. Furthermore, we propose to model inter-dimensional interactions by learning an orthogonal basis transformation. Our framework unifies and explains existing RoPE designs, while enabling principled extensions to new modalities and tasks.

Haiping Liu、Hongpeng Zhou

数学

Haiping Liu,Hongpeng Zhou.Rethinking RoPE: A Mathematical Blueprint for N-dimensional Positional Encoding[EB/OL].(2025-04-07)[2025-05-10].https://arxiv.org/abs/2504.06308.点此复制

评论