Encodes token positions by rotating query/key vectors. Relative distances fall out of the math for free.
Introduced inApr 2021RoFormer: Enhanced Transformer with Rotary Position Embedding
RoPE rotates each query and key vector by an angle proportional to its position, so the dot product between two tokens depends only on their relative distance. It needs no learned position table, extrapolates better than absolute embeddings, and is the de-facto standard in modern LLMs. Long-context variants rescale the rotation frequencies (see YaRN) to stretch the same mechanism to million-token windows.
Share of new models that have included RoPE over time.
Open any of these on hfviewer to find this block in the interactive architecture graph.
Browse all 1654 models with this in the catalog →
hfviewer renders the full architecture of 3,500+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.
Browse all model graphs →