An attention score is a number that tells an attention mechanism how relevant each token is to another token. During contextualization, the scores divide attention across the context so the model can resolve meaning. section 1.20
Disambiguating “bark”
In “dog’s bark,” the model gives the most attention to “dog,” then “bark,” and finally “’s.” Information from “dog” therefore influences the embedding for “bark,” making its meaning more specific. section 1.20
The scores come from mathematical operations such as projections that compare embedding vectors. Their detailed calculation is deferred, while learned projection matrices supply many of the numerical settings. Afterward, the scores guide updates to the token embeddings. section 1.20 section 1.24
Figure 1.10 The attention mechanism calculates the relative relevance of all tokens in the context window to contextualize or disambiguate the last token.
A figure showing how the mechanism compares tokens and assigns their relative relevance while contextualizing the final token. section 1.20



