Transformers and LLMs

Cross-Attention, explained

Cross-attention lets one sequence attend to information from a different sequence or modality.
Back to Glossary

Part of the Semantic Notion technical glossary.

Short Definition

Cross-attention lets one sequence attend to information from a different sequence or modality.

Intuition

One representation asks questions of another representation, such as generated text looking back at an image or source sentence.

Technical Definition

Cross-attention usually forms queries from one stream and keys and values from another stream, enabling conditional information flow across inputs.

Example

An image captioning model may use text queries that attend to visual features.

Common Misunderstandings

Cross-attention is not the same as concatenating inputs.
It is a mechanism used inside many architectures, not only translation models.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.