What it is
The input goes in whole, and the output comes out one token at a time
Both stacks are built from the same transformer blocks. The decoder differs in two places, a mask on its own attention and a second attention layer pointed at the encoder's output.

Splitting the work in half has two consequences.
The input is read once, in both directions, and the result is reused for every output token. A decoder-only model with a KV cache also reads its prompt once, in one pass called prefill, and reuses the stored attention keys and values at every step after that, so both shapes pass over the input once. The difference is in how the input is read and what each output step costs. The encoder lets every input token see every other one, where a decoder-only model reads its prompt left to right. And each output step in an encoder-decoder runs only the decoder stack, which can be much smaller than the encoder.
That second point is the reason the halves can be sized independently. Google's T5Gemma release pairs a 9B encoder with a 2B decoder for exactly this reason, because summarization needs a deep reading of a long input and writes a short output.
Keep reading
The rest of this article is free with an account
Create a free account to read the remaining 6 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.
- 02Span corruption is what trains both halves
- 03Where the shape is still the default
- 04The models you'll see, as of September 2026
- 05Choosing between this and a decoder
- 06How to try it
- and 1 more
