Cross-Attention (XAttn)

An attention calculation that lets one sequence — like a question — look up relevant information from a separate sequence, such as a document or an image.

Technically: Cross-Attention derives queries from one sequence (e.g., the decoder state) and keys/values from a separate sequence (e.g., encoder outputs or image patch embeddings), letting the model condition generation on external context without merging both into one self-attention call. It is central to encoder-decoder architectures (T5, Whisper) and multimodal models where text tokens attend to visual features, and serves as an interface for retrieval-augmented generation.

Category: Attention Mechanisms

Related ideas