Chain-of-Thought Concatenation Anomalies in LLMs: Why Unclosed `

    This article explains a reproducible chain-of-thought anomaly in large language models: entering an unclosed `<think` marker (or variants such as `<thinkx`, `< think`, `<<think`) in deep-thinking mode with web retrieval disabled can produce reasoning text unrelated to the current session. It breaks down three root causes—tokenization and chunk boundaries, conflicts between system instructions and role-play, and the probabilistic nature of chain-of-thought generation—and shows why claims of cross-session data leakage do not hold. It also provides a controlled experiment design and practical engineering mitigations, including input normalization, structured output, context isolation, observability, and fallback handling.

    1. The Symptom: A “Ghost Event” Caused by an Unclosed Marker

    Some developers debugging conversational AI applications have noticed the following: with “deep thinking” mode enabled and web retrieval turned off, entering only an unclosed <think marker (or variants such as <thinkx, < think, <<think) causes the model to return chain-of-thought content that has no relation to the current session. It reads like someone else’s prior conversation. This has led to speculation that the platform is leaking other users’ data.

    That conclusion does not hold up logically. Proving data cross-use would require at least reproducible, stable output; strong consistency with another session; and corroborating logs on the vendor side. In practice, the observed output is random and jumps between contexts, and changing the case or adding a single space produces a completely different result. This indicates that the output is a product of the local decoding process, not a cross-session data read.

    A more reasonable explanation is that this is over-attribution by humans facing black-box output—a typical case of “human hallucination.” The same phenomenon can be reproduced across conversational products from multiple platforms, which suggests it is a common characteristic of the current LLM inference paradigm rather than a defect unique to one vendor.

    2. Root Cause 1: Tokenization and Chunk Boundaries Decide the Fate of a “Half Marker”

    A large language model does not read input character by character; it first splits text into tokens. The vocabulary typically contains complete <think> and </think> as standalone tokens, but <think (missing the closing angle bracket) is often not in the vocabulary and gets split into two or more tokens, such as < and think.

    This has two direct consequences:

    1. The input lands in an awkward position on a token boundary. The model sees a broken structure and cannot match the complete control marker it saw during training.
    2. Case sensitivity matters. Variants like <THINK and <thinK are split into entirely different token sequences and therefore do not trigger the anomaly. In contrast, < think and <<think still contain recognizable < and think fragments after tokenization, making them more likely to trigger it.

    The following pseudocode illustrates the difference in tokenization:

    1. # Illustration: how different spellings match against the vocabulary
    2. samples = ["<think", "<think>", "<THINK", "< think", "<<think"]
    3. for s in samples:
    4. tokens = tokenizer.encode(s) # actual behavior depends on the specific vocabulary
    5. print(s, "->", tokens, "full marker matched:", "<think>" in tokens)

    Engineering takeaway: any pipeline that relies on parsing control markers should normalize input on the server side rather than assuming user input is always a valid marker.

    3. Root Cause 2: The Boundary Between System Instructions and Role-Play Is Broken

    In deep-thinking mode, the system instruction tells the model to “play the role of an entity that is thinking and output the thinking process.” During training, a fixed format is defined: the thinking process goes between <think> and </think>, and the final answer goes between <answer> and </answer>.

    When user input is mistakenly treated as part of the system instruction, the model immediately enters role-play mode and starts “completing the thinking process.” Because the opening marker is broken, it has no clear starting point and can only continue based on probability, piecing together fragments left over from the preceding context or high-frequency fragments from the training corpus. This explains why the output looks like “someone else’s conversation”—it is a statistically plausible continuation, not a real memory.

    It is worth noting that an early pure reinforcement learning route that removed supervised fine-tuning produced endless repetition, poor readability, and mixed languages. Later commercial models generally started from traditional supervised fine-tuning and then added reinforcement learning. This means models rely more heavily on format templates, and once the format is broken, behavior becomes more unstable.

    4. Root Cause 3: Chain-of-Thought Is Probabilistic Concatenation, Not Real Thinking

    It must be emphasized that chain-of-thought is not a recording of the model’s internal thinking process; it is text predicted token by token. Its content can clearly differ from the final answer and can even contradict it. Therefore, treating chain-of-thought as “evidence” for inferring platform behavior is methodologically invalid.

    Experimental observations support this:

    • After entering <think, stopping generation midway and intervening causes the model to fall back to its most basic capability—predicting the next character—and it may “fill in” <think into a complete <think>.
    • Switching to another single letter causes the chain-of-thought to ignore the input; switching to Chinese words sometimes ignores it and sometimes produces a new action.
    • <thinkx triggers anomalous output significantly less often than <think, indicating that trigger probability correlates with token completeness.

    5. A Reproducible Experiment Design

    Developers are advised to run the following controlled experiment in their own applications, using data instead of guesswork:

    Variable Values Observation metric
    Marker form <think / <think> / <THINK / < think / <<think Anomalous output trigger rate
    Mode Deep thinking on/off, web retrieval on/off Whether chain-of-thought is generated
    Intervention timing Before generation, stop during generation, append after generation Changes in concatenated content
    Input language Single letter, Chinese word, English short phrase Whether it is ignored

    Sample at least dozens of times per group and measure the trigger rate rather than relying on a single result. A single sample cannot distinguish “data leakage” from “random concatenation.”

    6. Engineering Mitigations

    1. Input preprocessing: on the server side, complete or escape broken markers so that half a control symbol never reaches the model.
    2. Structured output: use the platform’s JSON mode or function calling capability to constrain the format and reduce free-text parsing.
    3. Context isolation: strictly validate session identifiers in multi-turn conversations, and add content safety filtering for sensitive scenarios.
    4. Observability: use logging services and monitoring alerts to record requests, token usage, and anomalous output for traceability.
    5. Fallback strategy: use chain-of-thought only for internal debugging, do not display it directly to end users, and treat structured fields as the source of truth for the final answer.
    6. Elastic capacity: in high-concurrency scenarios, use container platforms and message queues for asynchronous decoupling so that anomalous output does not escalate into an incident.

    7. Conclusion

    The “suspected other-person conversation” triggered by an unclosed marker is essentially the combined result of tokenization boundaries, system instruction conflicts, and probabilistic prediction—a common manifestation of the current LLM inference paradigm. For developers, the right response is not to speculate about platform internals, but to normalize input, structure output, and make the pipeline observable. With these three points in place, this kind of “ghost phenomenon” degrades into an ordinary defect that can be located, reproduced, and fixed.