Skip to main content

Positional Encoding

Positional Encoding

  • Core concepts
  • Stage 4 · Under the Hood
  • refs checked 2026-11-09
What problem it solves

Lets the model know the order of words in a sentence.

What it is
Attaching a set of numbers to each position so the model can tell "the cat chased the dog" from "the dog chased the cat".
Attention alone is order-agnostic; position encoding injects “which token” so the model can distinguish “cat chases dog” from “dog chases cat”.
Attention alone is order-agnostic; position encoding injects “which token” so the model can distinguish “cat chases dog” from “dog chases cat”.
Why it matters

It explains why comprehension of long passages degrades noticeably once you exceed the context window.

Sources
  • RoFormer: Rotary Position Embedding (paper) ↗
  • Attention Is All You Need (sinusoidal encoding, paper) ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →