What problem did the encoder-decoder architecture solve?medium
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.
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.