RoPE (Rotary Position Embedding)
A positional encoding method where the position of a token is encoded by rotating its vector. Used in most modern LLM.
Why Positional Encoding
Transformer processes tokens in parallel and does not inherently know the order of words. Positional encoding adds information about where each token is located.
Why RoPE is Better
- encodes relative positions, not just absolute ones;
- generalizes well to lengths longer than training;
- is efficiently computed.
Where It Is Used
In LLaMA, Qwen, DeepSeek, and other modern models.