Skip to main content

Stop Sequence

A stop sequence is a predefined token, string, or pattern that signals the AI model to immediately stop generating text when encountered in the output. Stop sequences give developers precise control over where generation ends, preventing the model from producing unwanted continuations, extra examples, or rambling text beyond the desired response boundary.

Example

You configure the stop sequence "---" for a Q&A bot. When the model finishes answering a question and generates "---", generation halts immediately instead of continuing with another question-answer pair or filler text. This ensures clean, single-answer responses without manual truncation.

Put this into practice

Build polished, copy-ready prompts in under 60 seconds with SurePrompts.

Try SurePrompts