Back to Home
Transformer Architectures
🟡 Intermediate · 6–8 min

Encoder-Decoder Models (T5)

T5 is an encoder-decoder model. The encoder first understands the input, then the decoder generates the output.

Playground

Understand, then generate

Pick a task, then press Run T5. Watch the encoder understand the input and the decoder generate the output.

Input
EncoderUnderstand the input
Internal understanding
DecoderGenerate the output
Output

One model, two halves - the encoder understands, the decoder generates.

How T5 works

Two halves, working together

The encoder and decoder work together. One understands the input, the other creates the output - passing an internal understanding between them.

When T5 is useful

Tasks that read and write

Tap a card to watch the read → understand → generate flow.

BERT vs GPT vs T5

Three models at a glance

🔎 BERT
StrengthUnderstanding
ArchitectureEncoder-only
✍️ GPT
StrengthGeneration
ArchitectureDecoder-only
🔁 T5
StrengthUnderstanding + Generation
ArchitectureEncoder-Decoder
🔎 BERT
✍️ GPT
🔁 T5
🔑
Key takeaways
  • • T5 combines an encoder and a decoder.
  • • The encoder understands the input.
  • • The decoder generates the output.
  • • T5 is useful when tasks require both understanding and generation.
  • • Different architectures are designed for different kinds of problems.
Summary

Encoder-decoder models combine the strengths of understanding and generation. They are useful for tasks where the model must first understand information before creating a new response.

Transformer Architectures section complete