liveBook · Manning

Value

As explained in Grokking AI Algorithms, Second Edition

A value vector is the vector representation carrying the content contributed by a token in an attention computation.

A value vector carries the meaning or substance that a token contributes to an attention computation. Query and Key help decide relevance; Value supplies the content that gets combined. section 11.18 section 11.21

Each token embedding is linearly projected into a Value vector. After attention weights measure influence, those weights scale the vectors, and their sum becomes a context-rich output. section 11.18 section 11.21

Blending token contributions

For token 0, the Value vector is [0.0150, 1.9940, 1.0050, 1.0040]. Its attention weight is 0.0632, producing [0.0009, 0.1261, 0.0635, 0.0635]. Repeating this for other tokens and adding the results gives token 0’s context vector: [0.2283, 2.1990, 0.4526, 1.9747].

Figure 11.34 An analogy of the purposes of Query, Key, and Value
11_34

Use the ingredient analogy to distinguish Value as the actual contribution from Query’s request and Key’s descriptive label. section 11.18

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains projection, weighting, elementwise scaling, and summation, stopping short of deeper training mechanics.
Examples
Works through token 0’s four-dimensional Value vector, weighted results, and final context vector.
What it assumes
Assumes token embeddings and attention weights, while explaining the Value role from the Q/K/V distinction.
What you can do after
Apply it via Python by projecting embeddings into V and multiplying V by attention weights.
How it connects
Connects Value vectors with Query, Key, attention weights, self-attention, and context vectors.

Also explained in

Compare how 8 books explain value →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.