The core calculation in a Transformer that lets every word in a sentence look at every other word to decide which ones matter most for its meaning.
Technically: Attention computes a weighted sum of value vectors by scoring each query against all keys via scaled dot-product (QK^T / sqrt(d_k)), then normalizing with softmax. Its O(n²) cost over sequence length is the dominant expense. It replaces recurrence with direct pairwise token interaction, giving the Transformer its ability to capture long-range dependencies within a single layer — the insight behind modern large language models.
Category: Attention Mechanisms