mlsanityData to 14 Oct 2026

CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning

arXiv 2507.17548 ↗First posted 23 Jul 2025cs.SEcited by 4

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

Code reasoning is a fundamental capability for large language models (LLMs) in the code domain. It involves understanding and predicting a program's execution behavior, such as determining the output for a given input or whether a specific statement will be executed. This capability is essential for downstream tasks like debugging, code generation, and program repair. Prior approaches mainly rely on supervised fine-tuning to improve performance in code reasoning tasks. However, they often show limited gains and fail to generalize across diverse scenarios. We argue this is due to two core issues: the low quality of training data and the limitations of supervised fine-tuning, which struggles to teach general reasoning skills. To address these challenges, we propose CodeReasoner, a framework that spans both dataset construction and a two-stage training process. First, we introduce a method to construct datasets that focus on the core execution logic of Python programs. Next, we apply instruction tuning to inject execution-specific knowledge distilled from a powerful teacher model. We then enhance reasoning and generalization through GRPO reinforcement learning on top of the fine-tuned model. Experiments on three widely-used code reasoning benchmarks show that CodeReasoner improves performance by 27.1% to 40.2% over prior methods using a 7B model. Notably, the 7B model matches GPT-4o on key tasks like input/output and coverage prediction. When scaled to 14B, CodeReasoner outperforms GPT-4o across all benchmarks. Ablation studies confirm the effectiveness of each training stage and highlight the importance of reasoning chains.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 39 of its 57 references that are in the map. First posted on arXiv 23 Jul 2025.

Builds on

39 of 57 references.

Closest ancestors · 9

Same direction, newest first

  1. 2025CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoning31 May
  2. 2025Rethinking Repetition Problems of LLMs in Code Generation15 May
  3. 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference22 Feb
  4. 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction11 Feb
  5. 2024Qwen2.5-Coder Technical Report18 Sep
  6. 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution23 Aug
  7. 2024NExT: Teaching Large Language Models to Reason about Code Execution23 Apr
  8. 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?25 Mar
  9. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar

Other references · 30

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  5. 2024Qwen2.5 Technical Reportcited by 4,942
  6. 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 2,057
  7. 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,464
  8. 2025Understanding R1-Zero-Like Training: A Critical Perspectivecited by 1,345
  9. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  10. 2025Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?cited by 982
  11. 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 762
  12. 2023Instruction Tuning with GPT-4cited by 686
18 more
  1. 2025SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-trainingcited by 672
  2. 2023Instruction Tuning for Large Language Models: A Surveycited by 623
  3. 2025SimpleRL-Zoo: Investigating and Taming Zero Reinforcement Learning for Open Base Models in the Wildcited by 511
  4. 2025Cognitive Behaviors that Enable Self-Improving Reasoners, or, Four Habits of Highly Effective STaRscited by 377
  5. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  6. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
  7. 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
  8. 2025Logic-RL: Unleashing LLM Reasoning with Rule-Based Reinforcement Learningcited by 262
  9. 2023Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMscited by 178
  10. 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 127
  11. 2025SRPO: A Cross-Domain Implementation of Large-Scale Reinforcement Learning on LLMcited by 68
  12. 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
  13. 2022Two-stage LLM Fine-tuning with Less Specialization and More Generalizationcited by 41
  14. 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 40
  15. 2023Code Execution with Pre-trained Language Modelscited by 34
  16. 2025Towards Understanding Distilled Reasoning Models: A Representational Approachcited by 26
  17. 2025Demystifying Domain-adaptive Post-training for Financial LLMscited by 24
  18. 2025Selective Self-to-Supervised Fine-Tuning for Generalization in Large Language Modelscited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 3.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning
  2. 2025OpenCodeReasoning: Advancing Data Distillation for Competitive Coding
  3. 2025From Reasoning to Code: GRPO Optimization for Underrepresented Languages
  4. 2025R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement Learning
  5. 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
  6. 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models
  7. 2026Exploring Extrinsic and Intrinsic Properties for Effective Reasoning with Code Interpreter
  8. 2025Code-enabled language models can outperform reasoning models on diverse tasks