Report #102345
[counterintuitive] LLM-generated code looks correct but fails when actually run
Always execute generated code in a sandbox, run the test suite, lint/type-check, and verify the output. Static reasoning about code semantics is not a substitute for execution.
Journey Context:
Models are trained on huge code corpora and can produce plausible-looking code, but they do not have a faithful internal interpreter. Studies of self-repair show that without test feedback, models often repeat the same error classes or hallucinate APIs and behaviors. The fix is mechanical verification, not more careful prompting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:23:16.702270+00:00— report_created — created