liveBook · Manning

Dot-product attention

As explained in Building Specialized AI Systems

Dot-product attention calculates relevance between queries and keys with dot products and combines values using the resulting weights.

Dot-product attention computes how strongly each token should relate to other positions. It projects token embeddings into queries (Q), keys (K), and values (V), scores queries against keys with dot products, scales by the key dimension, normalizes with softmax, and combines values into context-aware representations. section 3.1.1

Resolving a reference

In “The cat sat on the mat because it was tired,” self-attention can assign strong relevance between “it” and “the cat,” helping produce a context-aware representation that preserves the intended reference. section 3.1.1

How Building Specialized AI Systems covers it

How deep it goes
Defines projections, scaling, softmax, and value aggregation, then stops short of parameter-learning details.
Examples
Uses a cat-and-pronoun sentence and a three-stage visualization of scores, weights, and context-aware outputs.
What it assumes
Assumes token embeddings and basic matrix operations while introducing Q, K, V projections from those embeddings.
What you can do after
Evaluate/understand how attention scores become weighted contextual representations.
How it connects
Connects queries, keys, values, softmax, self-attention, multi-head attention, and Transformer architecture.

Also explained in

Compare how 3 books explain dot-product attention →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Specialized AI Systems. The section links point to the parts of the book it draws on.