Self-Attention
What is Self-Attention?
In one sentence: Self-attention lets every word in a sentence look at every other word and decide which ones matter most for understanding it.
When the model reads "The dog chased the ball because it was bouncy," self-attention helps "it" pay strong attention to "ball." Each word gathers useful information from the others, so its meaning gets richer. This happens inside every layer of a Transformer.
What does Self-Attention look like?
In "bank of the river," self-attention links "bank" to "river," so the model knows it is not a money bank.
Why does Self-Attention matter?
Self-attention is the key idea that made Transformers, and today's LLMs, so powerful.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/self-attention/">Self-Attention, explained simply</a> (The AI Math Dictionary)