Search

Try a topic

Notebook

Sinusoidal vs Learned vs Rotary

Code note Deep learning

SinusoidalLearnedRoPE
TypeFixedParameterFixed
Applied atInput embeddingInput embeddingQ and K inside attention
Extrapolates past max_lenYesNoYes
Encodes relative positionWeaklyNoExplicitly

Why it matters: LLaMA, Qwen, Mistral all use RoPE because ⟨RoPE(q, m), RoPE(k, n)⟩ depends only on m−n — relative position becomes a first-class operation, not a learned approximation.