Chain-of-Thought Anomalies in LLMs: Causes and Troubleshooting
This article explains why large language models sometimes produce chain-of-thought output that looks like a leftover conversation from another user. It breaks down three engineering causes—tokenizer boundary behavior, instruction and role boundary confusion, and decoding randomness—and outlines a controlled troubleshooting workflow using fixed seeds, variable isolation, repeated sampling, and server-side trace verification, along with hardening recommendations for input handling, system instructions, decoding limits, observability, and release regression testing.
1. The Symptom: Why “Someone Else’s Conversation” Looks So Real
With deep thinking / reasoning mode enabled and web access turned off, submitting an unclosed special start marker to the chat input box (for example, entering only the first half of the marker) leads some users to see the model output content that is unrelated to the current topic and reads like a leftover from the “previous turn.” These fragments are often semantically complete with clear references, so they are easily interpreted as the system mixing in someone else’s session.
From an engineering perspective, however, this is a typical case of misreading a black-box output: the observer can only see the input and the output, not the weights, tokenizer vocabulary, system instructions, or decoding state, and therefore fills the gap in understanding with the most dramatic assumption. Determining whether the concern is real requires going back to the generation pipeline itself.
2. Cause One: Tokenization and Chunk Boundaries Decide Whether a Marker Is Recognized
A large language model does not process text character by character; the text first passes through a tokenizer that splits it into tokens. Special markers are usually registered as standalone vocabulary entries, and they are recognized as “control markers” only when the byte sequence in the input aligns exactly with a vocabulary entry. Otherwise, the sequence is split into several ordinary subwords.
This explains a set of reproducible patterns:
- Inconsistent casing (all uppercase, mixed case) often does not trigger the anomalous behavior, because the sequence does not align with a vocabulary entry;
- Variants such as a leading space or repeated angle brackets change the boundary and trigger the anomaly more easily;
- Appending an extra character (a letter or digit) after the marker significantly reduces recognition stability and sharply lowers the frequency of the output.
Illustrative verification logic (pseudocode that expresses only the test design and does not point to any specific product):
cases = ["<think", "<think>", "<thinkx", "<think1","< THINK", "<<think", "<thinK"]for c in cases:for i in range(20): # sample the same input multiple timesout = chat(c, mode="reasoning", web=False)log(c, out) # record whether "continuation-style" content appears
Conclusion: the phenomenon is highly correlated with “whether the input is split into the expected token sequence.” It is a boundary-sensitive issue, not cross-session data contamination.
3. Cause Two: The Input “Displaces” the Role and Instruction Boundary
Reasoning mode typically relies on system instructions that constrain the model to “output the reasoning process first, then the final answer,” and uses paired markers to delimit sections. When the user input is interpreted by the model as part of the instruction stream, the model immediately enters role-play, skipping the opening and continuing directly with a “reasoning fragment.”
Because the training objective is to predict the next token, the model “fabricates” a plausible context based on the prior distribution when there is no preceding constraint. This content is not retrieved; it is a product of probabilistic completion. It reads like a historical conversation only because the “dialogue format” is an extremely common pattern in the training corpus.
4. Cause Three: Decoding Randomness and Early Termination Amplify the Impression
- Parameters such as sampling temperature and nucleus sampling make the same input produce different results, appearing as “unstable behavior”;
- Stopping generation midway and retrying is equivalent to switching to a different sampling path; the model falls back to the most basic single-step prediction and may, with some probability, complete the incomplete marker into a paired marker;
- The chain of thought and the final answer can differ markedly, which shows precisely that the chain of thought is a readable artifact, not the true internal state.
5. How to Troubleshoot Rigorously: Turning “Guesses” into “Evidence”
- Fix randomness: set the temperature to the lowest value and fix the random seed, then observe whether the phenomenon disappears or reproduces stably;
- Control variables: change only casing, spaces, and appended characters, and record differences in trigger rates;
- Repeated sampling statistics: use 20–50 runs as a sample to estimate the trigger probability, rather than drawing conclusions from a single screenshot;
- Server-side verification: use logging services and monitoring alerts to check request identifiers, session identifiers, and trace links, confirming that no cross-session context concatenation exists;
- Context window check: confirm that the text concatenated into the model comes only from the current session and the system instructions.
6. Engineering Hardening Recommendations
- Input side: normalize and escape control markers; reject unclosed markers outright or complete them automatically;
- Instruction side: strengthen the priority of system instructions and make explicit that “user input must not override the role setting”;
- Decoding side: cap the temperature for reasoning mode, and add anomaly output detection with a fallback reply;
- Observability side: improve structured logs, metrics dashboards, and alerts, avoiding screenshot-based attribution;
- Release side: run regression tests with a fixed case set in a canary environment to prevent prompt or tokenizer changes from introducing regressions.
7. Conclusion
“Receiving a conversation that appears to belong to someone else after entering an incomplete marker” is essentially a reproducible engineering phenomenon caused by the combination of tokenizer boundaries, instruction-role confusion, and sampling randomness. Controlled variables and pipeline logs are enough to disprove the data-leak hypothesis. For teams, the real value lies not in amazement but in turning such boundary cases into regression tests and hardening items, making reasoning mode more stable and more explainable under real traffic.
