Rotary position embedding
A way of encoding word order by rotating query and key vectors by an angle that depends on position.
Also: RoPE, rotary embedding
Rotary position embedding was introduced by Jianlin Su and colleagues in the 2021 RoFormer paper. Each query and key vector is rotated by an angle proportional to its position, so the dot product between two tokens depends on how far apart they are rather than where they sit. GPT-NeoX, PaLM, LLaMA, Qwen, DeepSeek and most open models use RoPE. Methods such as position interpolation and YaRN rescale the rotation angles so that a model trained on short texts can be extended to much longer ones.