Skip to main content

Attention

Attention

  • Core concepts
  • Stage 4 · Under the Hood
  • refs checked 2026-11-09
What problem it solves

When processing one word, the model automatically looks at the most relevant other words in the sentence.

What it is
Computing how related each word is to every other word, and aggregating information weighted by that. "Attention" inside a Transformer and "the model isn't paying attention" in everyday speech are the same word meaning different things.
How a query weights candidates: Q–K scores, softmax normalisation, then a weighted sum over V.
How a query weights candidates: Q–K scores, softmax normalisation, then a weighted sum over V.
Why it matters

It explains why models can resolve references across a long sentence — and is one technical root of the context length limit.

Sources
  • Attention Is All You Need (paper) ↗
  • Bahdanau Attention (Neural Machine Translation) ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →