liveBook · Manning

Attention score

An attention score is a numerical compatibility or relevance value computed between elements, such as a query and key, before normalization into attention weights.

How 4 Manning books explain it

Graph Neural Networks in Action

An unnormalized learned score quantifying the importance of one connected node's features to another node.

How it is used
Weights neighbor contributions during GAT message passing for tasks such as node classification and link prediction.
How deep it goes
Defines learned pairwise scores, softmax normalization, and feature aggregation without presenting a rigorous mathematical derivation.
Examples
Uses connected-node feature vectors, fraud-detection edges, GAT equations, and PyTorch Geometric GATConv implementations.
What you can do after
Apply it via PyTorch Geometric to understand or implement attention-weighted graph aggregation.

Read how Graph Neural Networks in Action explains attention score →

Deep Learning with R, Third Edition

An attention score is a numerical value measuring the relevance of one vector or sequence position to another in an attention calculation.

How it is used
Uses relevance scores to selectively retrieve source-sequence information while predicting target tokens in sequence-to-sequence models.
How deep it goes
Explains dot products, softmax normalization, weighted sums, batched score matrices, and their role in attention computation.
Examples
Uses translation vectors, a normalized weighted-sum pseudocode example, and an R tensor implementation with sequence score matrices.
What you can do after
Build dot-product attention that normalizes source relevance and combines source vectors into context representations.

Read how Deep Learning with R, Third Edition explains attention score →

Build a Text-to-Image Generator (from Scratch)

An attention score is a numerical measure of the relevance between a query and a key.

How it is used
Measures query-key relevance inside scaled dot-product attention before normalization.
How deep it goes
Derives scores from dot products, scaling, softmax, and value aggregation, but defers detailed multi-head class internals.
Examples
Uses book recommendation vectors, “Wie geht es dir,” and vision-transformer attention heads as concrete examples.
What you can do after
Apply attention scores by implementing an AttentionHead in PyTorch with scaled dot products and softmax.

Read how Build a Text-to-Image Generator (from Scratch) explains attention score →

The AI Pocket Book

A numerical value used by an attention mechanism to weight the relevance of one element relative to others.

How it is used
Disambiguates tokens by weighting the relevance of surrounding context during contextualization.
How deep it goes
Explains token weighting, projections, learned matrices, and embedding updates but defers the detailed mathematical operations.
Examples
Uses “dog’s bark” to show how relative token relevance resolves meaning.
What you can do after
Evaluate how token relevance guides contextualized embeddings in a language model.

Read how The AI Pocket Book explains attention score →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.