mlsanityData to 14 Oct 2026

Enhancing the Code Reasoning Capabilities of LLMs via Consistency-based Reinforcement Learning

arXiv 2605.17958 ↗First posted 18 May 2026cs.LG cs.PLcited by 1

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

Abstract (arXiv)

Code reasoning refers to the task of predicting the output of a program given its source code and specific inputs. It can measure the reasoning capability of large language models (LLMs) and also benefit downstream tasks such as code generation and mathematical reasoning. Existing work has verified the effectiveness of reinforcement learning on the task. However, these methods design rewards solely based on final outputs or coarse-grained signals, and neglect the inherent consistency of the stepwise reasoning process in the task. Therefore, these methods often result in sparse reward or reward hacking, which limits the full play of enhanced learning capabilities. To alleviate these issues, we propose CodeThinker, a consistency-driven reinforcement learning framework for code reasoning. Specifically, CodeThinker has three key components: (1) a stepwise reasoning-aware model training module, which utilizes a consistency tracing paradigm as a template to synthesize training data that captures the stepwise reasoning process; (2) a dynamic beam sampling strategy, which aims to improve the quality of sampled outputs under a fixed sampling budget; and (3) a consistency reward mechanism that can effectively alleviate reward hacking. Experiments on three popular benchmarks show that CodeThinker achieves state-of-the-art performance across multiple LLMs. For instance, it outperforms the strongest baseline by 4.3% in accuracy when deployed on Qwen2.5-Coder-7B-Instruct. We also validate the effectiveness of CodeThinker on downstream tasks. Results show that, without additional training, CodeThinker obtains average accuracy gains of 5.33 and 3.11 percentage points on mathematical reasoning and code reasoning tasks covering 17 programming languages, respectively.

Key facts. Cited by 1 paper 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 37 of its 41 references that are in the map. First posted on arXiv 18 May 2026.

Builds on

37 of 41 references.

Closest ancestors · 9

Same direction, newest first

  1. 2026ExecVerify: White-Box RL with Verifiable Stepwise Rewards for Code Execution Reasoning11 Mar
  2. 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning23 Jul
  3. 2025LeetCodeDataset: A Temporal Dataset for Robust Evaluation and Efficient Training of Code LLMs20 Apr
  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. 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning3 Jun
  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 · 28

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  6. 2025Qwen3 Technical Reportcited by 8,820
  7. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  8. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  9. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
  10. 2023Let's Verify Step by Stepcited by 3,789
  11. 2021Program Synthesis with Large Language Modelscited by 3,637
  12. 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,810
16 more
  1. 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,464
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  3. 2025Understanding R1-Zero-Like Training: A Critical Perspectivecited by 1,345
  4. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  5. 2022PAL: Program-aided Language Modelscited by 652
  6. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  7. 2024Alignment faking in large language modelscited by 360
  8. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
  9. 2024Sycophancy to Subterfuge: Investigating Reward-Tampering in Large Language Modelscited by 178
  10. 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 140
  11. 2025Natural Emergent Misalignment from Reward Hacking in Production RLcited by 136
  12. 2025CWM: An Open-Weights LLM for Research on Code Generation with World Modelscited by 93
  13. 2025School of Reward Hacks: Hacking harmless tasks generalizes to misaligned behavior in LLMscited by 66
  14. 2024CATCODER: Repository-Level Code Generation with Relevant Code and Type Contextcited by 8
  15. 2026From Rebound to Remedy: Understanding and Mitigating Reward Hacking via Representation Engineeringcited by 7
  16. 2025RepoScope: Leveraging Call Chain-Aware Multi-View Context for Repository-Level Code Generationcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026When Do Intrinsic Rewards Work for Code Reasoning? A Comprehensive Study
  2. 2025Consistent Paths Lead to Truth: Self-Rewarding Reinforcement Learning for LLM Reasoning
  3. 2026CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models
  4. 2025R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement Learning
  5. 2026The Imitation Game: When LLMs Learn to Reason Like Programs via Code-Centric Reasoning Data Synthesis
  6. 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
  7. 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
  8. 2025Towards Effective Code-Integrated Reasoning