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|>,
In Practice
- The model outputs token by token.
- As soon as a stop token appears — generation is terminated.
- In the API, there are usually additional stop sequences (
stop) that the application checks.