Decode Phase

Decode Phase

The decode phase is the part of text generation in which an AI language model produces its answer word by word. Each new word depends on all previous ones, which is why this step cannot be parallelized and is particularly computationally intensive.

When a language model — that is, a program that understands and generates text — writes a response, it doesn’t happen all at once. It first chooses the first word, then the second, then the third. Each choice is based on everything written so far. This process is called the decode phase. It begins as soon as the model has processed the input, and ends with the last word of the response. Between these two steps — reading the input on one hand, and the actual text production on the other — lies a technically important distinction that remains invisible in everyday use.

Why the decode phase sets the pace

The decode phase determines how quickly a user receives their answer. Reading the input can be sped up, because all input words can be processed simultaneously. Text production, however, cannot: word two can only be computed once word one has been determined. This makes the decode phase the bottleneck — that is, the point that slows down the entire process.

For companies answering millions of requests per day, this is a serious cost problem. Every word of a response requires a complete computational step. A response with 300 words means 300 such steps performed one after another. That’s why a large part of research is focused on making precisely this phase more efficient — not training, but ongoing operation.

Step by step: how a word comes into being

In each step of the decode phase, the model calculates a probability distribution: which word fits best as the next one? All previous words — both the user’s input and the response words already generated — flow in as context. The model then selects a word from this distribution and appends it to the response so far.

So that the model doesn’t have to recalculate from scratch with every new word, it stores intermediate results of the already-processed words in what’s called a KV cache — short for key-value cache, a kind of notebook for computational steps. Without this cache, each step would become proportionally slower the longer the response grows. With it, the effort per step remains roughly constant.

There are also various strategies for how the model selects from the probability distribution. Greedy decoding always picks the most probable word — fast, but often monotonous. Sampling methods choose more randomly and produce more varied texts. The temperature parameter controls how risk-prone the model is when making its selection.

Where the term appears in practice

Anyone using ChatGPT, Gemini, or another AI assistant observes the decode phase directly: the text appears word by word on the screen, not all at once. This visible “typing” is not a design trick — it reflects the actual process. The model sends each word as soon as it has been computed.

In technical articles and product announcements, the decode phase usually comes up in connection with speed. Metrics like “tokens per second” directly describe how fast a model works in this phase — a token corresponds roughly to a short word or a syllable. Providers like Groq or Fireworks AI explicitly advertise particularly high figures, because faster decoding noticeably improves the user experience.

New model architectures such as speculative decoding also attempt to speed up this phase. The idea: a small, fast helper model suggests several words at once. The large model then only needs to check whether the suggestions are correct — which is much faster than generating them itself. This turns 300 individual steps into considerably fewer, without compromising response quality.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.