Skip to main content
QUICK REVIEW

[论文解读] PanGu-Coder2: Boosting Large Language Models for Code with Ranking Feedback

Bo Shen, Jiaxin Zhang|arXiv (Cornell University)|Jul 27, 2023
Natural Language Processing Techniques被引用 13
一句话总结

PanGu-Coder2 引入 RRTF,一种基于排序反馈的微调框架,在 StarCoder 15B 上,在 HumanEval、CoderEval 和 LeetCode 基准上实现最先进的代码生成性能。

ABSTRACT

Large Language Models for Code (Code LLM) are flourishing. New and powerful models are released on a weekly basis, demonstrating remarkable performance on the code generation task. Various approaches have been proposed to boost the code generation performance of pre-trained Code LLMs, such as supervised fine-tuning, instruction tuning, reinforcement learning, etc. In this paper, we propose a novel RRTF (Rank Responses to align Test&Teacher Feedback) framework, which can effectively and efficiently boost pre-trained large language models for code generation. Under this framework, we present PanGu-Coder2, which achieves 62.20% pass@1 on the OpenAI HumanEval benchmark. Furthermore, through an extensive evaluation on CoderEval and LeetCode benchmarks, we show that PanGu-Coder2 consistently outperforms all previous Code LLMs.

研究动机与目标

  • 推动在接近人类对齐信号下,让 Code LLMs 生成正确且高效的代码。
  • 提出一种数据高效、与模型无关的代码生成训练范式(RRTF)。
  • 证明基于排序的反馈在代码任务上能够超越传统基于奖励的强化学习方法。
  • 展示 PanGu-Coder2 在多个基准上的优越性能,并分析数据与训练动态。

提出的方法

  • 提出 RRTF:用于代码 LLM 的采样、排序与训练三阶段框架。
  • 使用 Evol-Instruct 生成提示和来自多个来源的回答采样。
  • 使用单元测试和启发式偏好对回答进行排序,以创建训练信号。
  • 训练一个 15B 解码器模型,使用排序和监督微调损失。
  • 在 Evol-Instruct 派生语料上进行预训练,并进行谨慎的数据整理以避免泄漏。
  • 通过 HumanEval、CoderEval 和 LeetCode 基准的 pass@k 进行评估。

实验结果

研究问题

  • RQ1基于排序的反馈(RRTF)相比传统的基于 RL 的方法,是否能提升 Code LLMs 的代码生成质量?
  • RQ2使用 RRTF 训练的 15B 解码器模型能否在标准基准上达到最先进的代码生成性能?
  • RQ3数据集规模和训练轮数如何影响 PanGu-Coder2 的性能与收敛?
  • RQ4在将 RRTF 应用于代码模型时,推理和数据效率方面有哪些考虑?

主要发现

模型参数Pass@1 (%)Pass@10 (%)Pass@100 (%)
PanGu-Coder215B61.6479.5591.76
WizardCoder15B57.3073.3290.46
StarCoder15B33.6045.7879.82
  • 在开源模型中,PanGu-Coder2 在 HumanEval(贪心解码)上达到 61.64% 的 pass@1、79.55% 的 pass@10、和 91.76% 的 pass@100。
  • 在贪心解码结果上,PanGu-Coder2 在 HumanEval、CoderEval 和 LeetCode 上超过 WizardCoder 和 StarCoder。
  • PanGu-Coder2 在表 3 中在 HumanEval 获得 62.20% pass@1,在 CoderEval 获得 38.26%,在 LeetCode 的 easy/medium/hard 分别为 32/30/10。
  • 数据集规模和训练轮数同样影响准确性,通常 3-4 轮能达到收敛。
  • 通过量化(CTranslate2、GPTQ)进行推理优化,降低内存、提速推理,但对 HumanEval 的影响各不相同。
  • PanGu-Coder2 尽管规模较小,仍超越若干更大规模的模型,在某些对比中也缩小了与 GPT-4 的差距。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。