Intuition
Attention can compare tokens, but by itself it does not know which token came first. Positional information adds that ordering signal.
Technical definition
Positional encoding injects absolute or relative position information into token representations or attention computations.
Example
Sinusoidal encodings add position-dependent vectors to token embeddings before attention layers.
Common misunderstandings
- There are many positional encoding methods, not only the original sinusoidal approach.
- Position handling matters more as context length and sequence structure become important.