Self-attention

Attention where queries, keys and values all come from the same sequence, so each position looks at the other positions of that same input.

What people get wrong

The "self" distinguishes it from cross-attention, where one sequence attends to a different one — a decoder reading an encoder's output, or an image model attending to a text prompt.

A definition is not an understanding. This is taught properly in Attention, conceptually, part of Transformers & attention.

Learn this properly