Transformer Architecture · 2021

RoFormer: Rotary Position Embedding (RoPE)

Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, Yunfeng Liu

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

Descendants

Source record

Provenance

Record ID
P-002
Record created
2026-07-13
Last reviewed
2026-07-14
Record version
2

Citation caveat: Citation metadata is approximate and marked unverified in the source dataset.