Why Transformers Need Positional Encoding
"Dog bites man" and "man bites dog" contain exactly the same words. Swap two of them and the meaning flips. Left to itself, a Transformer can't tell these two sentences apart. Attention, the mechanism at the heart of the model, never looks at where a token sits.