Architectures · advanced · concept 102 of 311 · Updated Nov 4, 2026
Positional Encoding & RoPE
Attention treats its input as an unordered set, so word order has to be injected explicitly. Early transformers added sine-wave position signals; modern LLMs rotate query and key vectors by position (RoPE), which extends more gracefully to long contexts. Context-window tricks usually live here.
Top AI contributors on this
- Noam ShazeerOpenAI
- Christopher ManningStanford University / AIX Ventures
- Aidan GomezCohere
- Ashish VaswaniNvidia (via Essential AI)
- Albert GuCarnegie Mellon University / Cartesia
Key terms
Position embeddingsSinusoidal encodingRoPERelative positionContext extension
Learn these first
Where you meet it in the real world
Why a model knows 'dog bites man' from 'man bites dog', and how million-token contexts are stretched
Videos
▶ Stanford XCS224U: NLU I Contextual Word Representations, Part 3: Positional Encoding I Spring 2023 ↗
Stanford Online · YouTube
▶ RoPE: Understanding Rotary Positional Embeddings in transformers ↗
Hugging Face · YouTube
Guides and articles
Courses, papers, and more