Learn AI Math

Decode

Also called: Decode Phase

What is Decode?

In one sentence: Decode is the second step of answering, where the model writes its reply one token at a time.

Each new token needs a full pass through the model, using the KV cache so it does not reread everything. Because tokens are made one after another, decode is usually limited by how fast memory can feed the weights to the chip, not by raw math speed.

What does Decode look like?

The steady stream of words you see after a chatbot starts typing is the decode phase.

Why does Decode matter?

Decode speed sets how fast answers appear once they start.

Decode vs. Prefill

Prefill digests your entire input prompt in parallel (compute-bound) to produce the first token; decode generates the reply one token at a time (memory-bandwidth-bound).

DimensionDecodePrefill
Processing styleSequential—1 output token per stepAll prompt tokens processed in parallel
Hardware bottleneckVRAM memory bandwidth (GB/s)GPU compute (TFLOPS)
User metricTime Per Output Token (TPOT) / TPSTime to First Token (TTFT)

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.