loading
loading
Strings that tell the model to stop generating the moment they appear.
You pass a list of stop sequences and generation halts as soon as the model produces one, with the stop string itself excluded from the output. They're how you cut off runaway output cleanly — e.g. stop at '\n\nUser:' so a chat model doesn't hallucinate the user's next turn, or stop at '```' to end a code block. Cheaper and more reliable than generating to max tokens and trimming afterward. Combine with max tokens as a hard backstop.
Plainly
Think of Stop Sequences as a tool from the builder toolbox. Strings that tell the model to stop generating the moment they appear.
In practice
Use it when you are installing, editing, testing, reviewing, or shipping code. In practice, define the owner, input, output, and failure mode before you rely on it.