Improving Large Language Models for Code through Runtime Program-State Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Large language models receive limited explicit training in reasoning about runtime program states. We study whether training models to reason about runtime program states improves downstream software-engineering capabilities. We introduce two complementary program-state reasoning tasks. Buggy input-output reasoning requires a model to generate a concrete input that exposes a behavioral difference between a buggy program and a hidden correct implementation and to predict the resulting execution behavior. Precondition-postcondition reasoning requires an agent to symbolically characterize a bug-triggering precondition, predict the expected postcondition, explain their causal connection, and instantiate this reasoning as an executable regression test. By incorporating these two tasks into a staged post-training pipeline, we develop Comet-9B, a 9B language model based on Qwen3.5-9B Base. We evaluate the resulting checkpoints on repository-level patch generation, regression-test generation, and security PoC generation. Adding both program-state reasoning tasks to supervised fine-tuning (SFT) on issue resolution improves success rates by 7.25 percentage points on SWE-bench Pro and 9.70 points on SWT-Bench Verified. Sequential reinforcement learning on the two tasks yields further gains of 7.25, 26.79, and 4.67 percentage points on SWE-bench Pro, SWT-Bench Verified, and CyberGym, respectively. Despite having only 9B parameters, Comet-9B achieves a score comparable to the reported GPT-5.2 result on SWE-bench Pro and matches the reported success rate of a GPT-4o-based agent on SWT-Bench Verified.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 23 of its 36 references that are in the map. First posted on arXiv 28 Sep 2026.
Builds on
23 of 36 references.
Closest ancestors · 9
Same direction, newest first
- 2026Enhancing the Code Reasoning Capabilities of LLMs via Consistency-based Reinforcement Learning18 May
- 2026ExecVerify: White-Box RL with Verifiable Stepwise Rewards for Code Execution Reasoning11 Mar
- 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models24 Oct
- 2025Code Execution as Grounded Supervision for LLM Reasoning12 Jun
- 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agents9 Apr
- 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction11 Feb
- 2024NExT: Teaching Large Language Models to Reason about Code Execution23 Apr
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar
- 2022Competition-Level Code Generation with AlphaCode8 Feb
Other references · 14
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2025Absolute Zero: Reinforced Self-play Reasoning with Zero Datacited by 344
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 336
- 2025SWE-smith: Scaling Data for Software Engineering Agentscited by 285
- 2025SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?cited by 279
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
- 2023TACO: Topics in Algorithmic COde generation datasetcited by 160
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agentscited by 142
- 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agentscited by 133
- 2025CyberGym: Evaluating AI Agents' Real-World Cybersecurity Capabilities at Scalecited by 78
- 2025Kimi-Dev: Agentless Training as Skill Prior for SWE-Agentscited by 41
- 2025CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignmentcited by 24
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
- 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
- 2026The Limits of Long-Context Reasoning in Automated Bug Fixing
- 2025Do Code Semantics Help? A Comprehensive Study on Execution Trace-Based Information for Code Large Language Models
- 2026The Path Not Taken: Duality in Reasoning about Program Execution
- 2025EquiBench: Benchmarking Large Language Models' Reasoning about Program Semantics via Equivalence Checking
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark