ChatPaper.aiChatPaper

ReflexiCoder: 大規模言語モデルが生成したコードを自己内省し、強化学習を用いて自己修正する手法

ReflexiCoder: Teaching Large Language Models to Self-Reflect on Generated Code and Self-Correct It via Reinforcement Learning

March 6, 2026
著者: Juyong Jiang, Jiasi Shen, Sunghun Kim, Kang Min Yoo, Jeonghoon Kim, Sungju Kim
cs.AI

要旨

大規模言語モデル(LLM)はコード生成に革命をもたらしたが、複雑なアルゴリズム課題に直面した際、単一のフォワードパスで解答を生成する標準的な「システム1」アプローチは、しばしば性能限界に達する。既存の反復改良戦略は推論時にこの格差を埋めようとするが、外部オラクルや実行フィードバック、計算コストの高いプロンプト-応答サイクルに依存するものが主流である。本研究では、構造化された推論軌道(初期生成、バグ・最適化を意識した内省、自己修正を含む)をモデルの重みに直接内在化する、新しい強化学習(RL)フレームワークであるReflexiCoderを提案する。従来手法と異なり、ReflexiCoderは外部依存の改良から、推論時における本質的かつ完全自律的な自己内省・自己修正能力へのパラダイム転換を図る。我々はRL-zeroトレーニングパラダイムと詳細な報酬関数を活用し、内省-修正軌道全体を最適化することで、推論時に正解フィードバックや実行エンジンに依存せずにデバッグする方法をモデルに学習させる。7つのベンチマークによる大規模実験により、我々のReflexiCoder-8Bは、1.5B-14B範囲の主要オープンソースモデルにおいて新たな最高性能(SOTA)を確立し、HumanEval (Plus)で94.51% (87.20%)、MBPP (Plus)で81.80% (78.57%)、BigCodeBenchで35.00%、LiveCodeBenchで52.21%、CodeForcesで37.34%を単一試行設定で達成し、GPT-5.1のようなプロプライエタリモデルに匹敵または凌駕することを実証した。特筆すべきは、本フレームワークがベースモデルよりも大幅にトークン効率が高く、律速された高速な推論と内省パターンを通じて、推論時の計算オーバーヘッドを約40%削減することである。ソースコードはhttps://github.com/juyongjiang/ReflexiCoder で公開されている。
English
While Large Language Models (LLMs) have revolutionized code generation, standard "System 1" approaches, generating solutions in a single forward pass, often hit a performance ceiling when faced with 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-zero 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-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, high-speed reasoning and reflection patterns. Source code is available at https://github.com/juyongjiang/ReflexiCoder.
PDF11March 12, 2026