Where the Fourth English Word Looks

TransformersMedium+20 XP+20

Where the Fourth English Word Looks

A translation transformer is being trained on one pair of sentences.

stacksequencelength
encoderthe French input777 tokens
decoderthe English target101010 tokens

Training hands the decoder the whole English target at once. Each decoder block runs masked self-attention over the English tokens, then cross-attention into the encoder's outputs.

Now look at one position inside one decoder block: the row belonging to English token number 444, counting from 111.

Across that position's two attention sublayers combined, how many of its attention weights are non-zero?

Assume single-head attention in both sublayers, and take every unmasked weight to be non-zero — softmax never returns exactly zero for a finite score.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

Select all that apply.