ReflexiCoder: Teaching Large Language Models to Self-Reflect on Generated Code and Self-Correct It via Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
While Large Language Models (LLMs) have revolutionized code generation, standard ``System 1'' approaches that generate solutions in a single forward pass often hit a performance ceiling on complex algorithmic tasks. Existing iterative refinement strategies attempt to bridge this gap at inference time, yet they predominantly rely on external oracles, execution feedback, or computationally expensive prompt-response cycles. In this work, we propose ReflexiCoder, a novel reinforcement learning (RL) framework that internalizes the structured reasoning trajectory, encompassing initial generation, bug and optimization aware reflection, and self-correction, directly into the model's weights. Unlike prior methods, ReflexiCoder shifts the paradigm from external-dependent refinement to an intrinsic, fully autonomous self-reflection and self-correction capabilities at inference time. We utilize an RL-only training paradigm with granular reward functions to optimize the entire reflection-correction trajectory, teaching the model how to debug without reliance on ground-truth feedback or execution engines at inference time. Extensive experiments across seven benchmarks demonstrate that our ReflexiCoder-8B establishes a new state-of-the-art (SOTA) among leading open-source models in the 1.5B to 14B range, achieving 94.51% (87.20%) on HumanEval (Plus), 81.80% (78.57%) on MBPP (Plus), 35.00% on BigCodeBench, 52.21% on LiveCodeBench, and 37.34% on CodeForces in a single-attempt setting, rivaling or surpassing proprietary models like GPT-5.1. Notably, our framework is significantly more token-efficient than base models, reducing inference-time compute overhead by approximately 40% through disciplined, efficient reasoning and reflection patterns. The source code and data are available at https://github.com/juyongjiang/ReflexiCoder.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 21 of its 45 references that are in the map. First posted on arXiv 6 Mar 2026.
Builds on
21 of 45 references.
References · 21
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 574
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
- 2025RAGEN: Understanding Self-Evolution in LLM Agents via Multi-Turn Reinforcement Learningcited by 386
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 239
9 more
- 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 152
- 2022Natural Language to Code Translation with Executioncited by 124
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
- 2022Coder Reviewer Reranking for Code Generationcited by 84
- 2024LeDex: Training LLMs to Better Self-Debug and Explain Codecited by 40
- 2020Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesiscited by 39
- 2024LlamaDuo: LLMOps Pipeline for Seamless Migration from Service LLMs to Small-Scale Local LLMscited by 8
- 2025OSVBench: Benchmarking LLMs on Specification Generation Tasks for Operating System Verificationcited by 8
- 2025BigCodeArena: Unveiling More Reliable Human Preferences in Code Generation via Executioncited by 6
Built on by
Citing papers per year: 2026: 7.
7 papers.
- 2026From Chatbot to Digital Colleague: The Paradigm Shift Toward Persistent Autonomous AIcited by 6
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learningcited by 2
- 2026MetaResearcher: Scaling Deep Research via Self-Reflective Reinforcement Learning in Adversarial Virtual Environmentscited by 1
- 2026PYTHALAB-MERA: Validation-Grounded Memory, Retrieval, and Acceptance Control for Frozen-LLM Coding Agentscited by 0
- 2026Training-Free Inference-Time Self-Reflection and Cost-Bounded Early Stopping for Large Language Modelscited by 0
- 2026Construting Reverse Thinking: Developing Large Language Models' Reverse Thingking Abilitycited by 0
- 2026Lifted State Policy Optimization: Internalizing Self-Correction through Transition Geometrycited by 0
- 2026Lifted State Policy Optimization: Internalizing Self-Correction through Transition Geometry14 Oct 2026
- 2026Construting Reverse Thinking: Developing Large Language Models' Reverse Thingking Ability21 Sep 2026
- 2026Training-Free Inference-Time Self-Reflection and Cost-Bounded Early Stopping for Large Language Models19 Aug 2026
- 2026MetaResearcher: Scaling Deep Research via Self-Reflective Reinforcement Learning in Adversarial Virtual Environments18 Jun 2026
- 2026From Chatbot to Digital Colleague: The Paradigm Shift Toward Persistent Autonomous AI12 Jun 2026
- 2026PYTHALAB-MERA: Validation-Grounded Memory, Retrieval, and Acceptance Control for Frozen-LLM Coding Agents8 May 2026
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning22 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2025Reflect, Retry, Reward: Self-Improving LLMs via Reinforcement Learning
- 2025The Path of Self-Evolving Large Language Models: Achieving Data-Efficient Learning via Intrinsic Feedback
- 2026SRPO: Self-Reflective Policy Optimization for Long-Horizon Reasoning
- 2026Reinforcement Inference: Leveraging Uncertainty for Self-Correcting Language Model Reasoning
- 2023Reflexion: Language Agents with Verbal Reinforcement Learning
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
- 2025Post-Training Large Language Models via Reinforcement Learning from Self-Feedback
- 2024Can Large Language Models Invent Algorithms to Improve Themselves?: Algorithm Discovery for Recursive Self-Improvement through Reinforcement Learning