Which modern LLM architecture uses cross-attention?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
T5 and BART, the encoder decoder family, use cross-attention in the decoder. Decoder-only LLMs like GPT, Llama, and Mistral have no encoder, so they use self-attention only.
Think of two ways to write. The first is jotting in a notebook: you only ever look at what you've already written, one stream, one author. That's self-attention. The second is a translator at a desk with a foreign manuscript on one side and a blank page on the other. While drafting on the blank page, the translator keeps glancing across to the source. That cross-referencing between two separate documents is cross-attention. Decoder-only LLMs like GPT and Llama are the notebook writer, only one stream. T5 and BART are the translator at the desk, with a separate encoder stream to glance over.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define the Q/K/V routing distinction, walk the three architectural families with canonical examples, explain why the field moved to decoder-only for general LLMs, and show where cross-attention is still essential today (multimodal, speech).
| Architecture | Attention types used | Cross-attention | Examples |
|---|---|---|---|
| Encoder decoder | Bidirectional self + causal self + cross | Yes, decoder side | T5, BART, Whisper, original Transformer |
| Encoder-only | Bidirectional self | No | BERT, RoBERTa, DeBERTa |
| Decoder-only | Causal self | No | GPT-5.5, Claude Opus 4.7, Llama 4 Maverick, Gemini 3.1 Pro |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming every transformer has cross-attention because the original 2017 paper did. Decoder-only architectures dominate modern LLMs and never use it.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.