What Is an Encoder-Decoder Architecture?

Encoder-Decoder Architecture Explainer

An encoder-decoder architecture divides a model into two roles. The encoder transforms an input into an internal representation, and the decoder uses that representation to produce an output, often one element or token at a time.

Early sequence-to-sequence systems compressed an input sequence into recurrent hidden states. Attention later allowed the decoder to consult different encoder states as needed, reducing dependence on a single fixed-size summary. Transformers use attention throughout both components.

Encoder-decoder models are common in translation, summarization, speech processing, and structured generation. The input and output can have different lengths, which makes the design useful when the task maps one sequence or representation into another.

Errors can arise in either half. The encoder may omit important distinctions, while the decoder may generate fluent but unsupported content. Evaluation should examine representation quality, output accuracy, robustness to long inputs, and whether decoding procedures match the task.

An encoder-decoder architecture converts an input into an internal representation and uses that representation to generate an output.

Key terms include encoder, decoder, internal representation, sequence-to-sequence, hidden state, attention, context, generation and output token.

The encoder builds a representation of the input, while the decoder conditions each output decision on that representation and prior outputs.

Attention creates a flexible connection by letting the decoder emphasize different input positions at different moments.

A decoder cannot recover information the encoder failed to preserve, and a strong representation does not prevent poor output choices.

Teams evaluate both the final output and intermediate behaviors such as alignment, coverage, length handling, and grounding.

Explore more "Explainers"

Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.