AI GLOSSARY · AI CONCEPTS

Encoder-decoder

Markdown version

Definition

An encoder-decoder is a neural network design with two parts: an encoder that reads an input sequence and builds an intermediate representation, and a decoder that uses it to generate an output sequence, word by word.

Also called: encoder-decoder model, encoder decoder architecture.

In plain language

An encoder-decoder model works in two steps, like a human translator who first reads a whole sentence and then writes it out in another language. The first part, the encoder, reads the input, for example a French sentence, and boils it down into an internal summary. The second part, the decoder, uses that summary to write the output, for example the English sentence, one word at a time. The design suits jobs where one piece of text becomes another, such as translation. It is one design among several.

Technical definition

In the description in Speech and Language Processing (Jurafsky and Martin, chapter 13), the encoder takes the input words x = [x1, ..., xn] and produces an intermediate context h; at decoding time the system takes h and generates the output y word by word. The textbook calls this the standard algorithm for machine translation and says encoder-decoder or sequence-to-sequence models map an input sequence to an output sequence that is a complex function of the whole input. The Transformer paper's abstract notes that dominant models used an encoder-decoder configuration and that the best ones connected encoder and decoder through an attention mechanism.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Guide · Illustrative, not executed

    What Is an LLM? The Facts Agent Users Need

    What you see
    The guide explains that an LLM predicts text one token at a time inside a fixed context window, and what that means for cost and reliability.
    Why it exercises the concept
    That one-token-at-a-time loop is the generation step the decoder performs. The guide does not discuss encoder-decoder designs, so use it to see the decoding half in isolation.
  2. Guide · Illustrative, not executed

    What Is RAG? Retrieval-Augmented Generation Explained

    What you see
    The guide's facts note that the original RAG paper pairs a retriever over a dense vector index with a seq2seq generator, and the guide explains how retrieved passages are placed in the prompt.
    Why it exercises the concept
    It shows a sequence-to-sequence model used as one part of a larger system, which is where encoder-decoder models often appear. Most agent setups today place retrieved text in the prompt instead.
  3. Skill by Skill Almanac · Illustrative, not executed

    pseudo-localization-tester 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    The skill's catalogue line says it builds a pseudo-locale from a resource file and reports truncation, fragment and hard-coded-text risks before translation.
    Why it exercises the concept
    Translation is the textbook use of encoder-decoder models. This skill does not translate; it prepares software text for translation, so it is a contrast case about the task rather than the architecture.

How it shows up when you use agents

You do not choose an encoder-decoder when you run Claude Code, Codex or Cursor, but the idea explains how the models behind them are described. Machine translation is the textbook use of encoder-decoder models. The Transformer paper's abstract describes the dominant models of its time as being in an encoder-decoder configuration, and the transformer keeps that pairing, linked by attention.

When it shows up: in a model card or paper that says a model is encoder-decoder, in a translation feature built on one, or when someone asks why a retrieval system used a sequence-to-sequence generator. What breaks when it is misunderstood: readers assume every language model reads and writes with two separate parts, or that an encoder-only model such as BERT can write long text. The next action is to read the model card to see which parts the model has before deciding what to use it for.

Common confusions

  • Encoder-decoder versus decoder-only. An encoder-decoder has a separate reading part and writing part. A decoder-only model generates from the prompt it is given. Check the model card, since both are called transformers.
  • Encoder-decoder versus encoder-only. An encoder-only model such as BERT produces representations of text for understanding tasks and does not generate an output sequence by itself.
  • Encoder-decoder versus seq2seq. The two names are used together in SLP3, which writes encoder-decoder or sequence-to-sequence models. Seq2seq names the task shape, and encoder-decoder names the two-part design.
  • Myth: attention replaced the encoder-decoder idea. The Transformer abstract describes the best earlier models as connecting encoder and decoder through attention, and the Transformer keeps that pairing.

Terms that mention Encoder-decoder

5 terms mention this one

More in AI concepts

Next steps

  1. What Is an LLM? The Facts Agent Users Need The long-form guide.
  2. pseudo-localization-tester A skill that exercises it.
  3. BERT Related term.
  4. Machine translation Related term.
  5. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; sources and example targets checked by claude-haiku-5-5 source check; claude-sonnet-5-5 editor pass on 2026-11-24. Last verified .

This entry is still in review, so it is not listed in search engines yet.

Change log (2)
  • : First version.
  • : Verifier pass: applied verifier corrections to unsourced or overstated claims.