Glossary

What is Encoder-decoder architecture?

In Turkish: Kodlayıcı-kod çözücü mimarisi · Topic: Models and training

A two-part design in which an encoder reads the input and turns it into a rich internal representation, and a decoder generates the output piece by piece from it. It is common in tasks that transform one sequence into another, such as translation and summarization.

How does it work?

The encoder sees the whole input text and produces vectors that reflect the context of each piece. The decoder writes the output in order, one piece at a time. At each step it looks both at what it has already written and at the encoder's output; the second kind of look is called cross-attention. For example, a Turkish sentence goes into the encoder and its English version comes out of the decoder word by word. The original Transformer was designed this way.

Why does it matter?

Handling input and output separately is a natural fit for tasks that transform one text into another. Today's chat models mostly use a decoder-only design, but encoder-decoder models are still used for translation, speech recognition and other text-to-text tasks. Knowing the architecture type also helps in reading model comparisons in the news.

Example

The T5 model frames every task as text-to-text, and OpenAI's speech recognition model Whisper processes the audio with an encoder and produces the transcript with a decoder.

FAQ

What is the difference between encoder-decoder and decoder-only models?

An encoder-decoder model has two separate parts, one that reads the input and one that writes the output. A decoder-only model uses a single stack that treats the prompt and its continuation as one sequence and extends the text step by step.

What is cross-attention?

It is the attention layer that lets the decoder look at the encoder's representation of the input while generating output. This way each new word is written with reference to the relevant part of the input.

All terms