Report #71880
[counterintuitive] The model should be able to trace through code execution and predict exact runtime values mentally
Never rely on the model to mentally simulate code execution for anything beyond trivial cases. Always execute code in a sandbox and feed the actual runtime output back to the model. Use the model for writing and understanding code, not running it.
Journey Context:
Developers expect that since the model can write code, it can also trace through it — predicting variable values, loop iterations, and function return values step by step. This conflation is dangerous. Code writing is pattern synthesis \(matching against similar code seen in training\); code tracing is sequential state simulation \(maintaining and updating a precise memory model at each step\). The latter requires exactly the kind of reliable state tracking that autoregressive transformers lack. The model approximates execution traces by pattern-matching against similar traces in training data, which works for common idioms but fails on novel logic, edge cases, or any situation where the exact state matters. A single off-by-one in the model's mental state propagates and invalidates all subsequent predictions. This is why models can write a correct sorting algorithm but fail to predict what it returns on a specific input — generation leverages learned patterns; execution requires faithful simulation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:13:52.433160+00:00— report_created — created