用强化学习迭代优化代码重排模型,提升生成质量与速度
Iterative Self-Training for Code Generation via Reinforced Re-Ranking
- 通过PPO强化学习训练重排模型,自动筛选最优代码解
- 13.4B模型比33B模型更快且更优,媲美GPT-4
- 适合追求高效高质代码生成的研究者与开发者
生成解决复杂编程任务的高质量代码极具挑战性,尤其在当前基于解码器的模型输出高度随机的情况下。即使微小错误也可能导致整个解决方案失效。利用多个采样结果可显著提升整体输出质量。一种有效方法是将代码生成模型与重排模型结合,从生成样本中选出最佳解。本文提出一种新颖的迭代自训练方法,采用近端策略优化(PPO)训练重排模型,旨在同时提升重排准确率与整体代码生成效果。与传统PPO侧重优化生成模型不同,本方法聚焦于构建稳健的奖励/重排模型,通过重排改善生成代码质量,并弥补奖励模型在对齐过程中可能忽略的问题。方法通过重新评估输出、识别高分负例并将其纳入训练循环,持续优化训练数据。在MultiPL-E数据集上的评估表明,我们的13.4B参数模型在代码生成质量上优于33B模型,且速度提升三倍;其性能接近GPT-4,且在一种编程语言上超越GPT-4。
原文摘要 · Abstract (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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。