Why `
This article explains why entering markers such as `<think` can cause an LLM in reasoning mode to generate seemingly unrelated chain-of-thought text. It examines the roles of chain-of-thought format training, tokenizer behavior, and attention, clarifies why this is not data leakage, and outlines engineering practices such as input filtering, role isolation, and output validation.
Why <think Inputs Trigger Unexpected LLM Outputs: Chain-of-Thought Formatting and Tokenization
1. Phenomenon: A Misleading Experiment
Recently, developers have observed the following behavior: in the “deep thinking” mode of an LLM application, if a user enters a string such as <think, the model may take it upon itself to generate a long, seemingly complete chain-of-thought passage. The questions and reasoning in that passage may have nothing to do with the user’s actual input, as if it were a fragment from an unfamiliar conversation. Similar variants such as <think> (closed form), <<think, and < think (with a space) can also trigger the behavior, while variants such as <thinkx, <think1, and <THINK (uppercase) trigger it with noticeably lower probability.
This phenomenon easily invites speculation: Has the model leaked another user’s conversation history? Has a system instruction been exposed by accident? Before drawing conclusions, one point needs to be clarified: without any evidence, such speculation is a typical “human hallucination”—an observer sees a black box produce some output for some input and fills in an eye-catching explanation. In fact, there is a technical explanation for this phenomenon that is more consistent with how LLMs work.
2. Cause 1: Role-Playing Inertia Left by Chain-of-Thought Training
2.1 Chain-of-thought is essentially a format convention
Current mainstream reasoning models generally use a chain-of-thought (CoT) mechanism: system instructions require the model to output its reasoning process between a specific pair of markers (for example, <think> and </think>), and then output the final answer between another pair of markers (for example, <answer> and </answer>). This mechanism is essentially a format convention reinforced during training, not genuine “internal thinking.”
During training, the model repeatedly learns through supervised fine-tuning and reinforcement learning that when a thinking-start marker appears in the context, it should next output a structured reasoning text. Early model versions without sufficient supervised fine-tuning often show endless repetition, mixed languages, and poor readability, so engineering practice usually starts with a round of conventional supervised fine-tuning to teach the model to follow this format stably.
2.2 User input is “mistaken” for a system instruction fragment
The key issue emerges here: when a user directly enters a marker such as <think, the model’s attention mechanism does not strictly distinguish whether “this text comes from the system prompt” or “comes from the user.” From the model’s perspective, a trigger signal that was repeatedly reinforced during training has appeared in the context, so it immediately enters a “role-playing” state and begins assembling a chain-of-thought text.
This explains why the generated content appears to “come from another conversation”—the model is actually sampling the most typical reasoning corpus from the training distribution and filling in a fictional question and corresponding reasoning process. This content is not some real user’s historical data; it is text generated on the fly by the model based on probability distribution.
3. Cause 2: Tokenizer and Character-Level Fallback Behavior
One noteworthy detail in the experiment is that case-sensitive variants such as <THINK do not trigger the behavior, perturbed variants such as <thinkx have a low and unstable trigger rate, while < think with a space can trigger it. This suggests that the phenomenon is closely related to the tokenization process:
- In the training corpus,
<thinkis very likely an independent high-frequency token or a stable token sequence, and the model’s “association” with it is strongest; - Uppercase or character-inserted variants are split by the tokenizer into different token sequences, thus deviating from the training distribution and failing to activate the same behavior pattern;
- When generation stops midway and then continues, the model falls back to its most basic function—predicting the next token. At this point it has a relatively high probability of completing the incomplete
<thinkas<think>, and then continues generating chain-of-thought content.
Another piece of evidence: when the user enters a combination of “a letter + <think,” the chain-of-thought sometimes completely ignores the <think marker and answers the preceding letter as if it were the real question; when Chinese words are used instead, the behavior is unstable. This indicates that whether the behavior is triggered depends on how close the entire input sequence is to the training pattern in token space, rather than on simple string matching.
4. Clarifying the Misconception: Why This Is Not “Data Leakage”
Based on the analysis above, several conclusions can be stated clearly:
- Chain-of-thought is not a real thinking process, but a text sequence assembled by the model according to a format; its content can be noticeably inconsistent with the final answer;
- The “unfamiliar question” that is assembled comes from sampling the training distribution, not from any real user’s conversation records—there is no evidence that the model calls other conversation data here;
- This behavior is not unique to one platform; similar behavior can be observed in multiple products that offer comparable “deep thinking” modes, indicating that it is a common issue of this technical route;
- For the relevant technical teams, this is a known prompt injection boundary issue rather than a security incident, so claims that “engineers will not be able to sleep” are overinterpretation.
5. Engineering Practice: How to Respond and Avoid It
For developers building applications on top of LLMs, the real lesson of this phenomenon lies in input-side protection design:
5.1 Input filtering and escaping
Preprocess user input to identify and escape special markers that may conflict with the system prompt:
RESERVED_TOKENS = ["<think>", "</think>", "<answer>", "</answer>", "<think"]def sanitize_input(text: str) -> str:for token in RESERVED_TOKENS:# Replace reserved markers with harmless text descriptionstext = text.replace(token, token.replace("<", "<").replace(">", ">"))return text
5.2 Structured input and role isolation
At the API call layer, always pass user content through structured message arrays instead of directly concatenating user input into the system prompt template, thereby reducing the probability of marker confusion at the mechanism level.
5.3 Output-side validation
Validate the format of model output: check whether the chain-of-thought contains topic drift unrelated to the current session, and check whether the final answer is fully wrapped in the expected marker pairs. Once an anomaly is found, a retry or fallback strategy can be triggered.
5.4 User-facing guidance
If the application exposes reasoning mode to users, it is advisable to clearly prompt users at the interaction layer to avoid entering angle-bracket XML-like markers, reducing the chance of accidental triggers.
6. Conclusion
The “self-directed” response of LLMs to markers such as <think is the result of chain-of-thought format training, tokenizer behavior, and attention mechanisms working together. In essence, the model is faithfully executing the pattern matching it was trained to perform. It is neither data leakage nor system instruction exposure, and it does not involve cross-session information calls. Understanding this allows developers to move away from sensational misreading and focus on what is truly valuable: building robust engineering defenses in input filtering, role isolation, and output validation so that model behavior remains within a controllable range.
