Answered from Causal attention (masked self attention) | The attention family series - Lecture 7 · The attention family · 2026-09-24
Vizuara's approach sets every upper-triangle attention score to minus infinity and only then applies softmax along each row. Since e to the minus infinity is 0, the masked positions get weight 0 and also add nothing to the softmax denominator, so future keys never influence the current weights. In Sreedath Panat's example, a row of scores 2, 3 and 5 for a first-position query becomes 2, minus infinity, minus infinity, and softmax returns 1, 0 and 0.
Source: our own transcription of the episode. The full conversation is on The attention family (2026-09-24). Read the whole episode summary →