MORAIDICTIONNAIRE IA
Architecture

Encoder-Decoder

The two-stage architecture that reads a sequence, understands it, then generates a new one.

Picture an interpreter at a conference: she first listens to a full sentence, distills it into a single idea, then rephrases it in another language. This is precisely the principle of the encoder-decoder architecture, a foundational deep-learning blueprint for turning an input sequence into an output sequence of a different length.

Two modules, one bridge

The architecture splits into two complementary blocks:

The flow can be summarised as:

$$ \mathbf{c} = f_{\text{enc}}(x_1, \dots, x_n) \qquad y_t = f_{\text{dec}}(\mathbf{c},\, y_1, \dots, y_{t-1}) $$

The attention breakthrough

Early versions (RNN/LSTM) squeezed the entire input into a single vector, creating a bottleneck for long sequences. The attention mechanism removed it: at each generation step, the decoder looks back at all encoder states and weights the relevant ones. This very idea gave rise to the Transformer in 2017.

Three major families

Type Encoder Decoder Typical use
Encoder-only Classification, understanding (BERT)
Decoder-only Text generation (GPT)
Encoder-decoder Translation, summarisation (T5)

This architecture powers machine translation, text summarisation, speech recognition, and image captioning.

Understand, then produce: the encoder-decoder is the backbone of sequence transformation.

Explore the full AI dictionary →