Moderate Transformers Question 80 of 223

When would you pick an encoder-decoder model instead of decoder-only?

GenAI / LLM · Speak this in 60–90 seconds · Faridabad & Delhi NCR

PICTURE THIS: AN LLM TURN

Text inTokens
TransformerAttention
Text outNext token

Simple meaning

Encoder-decoder models such as T5 shine at transduction: translate, summarize, or map a full input to a structured output.

1

WHY — Transformers instead of guessing?

Why interviewers care about Transformers:

They are checking judgment

on Transformers.

A good answer names

the situation, the default choice, and one exception - that reads as experience.

Stay structured

Name the idea, why it exists, then one short example.

Close cleanly

End with when you use it and one common pitfall.

2

STEPS — What happens with tokens?

Before the model can read a sentence, it goes through these steps:

  1. 1
    Encoder-decoder models such as

    T5 shine at transduction: translate, summarize, or map a full input to a structured output.

  2. 2
    Token IDs

    Decoder-only models dominate open-ended chat.

  3. 3
    For RAG, either can

    work, but ops and tooling today favor decoder-only LLMs.

  4. 4
    Context mix

    Attention looks at nearby tokens together.

  5. 5
    Next token

    The model scores what should come next.

  6. 6
    Decode

    IDs turn back into readable text.

3

EXAMPLE — See it in action

Let's see how a real sentence is tokenized (tokens may vary by model):

Input text
“Decoder-only models dominate open-ended chat.”
Tokenized output
Decoderonlymodelsdominateopenended
Token IDs (example)
2987408337471632900

Note: Actual tokens and IDs depend on the tokenizer (e.g., GPT, Llama, etc.).

Key takeaway

Encoder-decoder models such as T5 shine at transduction: translate, summarize, or map a full input to a structured output. Decoder-only models dominate open-ended chat.

Chat with us