AI engineering glossary · Prompt context engineering
What is stop sequence?
Stop sequence: A string that, when the model generates it, makes generation halt immediately. It prevents rambling, and helps cut output at a known marker such as the end of a section. The stop string itself is usually not returned.
Stop sequence: an example
Setting stop=['\n\nUser:'] makes the model stop before it invents the next user turn.
Related terms
More Prompt context engineering terms
- Structured extraction
- Structured output
- System prompt
- Task decomposition
- Template variable
- Thinking budget
- Token budget
- Token counting
Where you learn it
Stop sequence is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.