Encoder Decoder Seq2Seq

Deep Learning interview question · Medium difficulty

What problem did the encoder-decoder architecture solve?medium

Status
✓
Type
conceptual
Topic
encoder-decoder-seq2seq
Frequency
common
Tags
encoder-decoder, seq2seq, translation, architecture
Answer

It solved sequence-to-sequence problems where input and output can have different lengths — translation, summarization, question answering — by having an encoder read the input into a meaningful representation and a decoder generate the output step by step from that representation.

Explanation

Before encoder-decoder models, converting one sequence into another sequence of a different length was difficult — an English sentence and its Hindi translation rarely have the same number of words or the same word order. The encoder reads the full input and compresses it into a context representation; the decoder then uses that representation to generate the output sequence one token at a time, independent of how long the input or output actually is. This unlocked machine translation, text summarization, question answering, chatbot response generation, and speech-to-text/text-to-speech style tasks. The early limitation was that the entire input got compressed into one fixed-size context vector, which caused real information loss for long sentences — that specific limitation is exactly what attention was introduced to fix.

Follow-upWhy does compressing the whole input into one fixed-size vector fail for long sentences specifically?
Follow-upHow does the decoder know when to stop generating output tokens?
Follow-upWhat's the direct architectural link between the fixed-vector limitation here and why attention was introduced?