Attention mechanism

Attention lets a model weigh which parts of the input matter most for each part of the output.

For every token the model computes query, key and value vectors, then blends values according to query–key similarity. Self-attention applies this within a single sequence; cross-attention connects two sequences, such as an image and its caption.

All AI terms