Zenaique
Glossary · Foundations

Attention Mechanism

Also known as: Self-attention, Scaled dot-product attention

How a model decides which input tokens to weight when computing each output token.

A neural network component that lets models dynamically focus on relevant parts of the input sequence. Scaled dot-product attention computes compatibility scores between queries and keys, then uses those scores to weight values.

In practice

Foundational to every transformer-based model. Interviewers probe this to test whether you understand WHY transformers replaced RNNs: not just the formula but the parallelism and long-range dependency wins.

How it compares

Attention is the mechanism; the transformer is the full architecture built around it.

Comparisons that include Attention Mechanism

Related topics

Practice questions

Related terms