StepCoder: コンパイラフィードバックからの強化学習によるコード生成の改善
StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback
February 2, 2024
著者: Shihan Dou, Yan Liu, Haoxiang Jia, Limao Xiong, Enyu Zhou, Junjie Shan, Caishuang Huang, Wei Shen, Xiaoran Fan, Zhiheng Xi, Yuhao Zhou, Tao Ji, Rui Zheng, Qi Zhang, Xuanjing Huang, Tao Gui
cs.AI
要旨
大規模言語モデル(LLM)の進展は、コード生成の分野を大きく前進させました。これまでの研究では、コード生成の品質を向上させるために、強化学習(RL)とコンパイラフィードバックを統合し、LLMの出力空間を探索してきました。しかし、複雑な人間の要求に応じてLLMが生成する長いコードは、RLによる探索を困難にします。また、ユニットテストが複雑なコードをカバーしていない可能性があるため、実行されていないコードスニペットを使用してLLMを最適化することは非効率的です。これらの課題に対処するため、我々はStepCoderという新しいコード生成用RLフレームワークを提案します。StepCoderは2つの主要コンポーネントで構成されています。CCCS(Curriculum of Code Completion Subtasks)は、長いシーケンスのコード生成タスクを小さなコード補完サブタスクに分割することで探索の課題に対処し、FGO(Fine-Grained Optimization)は実行されていないコードセグメントをマスキングすることでモデルの最適化を行います。さらに、RLトレーニング用にAPPS+データセットを構築し、ユニットテストの正確性を保証するために手動で検証しました。実験結果は、我々の手法が出力空間の探索能力を向上させ、対応するベンチマークにおいて最先端のアプローチを上回ることを示しています。
English
The advancement of large language models (LLMs) has significantly propelled
the field of code generation. Previous work integrated reinforcement learning
(RL) with compiler feedback for exploring the output space of LLMs to enhance
code generation quality. However, the lengthy code generated by LLMs in
response to complex human requirements makes RL exploration a challenge. Also,
since the unit tests may not cover the complicated code, optimizing LLMs by
using these unexecuted code snippets is ineffective. To tackle these
challenges, we introduce StepCoder, a novel RL framework for code generation,
consisting of two main components: CCCS addresses the exploration challenge by
breaking the long sequences code generation task into a Curriculum of Code
Completion Subtasks, while FGO only optimizes the model by masking the
unexecuted code segments to provide Fine-Grained Optimization. In addition, we
furthermore construct the APPS+ dataset for RL training, which is manually
verified to ensure the correctness of unit tests. Experimental results show
that our method improves the ability to explore the output space and
outperforms state-of-the-art approaches in corresponding benchmarks.Summary
AI-Generated Summary