Notes

Decoder-Only Language Model

Almost every model you have ever talked to has the same basic shape, and it is the simplest one on offer: read text left to right, predict the next piece. A decoder-only language model is built entirely around that single ability — no separate component for reading an input, no second one for producing an output.

One objective, every task

Because the input and the output live in the same stream, there is nothing a prompt cannot be. Translation, summarisation, classification and code completion all become “continue this text”, so one set of weights serves jobs that used to need task-specific heads and task-specific training runs. That is also what makes in-context learning possible: examples placed in the prompt are simply more of the sequence being continued. The GPT series established the pattern and LLaMA, Mistral, Qwen and Gemma followed it.

What the shape buys and costs
  • Training is self-supervised on raw text with no labels, which is the only reason a web-scale corpus is usable at all.
  • Generation is sequential — one token per forward pass — which is why serving speed is quoted in tokens per second.
  • Each position sees only what precedes it, so the model cannot revise an earlier choice; it can only continue from it.

The lesson of the past few years is that this narrow objective, scaled far enough, absorbed most of the specialised machinery the field had built around it. Predicting the next word turned out to be a general-purpose task.

A decoder-only language model is trained on one objective — predict the next token given everything before it — with input and output occupying a single text stream rather than separate encoder and decoder stages. Nearly all current LLMs take this form, because it trains self-supervised on unlabelled text and turns every task into text continuation, which is what makes prompting and in-context learning work without task-specific training.

These systems do one surprisingly small thing: they guess what comes next, then do it again. A decoder-only language model is built around only that. There is no separate part for listening and part for speaking — your question and its answer are one continuous piece of writing, and the model is simply carrying that writing on. This is why you can ask it to translate something, shorten something or write code without anyone rebuilding it for each job: every one of those requests is just “keep going from here”. The surprise of the last few years was how far guessing the next word actually goes.