Shuffle in, shuffle out
Attention is equivariant to every reordering of the tokens, not just shifts
P̂ reorders the same way
attn(shuffle(X)) = shuffle(attn(X))
Measured on the trained layer with the 7's tokens: largest difference 1.1 × 10⁻⁵, which is float rounding.
After the global average pool the order is gone entirely: the prediction is identical (invariant).
WHY
Look at sij = qi · kj. Nothing in it says where token j sits, only what it contains. The weights are shared by every token, so a token's place in the list never enters the computation.
Like the CNN, no weight has an address. Unlike the CNN, nothing knows who its neighbours are.
To this layer, the 7 and its scrambled tokens are the same input. Our stem is still local, so the inside of each token keeps its order; a ViT has nothing like that beyond the patch. Part 2 gives back the "where": positional embeddings.
Attention scores what a token is, never where it is.
© 2026 Dr. Jesse Roberts