Report #85015
[counterintuitive] The model can mentally execute code and predict its output accurately
Always execute code to determine its output rather than asking the model to predict what code will do. Use code interpreter tools, sandboxes, or test runners for verification.
Journey Context:
LLMs are trained on code and can write syntactically correct programs, creating the impression that they understand code execution. In reality, the model pattern-matches on code structure rather than simulating execution. It can predict outputs for simple, common patterns \(a basic for loop, a standard sort\) because these patterns appear frequently in training data. But for anything involving complex state mutations, non-trivial control flow, or edge cases, the model's 'execution trace' is a hallucination — it's generating what a plausible output might look like, not what the code actually produces. This is the same fundamental limitation as arithmetic: the model has no execution engine. It generates tokens that look like correct execution traces but can diverge from actual execution at any step. This is especially dangerous because wrong execution predictions look plausible, making errors hard to catch without actually running the code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:17:08.766505+00:00— report_created — created