Attention in four steps

Here is the whole mechanism again.

1. Every token produces a query, a key, and a value.
2. One token's query is compared with the available keys.
3. Those match scores become weights.
4. The weights control how much of each value enters the new mix.

The mix becomes a new list of numbers for the token. Later layers can repeat the process using that richer context.

Attention gives relevant tokens a direct route into that mix. It does not force their information through every token between them.

Next comes another reason attention mattered: many of these comparisons can be calculated at the same time.