Transformers and LLMs

Attention, explained

Attention is a neural network mechanism that lets a model decide which parts of an input are most relevant when producing a representation or output.
Back to Glossary

Part of the Semantic Notion technical glossary.

Short Definition

Attention is a neural network mechanism that lets a model decide which parts of an input are most relevant when producing a representation or output.

Intuition

Instead of compressing everything into one fixed summary, attention lets the model look back at useful pieces of context when it needs them.

Technical Definition

Attention computes weights over values, usually from query-key similarity scores, then forms a weighted combination of those values.

Example

In translation, attention can connect a generated word to the source words that explain it.

Common Misunderstandings

Attention weights are not always faithful explanations.
Attention is a mechanism, not a complete model architecture by itself.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.