Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. LLMs /
  4. What is an Encoder-Decoder Model?
LLMs

What is an Encoder-Decoder Model?

Updated September 26, 2026 Read 3 min

An encoder-decoder model, also called a sequence-to-sequence model, uses one component to read and understand the input and another to generate the output, connected by cross-attention.

Contents 11
  1. 01Key takeaways
  2. 02An encoder-decoder explained in simple terms
  3. 03How it works
  4. 04Encoder-decoder vs encoder-only vs decoder-only
  5. 05Where encoder-decoder models shine
  6. 06A worked example
  7. 07Why decoder-only models took over
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

An encoder-decoder model, also called a sequence-to-sequence (seq2seq) model, uses two components: an encoder that reads and represents the input, and a decoder that generates the output. The decoder looks back at the encoder’s representation through cross-attention while producing each token. The original 2017 transformer was an encoder-decoder built for translation.

Key takeaways

  • The encoder reads the whole input at once, in both directions.
  • The decoder generates output left to right, attending to both its own output and the encoder’s.
  • Cross-attention is the bridge between the two.
  • Examples include the original transformer, T5, BART and many translation and speech models.
  • Most general-purpose LLMs today are decoder-only instead.

An encoder-decoder explained in simple terms

Think of an interpreter at a conference. First they listen to the full sentence in Hindi and build an understanding of it (encoding). Then they speak the English sentence word by word, checking back against their understanding as they go (decoding with cross-attention). The two jobs are separate but connected.

How it works

  1. Encoding: the input sequence passes through encoder layers with bidirectional self-attention, producing one representation per input token.
  2. Decoding starts: the decoder begins with a start token.
  3. Causal self-attention: the decoder attends to the tokens it has generated so far.
  4. Cross-attention: the decoder attends to the encoder’s representations, choosing which parts of the input matter for the current output token.
  5. Generate: predict the next token, append it, repeat until an end token.

Encoder-decoder vs encoder-only vs decoder-only

ArchitectureInput handlingOutputTypical use
Encoder-onlyBidirectionalRepresentations, labelsClassification, embeddings (BERT)
Decoder-onlyLeft to rightGenerated textChat, general LLMs (GPT-style)
Encoder-decoderBidirectional input, generated outputGenerated textTranslation, summarisation (T5, BART)

Where encoder-decoder models shine

  • Translation: the input and output are different languages of different lengths.
  • Summarisation: the input is long, the output short.
  • Speech recognition: audio in, text out.
  • Text-to-speech and audio: text in, audio features out.
  • Structured transformations: converting one format into another.

The separation is useful when the input must be fully understood before output begins, and when the input is processed once but referenced repeatedly.

A worked example

Translating “The meeting has been postponed to Friday” into Hindi: the encoder builds a representation of all eight words at once, with full context in both directions. As the decoder writes each Hindi word, cross-attention lets it focus on the relevant English words, such as attending to “Friday” when producing the Hindi word for Friday, even though word order differs between the languages.

Why decoder-only models took over

Decoder-only models are simpler to train at scale, need only one stack of layers, and can treat any task as text continuation. With instruction tuning, they handle translation and summarisation well without a separate encoder. Encoder-decoder models remain strong in specialised tasks, especially translation and speech, and in settings where inputs are long and outputs short.

Limitations

  • More complex than a single stack: two sets of layers plus cross-attention.
  • Less flexible for open-ended chat.
  • Fewer very large, general-purpose encoder-decoder LLMs are available.

Common Use Cases

01

Machine translation

Translate between languages with different word orders and lengths.

02

Summarisation

Condense long documents into short summaries.

03

Speech recognition

Convert audio representations into text.

04

Text-to-speech

Turn text into audio features for a vocoder.

05

Data format conversion

Transform one structured text format into another.

06

Image captioning

Encode an image and decode a descriptive sentence.

Frequently Asked Questions

A model with one component that reads the input and another that generates the output, linked by cross-attention.

Attention where the decoder attends to the encoder's representations of the input while generating output.

The original transformer, T5, BART and many translation and speech models.

Decoder-only models are simpler to scale and can handle most tasks as text continuation after instruction tuning.

It is a natural fit, and such models remain strong in translation, though large decoder-only LLMs also translate well.

Related Terms

  • Encoder
  • Decoder
  • Decoder-Only Model
  • Transformer
  • Cross-Attention
  • Self-Attention

Related AI Terms

What is Multi-Head Attention?Multi-head attention runs several attention operations in parallel, each with its own learned projections, so a model can…What is Prefix Tuning?Prefix tuning is a parameter-efficient fine-tuning method that learns trainable vectors inserted into the attention keys and values…What is an Attention Mechanism?An attention mechanism is a technique that lets a neural network focus on the most relevant parts of…What is Self-Attention?Self-attention is a mechanism where each position in a sequence attends to every other position in the same…What is Positional Encoding?Positional encoding is the method transformers use to represent the order of tokens in a sequence, because the…What is RoPE (Rotary Positional Embedding)?RoPE (rotary positional embedding) encodes a token's position by rotating its query and key vectors by an angle…

Contents

  1. 01Key takeaways
  2. 02An encoder-decoder explained in simple terms
  3. 03How it works
  4. 04Encoder-decoder vs encoder-only vs decoder-only
  5. 05Where encoder-decoder models shine
  6. 06A worked example
  7. 07Why decoder-only models took over
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

AI Topic

  • LLMs

Related Terms

  • What is Multi-Head Attention?
  • What is Prefix Tuning?
  • What is an Attention Mechanism?
  • What is Self-Attention?
  • What is Positional Encoding?
  • What is RoPE (Rotary Positional Embedding)?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
September 26, 2026
Read
3 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}