179 questions
No questions match those filters.
GPT, BERT, and T5 are all Transformers — what actually...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe dividing line is bidirectionality versus causality. BERT’s encoder attends in both directions at once, so a token’s representation is informed by everything before and after it — great for understanding a fixed piece of text, useless for generating one, since generation has to commit to a token before the “future” tokens even exist. GPT’s decoder solves that by masking attention to only look backward, trading away bidirectional context for the ability to generate autoregressively, one token at a time, conditioned only on what’s already been produced.
T5 doesn’t pick a side — it keeps both blocks and connects them with cross-attention, so the encoder gets full bidirectional context on the input while the decoder still generates autoregressively, attending back into that encoded representation at every step. This is why T5-style models are natural for machine translation or summarization: the entire input is available to condition on before a single output token is produced, which a pure decoder-only model has to reconstruct implicitly through its own context window instead.
The architectural choice also predicts failure modes. Encoder-only models can’t be prompted to “write” anything — they classify, tag, or embed. Decoder-only models can technically do translation or summarization by treating the source as part of the prompt, but they process it causally rather than bidirectionally, which is part of why frontier decoder-only LLMs need to be much larger to match what a dedicated encoder-decoder model achieves on narrow sequence-to-sequence tasks at a fraction of the parameter count.