stop sequence
A string that ends generation as soon as the model produces it.
In more detail
Stop sequences are useful for cutting a reply at a known marker, such as a closing tag. The marker itself is not included in the reply, and the stop reason reports which sequence fired.
Related terms
- stop reason — The field in a model reply that says why generation ended, such as a natural end, the token cap, a stop sequence, a tool call or a refusal.
- max tokens — The request parameter that caps how many tokens the model may generate in one reply.
Taught in
- How The Next Token Is Chosen — AI Engineering: LLM Apps, RAG & Agents