When would you choose an encoder-decoder architecture like T5 over a decoder-only model?
Last updated
Pick an encoder-decoder for clear input-to-output transformations (translation, summarization, speech-to-text) where the input is long relative to the output, especially when fine-tuning a moderate-size model for one task.
The bidirectional encoder reads the whole input once. A lighter decoder generates via cross-attention to cached encoder states, which also bridges different modalities (e.g.
Whisper).Prefer decoder-only for open-ended chat, in-context learning, interleaved multi-turn input, or when you want frontier checkpoints and serving tooling like
vLLM.
- https://gate.ai/blog/decoder-only-vs-encoder-decoder-models-architectural-differences-compared
- https://github.com/ombharatiya/AI-Engineer-Interview-Questions/blob/main/02-llm-fundamentals/questions.md
- https://medium.com/projectpro/your-complete-22-part-series-on-ai-interview-questions-and-answers-part-3-c4e813525c48