Queries come from one sequence, keys/values from another. How a decoder reads an encoder’s output.
Introduced inSep 2014Neural Machine Translation by Jointly Learning to Align and Translate
In cross-attention the queries belong to the current stream (say, generated text or noisy image latents) while keys and values come from a different one (encoder output, a text prompt, audio features). It is the bridge in encoder-decoder models like Whisper and the conditioning mechanism in diffusion U-Nets, where image latents cross-attend into the text prompt’s embeddings.
Share of new models that have included cross-attention over time.
Open any of these on hfviewer to find this block in the interactive architecture graph.
Browse all 177 models with this in the catalog →
hfviewer renders the full architecture of 3,500+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.
Browse all model graphs →