Transformers process all tokens simultaneously. Each token generates a Query (Q) to search what it needs, matches against other tokens' Keys (K) to compute attention scores, and computes a weighted sum of Values (V) to update its contextual meaning.
Unlike RNNs that process word-by-word sequentially, Transformers ingest the entire sequence at once. Positional encodings are added so the network knows word order.
Dotting Q and K measures compatibility between words regardless of distance. Softmax transforms these raw dot products into normalized probability percentages.
The final representation blends meaning from all related tokens. Multi-Head Attention repeats this across dozens of subspaces (grammar, coreference, semantics).