---
title: 'Encoder-decoder model'
description: 'A model with separate paths for representing a source input and generating a target output conditioned on that representation.'
canonical_url: 'https://darkfactory.dev/glossary/encoder-decoder-model'
markdown_url: 'https://darkfactory.dev/glossary/encoder-decoder-model.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Encoder-decoder model


## Definition

An encoder-decoder model separates source processing from target generation. The encoder turns an input sequence, image, or other source into internal representations. The decoder produces the target while conditioning on those representations and, for autoregressive outputs, the target items already generated.

Early neural sequence-to-sequence systems compressed a source sentence into one fixed-length vector. Attention relaxed that bottleneck by letting the decoder consult different encoder states for each output. The Transformer kept separate encoder and decoder stacks, using cross-attention to connect them.

## RNN Encoder-Decoder

Kyunghyun Cho and colleagues proposed a model they called the "RNN Encoder-Decoder" in 2014. One recurrent network encoded a symbol sequence into a fixed-length vector, and another decoded the vector into a new sequence. Dzmitry Bahdanau, Cho, and Yoshua Bengio then introduced learned soft alignment for neural machine translation. These papers named and developed influential neural architectures; encoder and decoder were already broader technical roles.

## Distinguish it from nearby terms

A decoder-only model puts source and target into one causal sequence. An encoder-only model produces representations without an autoregressive target generator. Encoder-decoder models give source and target distinct paths, which is useful when their formats, lengths, or attention patterns differ.

## Check your understanding

In translation, the source sentence is visible all at once while the target is generated token by token. Which stack reads the source, what does cross-attention expose, and which target tokens may the decoder inspect?

## Related terms

- [Encoder](https://darkfactory.dev/glossary/encoder)
- [Decoder](https://darkfactory.dev/glossary/decoder)
- [Decoder-only model](https://darkfactory.dev/glossary/decoder-only-model)
- [Attention](https://darkfactory.dev/glossary/attention)

## Evidence and further reading

- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
- [Learning Phrase Representations Using RNN Encoder-Decoder for Statistical Machine Translation](https://arxiv.org/abs/1406.1078)
- [Neural Machine Translation by Jointly Learning to Align and Translate](https://arxiv.org/abs/1409.0473)
- [Attention Is All You Need](https://arxiv.org/abs/1706.03762)
