Stop Sequence — AI Glossary

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.