# What is Encoder-Decoder Model? Also called sequence-to-sequence model, seq2seq. An encoder-decoder model is an architecture with two components: an encoder that reads the entire input bidirectionally into a set of representations, and a decoder that generates output while attending to those representations. It was designed for tasks that map one sequence to another, such as translation. It remains common in speech, translation, and some structured transformation systems. The encoder processes the input without a causal mask, so every input token can be informed by every other token in both directions. This produces richer input representations than a left-to-right pass. The decoder then generates autoregressively, using self-attention over what it has produced so far and cross-attention over the encoder outputs. The separation gives a clean division of labor. Understanding the source and producing the target are handled by different parameters, which suits tasks where the two languages, modalities, or formats differ substantially. Encoder and decoder can also be sized independently, allowing a heavy encoder with a light decoder or the reverse depending on where the difficulty lies. The design has drawbacks for general-purpose assistants. It assumes a clear boundary between a fixed input and a generated output, which fits translation but fits multi-turn conversation awkwardly, since each turn would need re-encoding. It also complicates serving, because two stacks and a cross-attention path must be maintained rather than one uniform stack. Encoder-only variants form a third family. Dropping the decoder entirely yields models optimized for producing representations used in classification, retrieval, and similarity search rather than for generating text. Many embedding systems descend from this branch, which is why representation quality and generation quality are treated as somewhat separate concerns. ## Key points - Encoder reads input bidirectionally; decoder generates output - Decoder reaches the input through cross-attention - Strong fit for translation, speech, and format conversion - Awkward for open-ended multi-turn conversation - Encoder-only variants specialize in representations, not generation ## In practice A speech transcription system encodes an audio clip into a sequence of acoustic representations, reading the whole clip in both directions so that later sounds can disambiguate earlier ones. The decoder then emits text one token at a time, attending back to those acoustic representations at each step. The clean split matches the task, since the input is audio and the output is text with no shared vocabulary. ## Related terms - [Decoder-Only Model](/en/glossary/decoder-only-model) - [Transformer](/en/glossary/transformer) - [Attention Mechanism](/en/glossary/attention-mechanism) - [Embedding Model](/en/glossary/embedding-model) - [Multimodal Model](/en/glossary/multimodal-model) [Back to the AI Glossary](/en/glossary)