What this lesson covers.
This module is one of 42 in the curriculum. Below is the canonical interactive lesson — tabs, cards, and diagrams from the source repo, rendered inside the course shell. An audio narration runs alongside it - the sticky player at the top of the page plays the full Module 23 clip.
If you prefer to read first and play with the demos after, the interactive lesson sits below this section. If you'd rather hear it narrated while you scroll, hit play on the sticky audio bar at the top — or just let it autoplay.
Read / reason / test
Identify which sequence asks the question
High school · build the intuition
Cross-attention lets one sequence request information from another, such as text positions attending to image representations. A large weight remains an internal contribution, not proof that an object was correctly identified. Check the image and answer together. If preprocessing excluded an important region, a later attention operation cannot recover pixels that were never represented.
College · work the example
Four text queries attending to 196 image positions create 784 scores in one head. Reverse the direction and the output belongs to image-query positions instead. Projection widths and fusion placement therefore matter. This authored shape example does not describe every vision-language architecture or establish the semantic meaning of individual weights.
Explain it back
Describe the process in your own words. Identify the assumption that makes this example work, then explain one conclusion it cannot establish.
Read the primary source or official documentation →
The numerical examples are authored teaching exercises, not measured model benchmarks. This extension adds context to the original lesson.
The lesson itself.
Layer 14 — Cross-Attention Fusion
Teaching the LLM to 'See' with Image Patches
Instead of mixing these directly into the text stream, advanced architectures (like Flamingo or Whisper) use Cross-Attention. As the LLM thinks about the next word, it sends out a Query to the image patches, retrieving the exact visual Key/Values needed at that exact moment.
Try it: cross-attention clip.
Caption tokens (rows) cross-attend to image patches (cols). Hover any word or patch to see grounding light up across the matrix.
Further reading.
The canonical references for this module. External links open in a new tab.
What to read next.
Use the pager below to move sequentially through the curriculum, or jump to any module from the course index. Each track has a "Prereq: ↑ foundation" callout so you can backfill anything that wasn't clear.