NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LieRE: Lie Rotational Positional Encodings

Sophie Ostmeier, Brian Axelrod, Michael E. Moseley, Akshay Chaudhari, Curtis P. Langlotz, Langlotz, Curtis · DOI

Abstract

Transformer architectures rely on position encodings to model the spatial structure of input data. Rotary Position Encoding (RoPE) is a widely used method in language models that encodes relative positions through fixed, block-diagonal, rotation matrices applied to key-query interactions. We hypothesize that this inductive bias limits RoPE's effectiveness for modalities with high-dimensional structure. Lie Relative Encodings (LieRE) introduce a principled generalization of RoPE, aimed at increasing the representational capacity of positional encodings in transformers. Instead of fixed 2D rotations, LieRE learns dense skew-symmetric matrices (Lie algebra elements), which are then differentiably mapped to form high-dimensional rotation matrices (Lie group elements). This results in richer, learnable, and continuous encodings of both relative and absolute positional information. We demonstrate the effectiveness of LieRE on 2D and 3D vision tasks, showing that it generalizes well to higher input resolutions while maintaining computational efficiency.

Introduction: The Challenge of Spatial Reasoning

Transformers are inherently "order-blind," treating input tokens as an unordered set unless augmented with positional information. While Rotary Position Encoding (RoPE) has become the standard for 1D sequences like text, its application to higher-dimensional data reveals significant limitations.

Standard 2D grid representation used in vision transformers.

RoPE relies on handcrafted, sparse 2D rotations that often fail to capture the complex, multi-axis spatial relationships inherent in 2D images or 3D videos. These "handcrafted" rotations become a bottleneck, as they are often too rigid to represent the intricate dependencies found in visual data. LieRE addresses this by providing a learnable, high-dimensional framework for positional encoding that scales naturally across dimensions.

Methodology: Lie Relative Encodings

LieRE generalizes the concept of rotary encodings by leveraging Lie group theory. Instead of fixed trigonometric rotations, the model learns dense, skew-symmetric matrices $A_i$ (elements of a Lie algebra). These are mapped to high-dimensional rotation matrices $R_i$ (elements of a Lie group) via the matrix exponential:

$$R_i = \exp\left(\sum_{k=1}^N p_{i,k} A_k\right)$$

where $p_{i,k}$ represents the coordinates of position $i$.

The LieRE framework: N-dimensional input coordinates are mapped through learned Lie algebra elements to rotation matrices, which are then integrated into the scaled dot-product attention mechanism.

These learned rotations are applied to the keys ($k_i$) and queries ($q_j$) within the attention mechanism. Unlike the rigid structure of RoPE, LieRE's rotations are dense and fully learnable, allowing the transformer to discover optimal spatial representations for specific tasks. This approach maintains the benefits of relative positional encoding while significantly increasing representational capacity.

Experimental Results

The authors evaluated LieRE across various benchmarks, demonstrating its superiority in spatial reasoning and resolution generalization.

Performance and Efficiency

On CIFAR-100, LieRE achieved 70.3% accuracy, significantly outperforming absolute encodings (63.9%) and RoPE-Mixed (68.8%). In 3D video classification (UCF101), LieRE showed a relative improvement of up to 15.1% over standard absolute embeddings. Notably, LieRE is highly efficient, adding only ~0.68% more parameters to a ViT-Base model and enabling a 3.9x reduction in training compute to reach target accuracy levels.

Spatial Reasoning and Resolution Invariance

A key finding involved a synthetic "Y" task, where models must identify the direction of an arrow. While models like GPT-4o struggle with such spatial tasks, LieRE maintains 100% accuracy even as input resolution increases. This highlights LieRE's ability to treat positions as continuous values, allowing it to generalize to unseen resolutions where absolute encodings typically fail.

Conclusion and Future Work

LieRE provides a principled, high-capacity alternative to traditional positional encodings for multi-dimensional data. While it introduces the numerical complexity of matrix exponentials, its performance gains and resolution robustness make it a compelling choice for vision and video transformers. Future research may explore efficient approximations of the matrix exponential and extensions to $SE(3)$ for robotics and 3D scene understanding.

Summary updated

BibTeX
@inproceedings{ostmeier2025liere,
  author = {Sophie Ostmeier and Brian Axelrod and Michael E. Moseley and Akshay Chaudhari and Curtis P. Langlotz and Langlotz, Curtis},
  title = {{LieRE: Lie Rotational Positional Encodings}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=yMJAYbGcCc},
}
Figure