Skip to main content

Review — Positional information

Back to the lesson · Learning path plan

What to remember

  • Two occurrences of the same token can start with the same embedding. Their ranks in the sequence provide information distinct from token identity.
  • An additive absolute encoding can combine the token embedding with a vector for its position at the input.
  • RoPE uses position to rotate Q and K after projection; their dot product involves the relative offset.
  • T5- and ALiBi-style relative biases add a distance-dependent term to scores before softmax: learned buckets for T5, fixed head-specific linear slopes for ALiBi.

Recall from memory

Do not retokenize the text: reorder an already-tokenized ID sequence by swapping two positions. Do the swapped IDs select new rows in the embedding table? In what order do the vectors then appear?

Show the answer

No. Each ID still selects the same row: neither the vocabulary nor the table changes. The order of vectors in the sequence follows the reordered IDs, however; their positions change, so positional processing can alter the representations entering the network.

A second question to check the distinction

Does the causal mask tell the model the absolute position of each token?

Show the answer

No. It determines which positions may be accessed, without supplying an explicit absolute coordinate or relative distance. In a NoPE architecture, nested visible prefixes can nevertheless provide an implicit ordering signal. This structural signal must not be confused with an explicit positional encoding.

Visual card — Same token, two positions

Tokenization assigned the same ID to both occurrences of chat. With additive absolute position encoding, which slots match across the two positions, and which may contain different vectors?

Show the card answer

A and C are the same embedding. The ID selects the same table row at both positions. B and D are the vectors for positions 0 and 3. They can differ even though the token is the same.

Recover the two input vectors from the same embedding and two position vectors.

Language · Français · English