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.

Level: beginnerTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.