[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-stop-sequence::en":3,"gloss-cluster-stop-sequence::en":26,"gloss-next-stop-sequence::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"stop-sequence","prompt-eng","Stop Sequence","A stop sequence is a string that ends generation the moment the model produces it. You pass one or more of them with the request; when the decoder emits a matching span it halts, and the stop text itself is normally excluded from the returned completion. It exists because a model has no reliable sense of when a caller considers the answer finished — left alone it may keep going into an explanation, a second example, or an imagined next turn — and because tokens generated after the useful part still cost money and latency. Typical uses are narrow and mechanical. In a classification or extraction call, a newline as the stop sequence guarantees a single-line answer. In a few-shot prompt built from repeated blocks, the block delimiter is the natural stop, since the model's habit of continuing the pattern is exactly what you want to interrupt. In a chat-style completion, the marker that begins a user turn stops the model from writing both halves of the conversation. Two cautions. A stop sequence that can legitimately occur inside the content will truncate a valid answer — a bare newline is a bad stop for anything multi-line, and a closing brace is a bad stop for nested JSON. And because the model was cut off rather than finished, always check the response's finish reason: treating a truncated completion as a complete one is a common source of silently malformed downstream data.","A stop sequence halts generation as soon as the model emits it — how to use one for single-line answers and few-shot blocks, and when it truncates valid output.",null,[11,14,17,20,23],{"slug":12,"name":13},"delimiter","Delimiter",{"slug":15,"name":16},"json-mode","JSON Mode",{"slug":18,"name":19},"output-formatting","Output Formatting",{"slug":21,"name":22},"streaming-generation","Streaming Generation",{"slug":24,"name":25},"structured-output","Structured Output",[27,31,34,37,41,44,47,50,53,54,57,60],{"slug":28,"category":5,"name":29,"updated_at":30},"analogical-prompting","Analogical Prompting","2026-08-24T02:46:37+00:00",{"slug":32,"category":5,"name":33,"updated_at":30},"automatic-prompt-optimization","Automatic Prompt Optimization",{"slug":35,"category":5,"name":36,"updated_at":30},"chain-of-density","Chain of Density (CoD)",{"slug":38,"category":5,"name":39,"updated_at":40},"chain-of-thought-prompting","Chain-of-Thought Prompting","2026-08-24T02:46:36+00:00",{"slug":42,"category":5,"name":43,"updated_at":30},"chain-of-verification","Chain-of-Verification",{"slug":45,"category":5,"name":46,"updated_at":40},"chunking","Chunking",{"slug":48,"category":5,"name":49,"updated_at":40},"constrained-decoding","Constrained Decoding",{"slug":51,"category":5,"name":52,"updated_at":40},"context-stuffing","Context Stuffing",{"slug":12,"category":5,"name":13,"updated_at":40},{"slug":55,"category":5,"name":56,"updated_at":30},"directional-stimulus-prompting","Directional Stimulus Prompting",{"slug":58,"category":5,"name":59,"updated_at":30},"emotion-prompting","Emotion Prompting",{"slug":61,"category":5,"name":62,"updated_at":40},"few-shot-prompting","Few-Shot Prompting"]