← Back to concept explainers

Concept Fable

Cross-attention

Conclusion first:Cross-Attention lets one sequence attend to another sequence's representation when generating or updating representations. A typical example is that in an Encoder-Decoder, the Decoder looks at the Encoder output through Cross-Attention; it is also used in multimodal models to let text attend to image features. In enterprise Agents, it corresponds to structured references from the generation process to external materials, retrieval results, tool outputs, or visual representations.

Cross-Attention · Architecture

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

The translator looks at the original scroll and writes a reply

The translation bureau received both the foreign original scroll and the local format requirements. If a young translator only stared at the sentences already written, place names, clauses, and etiquette in a long letter would quickly be glossed over. So the curator placed the original scroll desk and the reply desk side by side, and with every sentence written, they looked back at the truly relevant passage in the original.

The translator-clerk first located the corresponding position in the original scroll by sentence meaning, then decided how to organize the reply; the original scroll provided the basis, and the reply preserved coherence. The two desks each had their own order, yet exchanged clues at every step.

Once an exception in the old covenant was hidden in the margin; the draft read smoothly, but the meaning had already drifted. The curator did not rewrite the entire letter, but marked the corresponding place where the deviation occurred, so the translator knew which spot to re-examine.

They recorded the page number, paragraph, and final translation for each reference, and reviewed with several rounds of letters of varying lengths. Rework shifted from retranslating the entire piece to local corrections, and verification had a traceable path.

From then on, generated content no longer relied only on its own context; it could, when needed, re-retrieve evidence from another set of representations and merge the result back into the current output.

Concept Anchor

This story is about: cross-attention

Cross-Attention lets one sequence attend to another sequence's representation when generating or updating representations. A typical example is that in an Encoder-Decoder, the Decoder looks at the Encoder output through Cross-Attention; it is also used in multimodal models to let text attend to image features. In enterprise Agents, it corresponds to structured references from the generation process to external materials, retrieval results, tool outputs, or visual representations.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Story Mapping

  • Original text desk and reply desk: two different sequences or modalities
  • Writing from memory: missing references to external conditions
  • Longer summary: mid-text patch
  • Index window: Cross-Attention
  • Original text representation: Encoder output, retrieval results, or visual features
  • Every step looks back at the source: the generation process is constrained by external conditions
  • Final insight: reliable generation requires structured attention to external information

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

self-attentionencoder-decoderimage-text alignment
京ICP备2026014272号