ChatPaper.aiChatPaper

コード生成のための反復的セルフトレーニング:強化学習による再ランキング

Iterative Self-Training for Code Generation via Reinforced Re-Ranking

April 13, 2025
著者: Nikita Sorokin, Ivan Sedykh, Valentin Malykh
cs.AI

要旨

複雑なプログラミングタスクを解決する高品質なコードを生成することは、特に現在のデコーダベースのモデルが高度に確率的な出力を生成する場合において、困難な課題です。コード生成においては、些細なエラーでも全体のソリューションを簡単に破壊してしまいます。複数のサンプルソリューションを活用することで、全体の出力品質を大幅に向上させることができます。 コード生成を強化する効果的な方法の一つは、コード生成モデルとリランカーモデルを組み合わせることです。リランカーモデルは、生成されたサンプルから最良のソリューションを選択します。本論文では、Proximal Policy Optimization (PPO) を使用したリランカーモデルの自己訓練のための新しい反復的アプローチを提案し、リランキングの精度とコード生成プロセス全体の改善を目指します。従来のPPOアプローチでは、生成モデルを報酬モデルで最適化することに焦点が当てられていましたが、本アプローチでは、堅牢な報酬/リランキングモデルの開発に重点を置いています。このモデルは、リランキングを通じて生成コードの品質を向上させ、PPOによるリランカーとの整合中に報酬モデルが見落とす可能性のある問題やエラーに対処します。本手法は、出力を再評価し、高スコアのネガティブ例を特定し、それらをトレーニングループに組み込むことで、トレーニングデータセットを反復的に洗練し、モデルの性能を向上させます。 MultiPL-Eデータセットでの評価では、13.4Bパラメータのモデルが33Bモデルをコード生成品質で上回り、かつ3倍高速であることを示しています。さらに、GPT-4に匹敵する性能を達成し、一つのプログラミング言語ではそれを上回る結果を示しています。
English
Generating high-quality code that solves complex programming tasks is challenging, especially with current decoder-based models that produce highly stochastic outputs. In code generation, even minor errors can easily break the entire solution. Leveraging multiple sampled solutions can significantly improve the overall output quality. One effective way to enhance code generation is by pairing a code generation model with a reranker model, which selects the best solution from the generated samples. We propose a novel iterative self-training approach for self-training reranker models using Proximal Policy Optimization (PPO), aimed at improving both reranking accuracy and the overall code generation process. Unlike traditional PPO approaches, where the focus is on optimizing a generative model with a reward model, our approach emphasizes the development of a robust reward/reranking model. This model improves the quality of generated code through reranking and addresses problems and errors that the reward model might overlook during PPO alignment with the reranker. Our method iteratively refines the training dataset by re-evaluating outputs, identifying high-scoring negative examples, and incorporating them into the training loop, that boosting model performance. Our evaluation on the MultiPL-E dataset demonstrates that our 13.4B parameter model outperforms a 33B model in code generation quality while being three times faster. Moreover, it achieves performance comparable to GPT-4 and surpasses it in one programming language.

Summary

AI-Generated Summary

PDF342April 15, 2025