SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Execution

Woojin Lee, Jin-Xia Huang


Abstract
State-of-the-art code generation frameworks rely on mental simulation, where LLMs internally trace execution to verify correctness. We expose a fundamental limitation: the Mental-Reality Gap—where models hallucinate execution traces and confidently validate buggy code. This gap manifests along two orthogonal dimensions: the Specification Gap (overlooking edge cases during planning) and the Verification Gap (hallucinating correct behavior for flawed code). We propose SolidCoder with a simple principle: don’t imagine—execute. The S.O.L.I.D. architecture addresses both dimensions by forcing edge-case awareness before algorithm design and replacing imagined traces with sandboxed execution using property-based oracles. With GPT-4o, SolidCoder achieves state-of-the-art pass@1 performance: 95.7% on HumanEval (+0.6%p), 77.0% on CodeContests (+4.3%p), and 26.7% on APPS (+3.4%p). Ablation reveals that edge-case awareness provides the largest individual gain, while execution grounding catches categorically different errors that specification improvements cannot address. These gains generalize to RL post-trained models, validating that bridging both gap dimensions is essential for robust code synthesis. We release our code and framework to facilitate future research.
Anthology ID:
2026.findings-acl.361
Volume:
Findings of the Association for Computational Linguistics: ACL 2026
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
7294–7316
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.361/
DOI:
Bibkey:
Cite (ACL):
Woojin Lee and Jin-Xia Huang. 2026. SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Execution. In Findings of the Association for Computational Linguistics: ACL 2026, pages 7294–7316, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Execution (Lee & Huang, Findings 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.361.pdf
Checklist:
 2026.findings-acl.361.checklist.pdf