One prompt can now drive more of your workMore support for defending infrastructure and open sourceSee Claude’s rules updated for newer risksGPT-6 Intelligent UI makes conversations visual and interactiveClaude Haiku 5.5 delivers low-cost, high-performance AICreate visual, interactive answers from a simple chatRun high-volume tasks with a cheaper fast modelShare new mathematical results on GitHub to accelerate researchEasier access to advanced Claude models for security workRun image, audio, and video search on-device with one modelAtlassian integration makes company knowledge easier to useDecisions beta speeds up typed answers from text and imagesAnthropic expands safer access to advanced cyber featuresEnable text watermarking via API for EU complianceClaude training becomes easier for enterprise teamsAnthropic invests in workforce training for enterprise adoptionEnterprise adoption and training get easierGoogle's Gemini 4 Argon makes heavy tasks easier to offloadGemini 4 Argon is built for long professional tasksUse Astra-level performance affordably in daily workOne prompt can now drive more of your workMore support for defending infrastructure and open sourceSee Claude’s rules updated for newer risksGPT-6 Intelligent UI makes conversations visual and interactiveClaude Haiku 5.5 delivers low-cost, high-performance AICreate visual, interactive answers from a simple chatRun high-volume tasks with a cheaper fast modelShare new mathematical results on GitHub to accelerate researchEasier access to advanced Claude models for security workRun image, audio, and video search on-device with one modelAtlassian integration makes company knowledge easier to useDecisions beta speeds up typed answers from text and imagesAnthropic expands safer access to advanced cyber featuresEnable text watermarking via API for EU complianceClaude training becomes easier for enterprise teamsAnthropic invests in workforce training for enterprise adoptionEnterprise adoption and training get easierGoogle's Gemini 4 Argon makes heavy tasks easier to offloadGemini 4 Argon is built for long professional tasksUse Astra-level performance affordably in daily work
Official sources only. Rumors, leaks, and get-rich schemes are excluded.
← Back to glossary
GlossaryAI term

Attention Mechanism

注意機構

Definition

An attention mechanism is a method that assigns weights to parts of the input to focus on what matters and incorporate the needed information into the output. Understanding it makes model behavior easier to reason about.

When reading lengthy meeting minutes, it's natural to focus your attention on the key points rather than reading every statement equally. LLMs work the same way, learning where to focus within input text. The attention mechanism is a system that assigns importance weights to each part of the input, enabling focused processing on the most relevant information.

How Self-Attention Works

The most important type of attention mechanism is self-attention. Each token in the input sentence computes a relevance score with every other token in the same sentence. Technically, three vectors -- Query, Key, and Value -- are generated from each token, the dot product of Query and Key produces the relevance score, and those weights are used to compute a weighted average of Values. This calculation yields context-dependent semantic representations.

Why It Captures Long-Range Dependencies

In traditional RNNs, capturing relationships between distant words required information to propagate through many steps. The attention mechanism directly computes relevance between all token pairs regardless of distance, so relationships between the beginning and end of a sentence are captured in a single step. In a sentence like "I finally started reading the book I bought yesterday," the ability to accurately grasp the relationship between "book" and "started reading" is thanks to this mechanism.

Multi-Head Attention

In actual Transformers, rather than using a single attention mechanism, multiple "heads" run in parallel. This is called multi-head attention. Each head learns to capture different types of relationships. One head might focus on grammatical relationships (subject and predicate), while another focuses on semantic connections (synonyms, antonyms). By integrating information from multiple perspectives, richer contextual understanding becomes possible.

Applications and Computational Cost

Attention mechanisms are used not only in LLMs but across a wide range of fields including image recognition and speech processing. However, because computation is required between all token pairs, there is a challenge of computational cost that scales quadratically with input length. To mitigate this issue, active research is underway on efficiency improvements such as Flash Attention and Sparse Attention.

h
hayami

Stay on top of OpenAI, Google & Anthropic updates. An AI digest for business professionals.

Source Policy

We use only official sources. Each article links to the original announcement so you can verify it yourself.

© 2026 hayami. All rights reserved.