Home Knowledge Base Rotary Position Embedding (RoPE)

Rotary Position Embedding (RoPE) is a positional encoding method that encodes token position as rotation angles in complex plane, applying multiplicative rotation to query/key vectors — achieving superior extrapolation beyond training sequence length compared to absolute positional embeddings.

Mathematical Foundation:

Practical Advantages Over Absolute Embeddings:

Implementation in Transformers:

Extension Mechanisms:

Rotary Position Embedding is the state-of-the-art positional encoding — enabling transformers to achieve superior length extrapolation and efficient long-context inference across Llama, Qwen, and PaLM models.

rotary position embeddingRoPEangle embeddingstransformer positional encodingrelative position

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.