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 a Decoder-Only Model?
LLMs

What is a Decoder-Only Model?

Updated September 26, 2026 Read 3 min

A decoder-only model is a transformer built from a single stack of decoder layers that generates text one token at a time using causal attention. Most modern large language models use this design.

Contents 11
  1. 01Key takeaways
  2. 02A decoder-only model explained in simple terms
  3. 03How it works
  4. 04Decoder-only vs other architectures
  5. 05Why decoder-only models became dominant
  6. 06A worked example
  7. 07Trade-offs
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

A decoder-only model is a transformer built from one stack of decoder layers that generates text left to right, using causal attention so each position sees only earlier positions. There is no separate encoder: the prompt and the generated response live in the same sequence. GPT-style LLMs, including most modern chat models, use this architecture.

Key takeaways

  • One stack of layers handles both understanding the prompt and generating the answer.
  • Causal masking prevents any position from seeing future tokens.
  • Training is simple: next-token prediction on raw text.
  • The design scales well and supports in-context learning.
  • It has replaced encoder-decoder designs for general-purpose LLMs.

A decoder-only model explained in simple terms

Imagine writing a document where you can read everything you have written so far but nothing ahead. Your prompt is the first part of the document, and the answer is what you keep writing. There is no separate “reading department” and “writing department”: one process does both, and the prompt simply sets the scene.

How it works

  1. The prompt is tokenised and embedded.
  2. Layers of causal self-attention and feed-forward networks process the sequence, with each position attending only to itself and earlier positions.
  3. The final layer produces logits over the whole vocabulary for the next token.
  4. A token is sampled, appended to the sequence, and the process repeats.

During inference, the model caches keys and values so it does not reprocess the prompt for every new token.

Decoder-only vs other architectures

AspectDecoder-onlyEncoder-onlyEncoder-decoder
Attention over inputCausal (left to right)BidirectionalBidirectional input, causal output
Produces textYesNoYes
Training objectiveNext-token predictionMasked language modellingSequence to sequence
ExamplesGPT-style LLMsBERTT5, BART
Best atOpen-ended generation, chat, codeClassification, embeddingsTranslation, summarisation

Why decoder-only models became dominant

  • Simplicity: one stack, one objective, one loss.
  • Data efficiency at scale: any text can be training data; every token provides a prediction target.
  • Task flexibility: most tasks can be phrased as text continuation, so no task-specific heads are needed.
  • In-context learning: examples in the prompt steer behaviour without retraining.
  • Serving efficiency: the KV cache makes incremental generation practical.

A worked example

Prompt: “Translate to Hindi: Good morning.” A decoder-only model treats this as text to continue. Its causal attention lets the tokens of “Good morning” inform what comes next, and instruction tuning has taught it that such a prompt should be followed by a Hindi translation rather than more English. One architecture handles translation, summarisation and chat, purely by continuing text appropriately.

Trade-offs

Because attention is causal, earlier tokens cannot see later ones, so the model’s representation of the prompt is one-directional. Encoder-only models can be stronger for pure understanding tasks such as classification and embeddings at a given size. In practice, the flexibility and scale of decoder-only models usually outweighs this.

Limitations

  • Generation is sequential, limiting speed.
  • No bidirectional view of the prompt.
  • Long prompts consume context window and memory.
  • Errors early in generation propagate forward.

Common Use Cases

01

Chat assistants

Generate conversational responses from prompts.

02

Code generation

Continue and complete code in developer tools.

03

Content drafting

Write articles, emails and summaries.

04

Agentic systems

Generate plans and tool calls step by step.

05

Few-shot tasks

Learn formats from examples inside the prompt.

06

Translation and rewriting

Handle transformation tasks as text continuation.

Frequently Asked Questions

A transformer with a single stack of decoder layers that generates text left to right using causal attention.

Because it uses only the decoder part of the original encoder-decoder transformer, without a separate encoder.

Yes, as are most modern general-purpose LLMs.

Attention masked so each position can only attend to itself and earlier positions.

They are more flexible and scale well for general use. Encoder-decoder models remain strong for translation and speech.

Related Terms

  • Decoder
  • Causal Language Model
  • Encoder-Decoder Model
  • Transformer
  • Next-Token Prediction
  • Large Language Model

Related AI Terms

What is an Attention Head?An attention head is a single attention unit inside a transformer layer, with its own query, key and…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 Multi-Head Attention?Multi-head attention runs several attention operations in parallel, each with its own learned projections, so a model can…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. 02A decoder-only model explained in simple terms
  3. 03How it works
  4. 04Decoder-only vs other architectures
  5. 05Why decoder-only models became dominant
  6. 06A worked example
  7. 07Trade-offs
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

AI Topic

  • LLMs

Related Terms

  • What is an Attention Head?
  • What is Prefix Tuning?
  • What is an Attention Mechanism?
  • What is Self-Attention?
  • What is Multi-Head Attention?
  • 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}