Decoder-only model
A decoder-only model is a transformer that keeps only the decoder half of the original design and generates text by predicting each next token from those before it, the architecture behind most large language models.
The transformer introduced in 2017 had two parts: an encoder that read a source sentence and a decoder that wrote a translation. A decoder-only model throws away the encoder. The prompt and the response become a single sequence, and each token can attend only to the tokens before it. The model is pre-trained on one task, predicting the next token, and generates text by repeating that prediction over and over.
In January 2018 a team at Google described a decoder-only architecture for generating Wikipedia-style articles from long source documents. The approach went on to dominate. When OpenAI introduced GPT-3 in May 2020, it showed that a large model of this kind could carry out many tasks given only a few examples written into the prompt, with no further training. Hugging Face's course lists SmolLM, Llama, Gemma and DeepSeek V3 as examples and notes that most modern large language models use the design, typically pre-trained first and then instruction-tuned.
Its appeal is simplicity. One stack of layers, one training objective and one way of working cover almost everything, because nearly any task can be written as text to be continued: a question followed by its answer, a document followed by its summary, a request followed by code. The same model can therefore chat, translate, summarise and program without separate components for each job.
There are trade-offs. Because a decoder-only model reads strictly left to right, it is less suited than an encoder to tasks that benefit from seeing a whole passage at once, such as classifying text or tagging names, where encoder models like BERT are a common and cheaper choice. And because it generates one token at a time, long answers take longer to produce.
When a technical report describes a model as a decoder-only transformer, it is describing the standard design rather than a novelty. The differences between leading models lie in the details layered on top, such as attention variants, mixture-of-experts layers, training data and post-training.
It is a transformer made only of decoder layers, without the separate encoder of the original design. It reads the prompt and its own output as one sequence, with each token able to look only at earlier tokens, and it generates text by predicting one next token at a time. The design is simple and scales well: a single network trained on a single objective, next-token prediction, which can use vast amounts of raw text. Almost any task can be framed as continuing a piece of text, so one model can handle chat, writing, translation and coding. No. BERT is encoder-only: it reads text in both directions to build representations and is trained by filling in masked words. It is good at understanding tasks such as classification but not at generating text. GPT-style models are the decoder-only counterparts. An encoder-decoder model, such as T5, first reads the whole input with an encoder and then generates output with a decoder that consults it. A decoder-only model uses one stack for both, treating input and output as one sequence. Encoder-decoder models are often used for translation and summarisation.Common questions
What is a decoder-only model?
Why are most large language models decoder-only?
Is BERT a decoder-only model?
What is the difference between decoder-only and encoder-decoder models?
Search for "decoder-only transformer", "encoder-only vs decoder-only" or a model name with "architecture" to see how specific models are built. The Hugging Face course, the original papers on arXiv and developers' technical reports are reliable sources. Architecture diagrams in blog posts are often simplified, so check the technical report for the details of any particular model.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.