The embedding lookup from the previous chapter maps each token ID to a vector, but that lookup has no notion of order: the same token produces the same vector whether it appears first or fiftieth. Self-attention inherits this blindness because it computes a weighted sum over positions, and a weighted sum does not care about the order of its terms. Positional encoding solves this by producing a vector for each position index, and that vector is added element-wise to the token embedding before the first block. The result is a single input vector per position that carries both what the token is and where it sits.
Once position is encoded, the same block can be applied repeatedly. Each block takes a sequence of vectors and returns a sequence of vectors of the same shape, so the output of one block is a valid input to the next. Stacking increases capacity because each block refines the representation the previous block produced: early blocks tend to capture local patterns, later blocks can combine those into longer-range structure. The blocks are not identical in their learned weights; they share an architecture but each has its own parameters. Residual connections and layer normalization, established in the previous chapter, are what keep the signal stable across depth so that many blocks can be trained without the activations exploding or vanishing.