강화 재순위화를 통한 코드 생성을 위한 반복적 자기 학습
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 모델을 능가하면서도 세 배 더 빠른 성능을 보였습니다. 또한, 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