Attention
Definition
The mechanism that lets a transformer weigh how much each token should draw on every other token when building its representation.
In more detail
Attention is what lets a model connect a pronoun to the noun it refers to many paragraphs earlier. Its cost grows with input length, which is one reason long context windows are expensive.
Each token produces a query, a key and a value. The query is compared with every earlier token's key to decide how much of each value to mix in. Because every token looks at every other, compute grows with the square of the input length, and the keys and values have to be kept in memory during generation, which is what the KV cache stores.
Related terms
Context window
The maximum number of tokens a model can consider in one request, covering both the input you send and the output it writes.
Transformer
The neural network architecture, built on attention, that underlies most current language models. Google researchers introduced it in 2017.
Interpretability
Research into how a model works inside: which internal patterns stand for which concepts, and how they combine to produce an output.
KV cache
Memory where a transformer stores attention keys and values for tokens it has already processed, so it does not recompute them each step.
Read more about Attention
- AI literacy
Knowing what current AI systems can and cannot do, and how to check their output.
- KV cache
Memory where a transformer stores attention keys and values for tokens it has already processed, so it does not recompute them each step.
- Transformer
The neural network architecture, built on attention, that underlies most current language models. Google researchers introduced it in 2017.