Thursday, December 3, 2026 | London 11°C · Drizzle
DailyGlimpse

AI

The Hidden Signal That Makes AI Stop Talking: How LLMs Know When to End a Response

sourcecode 1 min read

Ever wonder how a large language model (LLM) like ChatGPT or Claude knows when to stop generating text? The answer lies in an invisible marker called the EOS token (end-of-sequence) or stop token.

When an AI generates a response, it produces one word at a time. It doesn't naturally know when to stop unless it outputs this special token. The application you're using reads the EOS token and immediately halts the output—you never see it.

The crucial twist: the model hasn't been explicitly programmed to recognize completion. Instead, it learns from training data when to produce the stop token, dropping it when an answer feels complete. When a glitch prevents the token from appearing, the AI can continue generating text indefinitely.

Every single response you've ever read from ChatGPT, Claude, Gemini, or any LLM ends with this invisible marker. It's the silent signal that tells the AI: "That's enough."

React