Manuscript Offprint

arXiv:2608.29715

Higher-Dimensional Rotary Position Embedding

Yixing Li, Ruobing Xie, Yudong Zhang, Yushi Bai, Samm Sun, Yu Cheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Transformers rely on position embedding mechanisms in long context modeling in most cases. Rotary Position Embedding (RoPE) embeds positional information with independent 2D rotations, forming relative position terms in self-attention. However, its pairwise, block-based, and decoupled structure limits deep mixing and robustness across channels. We propose HD-RoPE, which extends RoPE from independent 2D rotations to higher-dimensional rotations and introduces a Paley-I orthogonal basis to obtain balanced, isotropic, and dense phase mixing within each rotation subspace. This significantly enhances channel coupling and rotational degrees of freedom while maintaining orthogonal stability and the relative position closure property. Furthermore, HD-RoPE is easily optimized for engineering efficiency without introducing additional trainable parameters. We have conducted extensive evaluation results demonstrating that HD-RoPE achieves significant performance improvements over standard RoPE across various popular benchmarks and in both long and short contexts.

1 Introduction

Transformer architecture has established itself as the dominant backbone for large language models (LLMs) across a wide range of domains. They heavily rely on efficient positional encoding mechanisms in long sequence modeling. Rotary Position Embedding (RoPE; Su et al., 2024), because it encodes absolute position as rotation and explicitly forms relative position signals in self-attention, has become one of the default choices for current mainstream language models.

When models need to extrapolate from the pre-training context length to longer contexts, RoPE exhibits typical degradation. Hence, a large body

Figure

Figure 1: The illustration of our HD-RoPE. Q denotes the selected orthogonal matrix in Section 3, enabling more isotropic, balanced, and dense phase interaction.

of effort on RoPE has focused on modifying the frequency schedule or angular velocity, such as rescaling the RoPE base, interpolating positions, or selectively weakening positional bias (Chen et al., 2023; Peng et al., 2023; Ding et al., 2024; Yang et al., 2025). These methods improve how phases evolve across positions.

However, a more fundamental assumption of RoPE that position is injected only through sev-

  • Corresponding author.

† Work conducted during internship at Tencent.

eral mutually independent two-dimensional rotations has largely remained untouched. RoPE can be roughly understood as: projecting the representation vector of each token onto several two-dimensional planes, and rotating it within each plane by a position-dependent angle (phase). The physical meaning of two-dimensional rotation is very intuitive and sound, while it also indicates that standard RoPE binds each positional frequency to an isolated two-dimensional channel pair. In this case, each relative phase can interact with only two fixed-dimension Q/K features, making the phase-sensitive attention term sparse and pairwise.

Based on the above intuition, this paper proposes HD-RoPE, a method for injecting positional information that generalizes the two-dimensional RoPE system to an higher NN-dimensional rotation space. HD-RoPE groups channels into sets of NN, applying rotations within NN-dimensional subspaces. This changes the rotation unit of RoPE from an isolated 2D pair to a higher-dimensional phase subspace, allowing the same positional phase to be shared and mixed across more Q/K channels. Within these subspaces, we instantiate the mixing basis using Paley-I conference matrices (Paley, 1933) to obtain a more isotropic, balanced, and dense phase interaction, enabling positional phases to couple more sufficiently with Q/K channels under the basic invariants of RoPE, which is effective, efficient and parameter-free.

This significantly enhances channel mixing and rotational degrees of freedom while maintaining the stability and norm preservation of orthogonal transformations, further enhancing the relative position encoding capability of RoPE. The main contributions of HD-RoPE include:

  1. We propose a higher-dimensional rotational perspective, providing a general framework for high-dimensional scaling, wherein 4D represents the sweet spot for balancing performance and efficiency.

  2. We adopt the conference matrix as a fixed and structurally simple orthogonal mixing transformation (balanced, low-coherence, and parameter-free) to enhance better cross-channel coupling without introducing additional trainable parameters.

  3. We conducted extensive experiments and found that HD-RoPE significantly outperforms the original RoPE in various tasks with various settings, while maintaining almost no additional computational overhead.

References (19)