Attention reads every token at once — which means, on its own, it can't tell word order apart. "Dog bites man" and "man bites dog" would look identical. Here's the small trick that puts order back: stamp each token with where it sits.
Word order isn't decoration — in English it decides who did what to whom. Rearrange the exact same three words and the meaning flips or falls apart.
dog bites man and man bites dog share every word, yet mean opposite things.Attention is the mechanism that lets every token look at every other token at once. That power has a blind spot: with nothing marking position, it sees an unordered set — a bag of tokens.
The fix is small and literal. Each token is already a vector (that's the embedding lesson). Before attention runs, we add a second vector that depends only on the slot — so where a token sits becomes part of what it is.
dog in slot 0 and dog in slot 3 are now different vectors.Every token now carries what it means and where it sits. But a real prompt needs more than words — it needs markers for where a turn starts, where the system message ends, where to stop. Next, special tokens: the reserved symbols that give a sequence its structure.