Traditional RNNs process words sequentially step-by-step, making them slow and vulnerable to vanishing gradients over long distances. Transformers process all tokens simultaneously in parallel.
Each token is projected into three representations: Query (Q) (what am I looking for?), Key (K) (what do I contain?), and Value (V) (what content do I pass along if matched?).
Multiple attention heads operate in parallel. One head learns pronoun references ("it" ➔ "animal"), another tracks grammar, while others capture topical polysemy ("river bank" vs "financial bank").
Where no authored special score or self-score applies, this source gives raw score one point two minus point two five times token distance with minimum point one. At distances one and two the scores are point nine five and point seven. Bars share two hundred fifty pixels per raw score. These are deterministic educational heuristics, not learned query-key dot products or an actual trained model. The source applies softmax to scores divided by temperature. For fallback raw scores point nine five and point seven, relative weight ratio is exponential of point two five over temperature. It is about one point two eight four zero at temperature one and one point one zero five two at temperature two point five. Bars share two hundred pixels per ratio unit. Increasing temperature moves these routes closer to equal relative preference. A hypothetical dense attention matrix for four and eight tokens contains sixteen and sixty-four query-key pairs. Bars share six pixels per pair. The source displays one query distribution and illustrative SVG context links; it does not run a full neural layer. Every sentence/head pair, token choice, temperature endpoint and actual reset must preserve complete teaching flow, native resize, first publisher/footer links and actual public playback; independent video-scene approval remains separate.