liveBook · Manning

Contextualized representation

A contextualized representation is a numerical encoding of an item whose content depends on its surrounding sequence or other context.

How 2 Manning books explain it

Transformers in Action

A contextual embedding is a vector representation whose value reflects the surrounding context of the represented text element.

How it is used
Supports context-sensitive token meaning and similarity-based classification, semantic search, and retrieval.
How deep it goes
Defines the contrast with static vectors and explains bidirectional pretraining, but stops short of deriving layer-level vector computations.
Examples
Uses contrasting meanings of “bank” and code that encodes sentences, queries, and documents for similarity comparison.
What you can do after
Apply it via SentenceTransformer to encode text and compare query–document vectors with cosine similarity.

Read how Transformers in Action explains contextualized representation →

The AI Pocket Book

Token representations that encode surrounding context before being used to produce output predictions.

How it is used
Uses contextualized representations as the intermediate input for next-token prediction.
How deep it goes
Explains attention, feed-forward updates, multilayer refinement, and multiheaded attention without deriving the computations.
Examples
Uses “bark,” “’s,” attention relevance, and vocabulary-wide token probabilities as concrete examples.
What you can do after
Evaluate how an LLM turns context-sensitive token representations into next-token probabilities.

Read how The AI Pocket Book explains contextualized representation →

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.