The sentence "How are you doing ?" (5 tokens) run through real / / projections and a full 5×5 attention matrix.
The attention layer (W) computes 3 vectors from the input: a Query, a Key and a Value. Every token gets its own, through three learned matrices (, , ).
The following examples illustrate the underlying intuition. Actual attention weights are learned from data and may follow different patterns.
What information this token is looking for from other tokens
What this token offers for matching against other tokens’ Queries
The actual information this token contributes when another token attends to it
Dividing by √ keeps dot-product scores from growing large as the dimension increases. Large scores can stall learning.
The Self-Attention section ended with the attention output. Here that same mechanism, with real // projections and real softmax, becomes one block inside an encoder-decoder Transformer.
Here the model is a translator: the encoder reads the English sentence “How are you doing ?”, and the decoder generates its French translation, “Comment allez-vous ?”. Follow the sentence through the full pipeline.