Exercises — Cross-attention
Self-check questions, exercises, and worked answers
← Back to the lesson: Cross-attention
Check your understanding
In decoder cross-attention, where do Q, K, and V come from?
Show the reasoning
Q is projected from decoder states, because those are the positions doing the reading. K and V are projected from encoder outputs, which form the memory being read. The score matrix therefore has one row per target position and one column per source position.