Skip to main content

Review — Contextualized representations

Back to the lesson · Learning path plan

What to remember

  • Embedding lookup yields a vector for each vocabulary ID. A Transformer layer then maintains a hidden state for each sequence position.
  • Attention mixes information from accessible positions. In a causal GPT, the current position can use its prefix and its own input.
  • The output head uses the final state at a position to score the vocabulary for the next token.

Recall from memory

Can two occurrences of “bank” have the same initial embedding and different final states?

Show the answer

Yes. If they have the same ID, their lookup is identical. Different prefixes can lead the layers to produce different final states.

A second question to check causality

With parameters and position fixed, can changing a token after the studied position change its hidden state in a causal GPT?

Show the answer

No. The causal mask prevents that position from accessing the future. A change to the accessible prefix can change its state.

Predict which changes can affect the current state. Revisit the exercise’s final scoring-and-loss question after the corresponding lessons.

Language · Français · English