Click any stage to reveal how hidden representations transform from raw input tokens to contextual vectors and logits.
RNNs and LSTMs were bottlenecked by step-by-step sequential time dependencies. Self-attention operations are pure matrix multiplications computable simultaneously across thousands of GPU tensor cores.
In a recurrent model, information from token 1 must pass through 100 intermediate hidden steps to reach token 100. In a transformer, any token connects directly to any other token in a single attention layer.
Different attention heads learn distinct linguistic patterns: some specialize in pronoun resolution ("it" → "animal"), others in syntax (subject → verb), punctuation, or factual associative recall.