HomeGlossaryAttention Mechanism
Models & Architecture

Attention Mechanism

A neural network technique that lets a model focus on the most relevant parts of an input when producing an output.

An attention mechanism helps a model decide which parts of the input matter most for the task at hand. Instead of treating every token equally, the model assigns different weights to different tokens, allowing it to focus on the most relevant information while generating the next output.

This idea became foundational in modern AI because it solved a major weakness of older sequence models: difficulty remembering long-range relationships. In a sentence like "The book on the table near the window was old," attention helps the model connect "book" with "was old" even though many words appear between them.

Why it matters: Attention is the core operation behind the transformer. It is the reason modern LLMs can handle long prompts, summarize documents, and reason over complex inputs.

What Attention Enables

  • Long-range understanding — connect distant words or concepts
  • Dynamic focus — emphasize the most relevant context per token
  • Parallel processing — analyze whole sequences at once
  • Cross-modal reasoning — align text with images, audio, or video

Attention mechanisms appear in language, vision, and multimodal models. Variants like self-attention and multi-head attention are now standard building blocks in state-of-the-art architectures.

Related Terms

← Back to Glossary