Case & CodeA FIELD GUIDE TO AI
Start learning
Intermediate

Decode

Also: decoding phase, token generation, text generation speed

In plain words

The model writing its answer one word-piece at a time. How fast this goes depends mostly on memory bandwidth.

The fuller definition

Decode is the phase in which a model writes its answer one token at a time. Each token requires reading the needed weights from memory again, so decode speed is limited mainly by memory bandwidth.

How it fits together
  1. Next token

    One at a time

  2. Weights read

    Every token

  3. Speed

    Set by bandwidth

A simplified relationship, not a screenshot or a complete design.

A concrete example

A model writing 40 tokens per second is decoding at 40 tokens per second.

The distinction that matters

The speed formula, bandwidth divided by bytes read per token, predicts decode speed, not prefill speed.

Related terms

Where it is taught

How models learn from examples

Source and further reading

Hugging Face · LLM course

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC