Multi-dimensional Rotary Embeddings for Spatiotemporal Transformers

This direction is split into other directions: spatio-temporal positional encoding. Its last version stays readable and citable here.

Version 1 of 1161 papers178 conceptsfrozen 2026-10-04

Transformers were originally designed for sequences—one-dimensional strings of text where the only relationship between tokens is their relative distance in a line. However, the physical world is not a line. Video, robotics, and multi-view imaging exist in a spatiotemporal volume defined by height, width, and time.

To bridge this gap, a new generation of models is moving away from flattening visual data into 1D sequences. Instead, researchers are extending the Rotary Position Embedding (RoPE)—a technique that encodes position as a rotation in a complex plane—into three and four dimensions. This allows models to "see" the geometric and chronological structure of the world natively.

The Geometry of Rotation

In a standard 1D Transformer, RoPE works by rotating the query and key vectors by an angle proportional to their position in the sequence. When the model calculates attention, the dot product between two vectors depends on the difference between their angles, effectively capturing their relative distance.

To handle video, models like CogVideoX by Zhuoyi Yang and colleagues decompose the embedding space into distinct components for height ($h$), width ($w$), and time ($t$). Instead of a single rotation, the model applies three independent rotations. As Zikang Liu explains in the VRoPE framework, this spatiotemporal decomposition ensures that the attention mechanism can distinguish between a pixel moving across the screen and a pixel staying still as time passes.

Preserving Structural Integrity

Why not just use traditional absolute 3D embeddings? The problem is flexibility. Absolute embeddings often fail when the input resolution or video length changes because the model hasn't "learned" those specific coordinates.

Multi-dimensional RoPE (often called M-RoPE) solves this by focusing on relative relationships. In Qwen2-VL, Chang Zhou and his team use this to achieve "Naive Dynamic Resolution." Because the positional information is encoded as relative rotations, the model can process images of any aspect ratio or videos of any length without the distortion that comes from resizing or cropping. The model understands that a patch at $(x, y, t)$ is adjacent to $(x+1, y, t)$ regardless of the total size of the video volume.

From 3D to 4D Awareness

As the field moves toward embodied AI and complex video editing, three dimensions are sometimes not enough. Researchers are now introducing 4D Rotary Embeddings to handle additional layers of context:

  1. Multi-View Consistency: In CogDriving, Hannan Lu uses a fourth dimension to represent camera view indices (left, front, right). This allows the model to maintain geometric consistency across different perspectives in a driving scene.
  2. Robotic Manipulation: Hanyu Zhou and the VLA-4D team integrate 3D spatial coordinates with 1D temporal indices to help robots plan movements. By encoding time as a fourth axis, the model can predict not just where a hand should move, but the precise duration and velocity of the action.
  3. Identity and Context: Models like EditVerse and RealisDance-DiT use shifted or additional coordinate dimensions to separate "reference" images from the generated video. This prevents the model from confusing the source identity (the person being animated) with the temporal sequence (the dance they are performing).

Why It Works: The Inductive Bias of Locality

The success of these multi-dimensional embeddings stems from a core intuition: visual features are most relevant to their immediate neighbors in space and time. By factorizing the rotary embeddings, models like Movie Gen (Adam Polyak et al.) can maintain coherence across deep transformer layers.

Without this explicit coordinate system, a deep network might "forget" the spatial layout of a scene, leading to common video artifacts like objects morphing or disappearing. By injecting these rotations into every layer, the architecture maintains a persistent "mental map" of the spatiotemporal volume, ensuring that a pixel at the top-left of frame one is correctly related to its trajectory in frame one hundred.

Papers in this version

Showing 60 of 161 papers.

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_multi_dimensional_rotary_embeddings_for__001b5862,
  title = {Multi-dimensional Rotary Embeddings for Spatiotemporal Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/multi-dimensional-rotary-embeddings-for-spatiotemporal-transformers/rdr_001b586283974c348fcf622b9b69c45a},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_multi_dimensional_rotary_embeddings_for__001b5862_v1,
  title = {Multi-dimensional Rotary Embeddings for Spatiotemporal Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/multi-dimensional-rotary-embeddings-for-spatiotemporal-transformers/rdr_001b586283974c348fcf622b9b69c45a/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}