Transformer Architecture · 2021
RoFormer: Rotary Position Embedding (RoPE)
Introduced rotary position embedding, which encodes position by rotating query and key vectors so their dot product depends only on relative distance, removing the need for additive position embeddings that generalize poorly to longer sequences.
Editorial record
Plain-language summary
RoPE multiplies each pair of embedding dimensions by a position-dependent rotation before computing attention, so a token's position is baked into the query/key geometry rather than added as a separate vector. Because two rotated vectors' dot product is a function of their offset, attention scores naturally become relative-position aware. This gives cleaner extrapolation to sequence lengths not seen in training and is now the default position scheme in most open large language models.
Knowledge graph
Relationships
Antecedents
ExtendsEvidence: Direct
Context Extension (Position Interpolation / NTK / YaRN)
YaRN rescales RoPE for context extension
P-423
Descendants
GeneralizesEvidence: Strongly supported
Self-Attention with Relative Position Representations / Transformer-XL
Rotary embedding continues the relative-position lineage
P-002 related work
Source record
Provenance
- Record ID
- P-002
- Record created
- 2026-07-13
- Last reviewed
- 2026-07-14
- Record version
- 2
- https://arxiv.org/abs/2104.09864
- arXiv:2104.09864
Citation caveat: Citation metadata is approximate and marked unverified in the source dataset.