← all concepts

Attention

The transformer mechanism that lets a model weigh how much every token relates to every other, in parallel — the core of modern LLMs.

Listen

Attention is the engine that drives modern language models. Introduced in 2017, this mechanism powers the Transformer architecture, which is the foundation of today's artificial intelligence.

Before attention, models had to process text step-by-step, word by word. Attention changed everything by looking at an entire sequence of text all at once. It calculates how much each word relates to every other word in a sentence, no matter how far apart they are. This simultaneous processing makes training incredibly fast and highly parallel.

To make this process stable and expressive, researchers use a few key refinements. Scaled dot-product attention keeps the mathematical gradients stable during training, while multi-head attention allows the model to look at the text from several different perspectives at the same time.

The only real downside to attention is its cost. Because every word is compared to every other word, the computational power required grows quadratically with the length of the input. This high cost is why researchers are constantly developing new methods to make attention more efficient for longer texts. Ultimately, understanding attention is the key to understanding how machines actually read and make sense of our language.

Attention is the mechanism that lets a language model weigh how much each token relates to every other token when building meaning. Introduced in the 2017 paper "Attention Is All You Need," it powers the Transformer, the architecture behind essentially every modern large language model.

Its breakthrough was removing the need for step-by-step recurrence: attention relates all positions in a sequence simultaneously, which makes training highly parallel and lets the model connect distant words directly. Refinements like scaled dot-product attention (dividing by √dₖ to keep gradients stable) and multi-head attention (several attention "views" at once, each focusing on different relationships) make it both stable and expressive.

Attention's one weakness is cost — it scales quadratically with input length, which is exactly why methods like BlockRank restructure it for large-scale in-context ranking. Understanding attention is the key to understanding how models actually read.

Related concepts

Concept