Attention Mask
What is Attention Mask?
In one sentence: An attention mask is a pattern that tells the model which positions it may or may not attend to.
What does Attention Mask look like?
If a sentence is padded with empty tokens to fit a batch, the attention mask makes sure the model ignores them.
Why does Attention Mask matter?
Attention masks keep models from seeing things they should not see.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/attention-mask/">Attention Mask, explained simply</a> (The AI Math Dictionary)