Skip to the document
Madhuopen lab
Outcome School · Transformers and architecture14 min read

by Amit Shekhar · 30 May 2026

Cross Attention in Transformers

Cross Attention in Transformers. We will understand what it is, how it works step by step, how it is different from Self Attention, and where it is used.

2,780 words#llm#ai#machine-learning4 recall cards

Cross Attention in Transformers
Read on Outcome School ↗then come back to lock it in
Before you read, guess

How should one approach mastering KV cache compression techniques?

Ten seconds, a guess, then read — a wrong guess still makes the answer stick.

What this article covers

  1. What is Cross Attention?
  2. Why do we need Cross Attention?
  3. Query, Key, and Value in Cross Attention
  4. Self Attention vs Cross Attention
  5. Step-by-step working of Cross Attention
  6. A simple example walk-through
  7. Where Cross Attention is used
  8. Importance of Cross Attention

The article lives on outcomeschool.com. Read it there, then come back: the tutor in the margin has read it and will answer questions, and the questions below check what stayed.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?