Back to Developer Roadmap

Stopping Criteria

src/data/roadmaps/ai-agents/content/[email protected]

4.0882 B
Original Source

Stopping Criteria

Stopping criteria tell the language model when to stop writing more text. Without them, the model could keep adding words forever, waste time, or spill past the point we care about. Common rules include a maximum number of tokens, a special end-of-sequence token, or a custom string such as “\n\n”. We can also stop when the answer starts to repeat or reaches a score that means it is off topic. Good stopping rules save cost, speed up replies, and avoid nonsense or unsafe content.

Visit the following resources to learn more: