StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning
On the map: LLM alignment / RLHF / preference optimisation → Process reward models for reasoning
Abstract (arXiv)
Existing code reasoning methods primarily supervise final code outputs, ignoring intermediate states, often leading to reward hacking where correct answers are obtained through inconsistent reasoning. We propose StepCodeReasoner, a framework that introduces explicit intermediate execution-state supervision. By automatically inserting structured print-based execution-trace anchors into code, the model is trained to predict runtime states at each step, transforming code reasoning into a verifiable, stepwise execution modeling problem. Building on this execution-aware method, we introduce Bi-Level GRPO, a reinforcement learning algorithm for structured credit assignment at two levels: inter-trajectory, comparing alternative execution paths, and intra-trajectory, rewarding intermediate accuracy based on its impact on downstream correctness. Extensive experiments demonstrate that StepCodeReasoner achieves SOTA performance in code reasoning. In particular, our 7B model achieves 91.1% on CRUXEval and 86.5% on LiveCodeBench, outperforming the CodeReasoner-7B baseline (86.0% and 77.7%) and GPT-4o (85.6% and 75.1%). Furthermore, on the execution-trace benchmark REval, our model scores 82.9%, outperforming baseline CodeReasoner-7B (72.3%), its 14B counterpart (81.1%), and GPT-4o (77.3%). Additionally, our approach also improves code generation performance, demonstrating that explicit execution modeling enhances both code reasoning and code generation.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Process reward models for reasoning, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 24 of its 30 references that are in the map. First posted on arXiv 12 May 2026.
Builds on
24 of 30 references.
References · 24
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2025Qwen3 Technical Reportcited by 8,195
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,678
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2025Group Sequence Policy Optimizationcited by 788
- 2025Absolute Zero: Reinforced Self-play Reasoning with Zero Datacited by 323
- 2025R1-VL: Learning to Reason with Multimodal Large Language Models via Step-wise Group Relative Policy Optimizationcited by 296
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
12 more
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 246
- 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 123
- 2024NExT: Teaching Large Language Models to Reason about Code Executioncited by 60
- 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Predictioncited by 54
- 2021Neural Program Repair with Execution-based Backpropagationcited by 50
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?cited by 44
- 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
- 2023Code Execution with Pre-trained Language Modelscited by 33
- 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Executioncited by 31
- 2023TRACED: Execution-aware Pre-training for Source Codecited by 27
- 2024IRCoCo: Immediate Rewards-Guided Deep Reinforcement Learning for Code Completioncited by 13
- 2025CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoningcited by 12
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning
- 2026Enhancing the Code Reasoning Capabilities of LLMs via Consistency-based Reinforcement Learning
- 2026ExecVerify: White-Box RL with Verifiable Stepwise Rewards for Code Execution Reasoning
- 2026TIPCODER: Reinforcement Learning Boosted Test-time Instruction Proposer for Code Generation
- 2025CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback
- 2023Execution-based Code Generation using Deep Reinforcement Learning
- 2026Goedel-Code-Prover: Hierarchical Proof Search for Open State-of-the-Art Code Verification