How it works
Token embeddings receive position information, then attention exchanges information across positions. Feed-forward layers and residual paths transform and preserve representations across blocks.
A concrete example
An encoder can attend across an input sequence; an autoregressive decoder uses a causal mask to prevent a position from reading future tokens.
Watch for this
Architectures differ in masking, normalization, position encoding, and training objectives. Do not assume every Transformer is identical.
Try it yourself
Select different queries in the attention demonstration, then step through the complete encoder diagram.