Cross-Attention

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.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.