Transformer Architecture
The transformer (Vaswani et al., 2017) replaced RNNs with attention. GPT-style models use a decoder-only stack: each token can only attend to previous tokens (causal masking). BERT uses encoder-only: bidirectional attention to understand text.