In deep learning, an attention mechanism lets a model weigh the relative importance of different parts of its input when processing any given piece of it, rather than treating every word or feature equally. As the model works through a sequence, it assigns higher "attention" to the words most relevant to understanding the current one, closely mirroring how a person naturally focuses more on some words in a sentence than others.
Attention was formalized in the influential 2017 paper "Attention Is All You Need," which introduced the transformer architecture built entirely around this mechanism, discarding the sequential processing that earlier recurrent networks relied on. That shift let models process entire sequences in parallel rather than word by word, and it's the single architectural idea most responsible for the leap in capability behind every major large language model built since.
