Architecture / Blocks
verifiedEncoder-Decoder
When the input and the output are different things — a French sentence and its English translation — one stack can read the input with no restrictions while another writes the output one token at a time. The reader sees everything at once; the writer sees only what it has already produced, plus whatever it pulls from the reader.
An unmasked encoder stack and a causally masked decoder stack, joined by cross-attention where the decoder's queries meet the encoder's keys and values. It costs roughly twice the parameters of a decoder alone, and it remains the better fit where the input is genuinely a fixed object to be consumed rather than a prefix to be continued.
Encoder produces H = Enc(x) once. Each decoder layer runs masked self-attention over y sub <t , then cross-attention with Q from the decoder and K, V from H. H is computed once and reused at every decoding step.
layers holds 50% of the budget; rest holds the remaining 50%.
How the parameter budget divides between the encoder and the decoder beside it. Drag the decoder depth to shift the balance between reading and writing.
Reviewed by opendroid · 2026-08-04
- arXiv:1706.03762 — Attention Is All You Need
- arXiv:1409.3215 — Sequence to Sequence Learning with Neural Networks
- arXiv:1910.10683 — Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer