Skip to content

Stop Token

A special token that the model outputs when it considers the response to be complete. Upon receiving it, the application stops the generation.

Why It Is Needed

LLMs predict tokens infinitely — that's their nature. The stop token is an agreement: 'the response ends here.' Without it, the model would 'ramble' indefinitely.

What It Looks Like

It is often `,<|eot_id|>,` — each model has its own marker, defined during tokenization.

In Practice

  1. The model outputs token by token.
  2. As soon as a stop token appears — generation is terminated.
  3. In the API, there are usually additional stop sequences (stop) that the application checks.

See Also

← All terms