sequence-to-sequence
/ SEE-kwens too SEE-kwens /
Sequence-to-sequence is a way of framing a whole family of tasks: take one sequence in, produce a different sequence out, where the two need not be the same length. Translation is the textbook case — five English words might become three French ones. So is summarizing an article into a paragraph, transcribing speech into text, or turning a question into an answer. The key idea is that the model maps a variable-length input onto a variable-length output, rather than producing one fixed label.
The classic recipe has two parts working in relay. An encoder reads the entire input and compresses its meaning into internal vectors; a decoder then generates the output one token at a time, each step conditioned on both the encoder's understanding and what it has produced so far. Early seq2seq models squeezed the whole input into a single summary vector, which choked on long inputs — and it was precisely this bottleneck that the attention mechanism was invented to relieve, letting the decoder look back at any part of the input as needed.
Sequence-to-sequence was a unifying insight: a startling range of problems are really just "rewrite this sequence as that one," and once you see them that way, one architecture handles them all. The framing is so general that even tasks that don't look like sequences — answering trivia, solving math word problems — can be cast as text-in, text-out. That generality is powerful, but it can also flatter: phrasing a task as sequence-to-sequence makes it tractable for the model, yet says nothing about whether the model's fluent output is actually correct.
Speech-to-text: the input is a sequence of audio frames, the output is a sequence of letters or words, and the two have wildly different lengths. The same seq2seq framing handles translation, summarization, and code generation — only the data changes.
One sequence in, a different-length sequence out — one frame for many tasks.
The original seq2seq bottleneck — cramming a whole input into one fixed vector — is exactly the failure that motivated attention. Knowing this connects the history: attention wasn't a Transformer invention; it first appeared to rescue sequence-to-sequence translation, then later became the whole architecture.