podcasts / The attention family / episode / question
Question

How does masking attention scores with minus infinity before softmax work?

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 →

▸More from this episode

Q1Why does causal attention mask future tokens, according to Vizuara?Q2What does the causal attention mask look like in the attention weights matrix?Q3Why is zeroing attention weights after softmax the wrong way to do causal masking?Q5How is dropout applied to attention weights, and why scale by 1/(1-p)?Q6What are the full steps of causal self-attention in Vizuara's attention family series?
Transcribe your links. Paste a YouTube, Google Drive or podcast link and WhipScribe gives you the transcript. Transcribe a link →