Skip to main content
QUICK REVIEW

[Paper 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 TechniquesComputer Science13 citations
TL;DR

PanGu-Coder2 introduces RRTF, a ranking-feedback based fine-tuning framework that, on StarCoder 15B, achieves state-of-the-art code generation performance across HumanEval, CoderEval, and LeetCode benchmarks.

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.

Motivation & Objective

  • Motivate improving Code LLMs to generate correct and efficient code under human-like alignment signals.
  • Propose a data-efficient, model-agnostic training paradigm (RRTF) for code generation tasks.
  • Demonstrate that ranking-based feedback can outperform traditional reward-based RL approaches on code tasks.
  • Showcase PanGu-Coder2’s superior performance on multiple benchmarks and analyze data and training dynamics.

Proposed method

  • Propose RRTF: sampling, ranking, and training three-stage framework for code LLMs.
  • Use Evol-Instruct to generate prompts and sampling of responses from multiple sources.
  • Rank responses using unit tests and heuristic preferences to create training signals.
  • Train a 15B decoder-only model with ranking and supervised fine-tuning losses.
  • Pre-train on an Evol-Instruct-derived corpus with careful data curation to avoid leakage.
  • Evaluate via pass@k on HumanEval, CoderEval, and LeetCode benchmarks.

Experimental results

Research questions

  • RQ1Does ranking-based feedback (RRTF) improve code generation quality for Code LLMs compared with traditional RL-based methods?
  • RQ2Can a 15B decoder-only model trained with RRTF achieve state-of-the-art code generation performance on standard benchmarks?
  • RQ3How does dataset size and training epochs affect PanGu-Coder2’s performance and convergence?
  • RQ4What are the inference and data-efficiency considerations when applying RRTF to code models?

Key findings

  • PanGu-Coder2 achieves 61.64% pass@1, 79.55% pass@10, and 91.76% pass@100 on HumanEval (greedy decoding) among open-source models.
  • PanGu-Coder2 outperforms WizardCoder and StarCoder on HumanEval, CoderEval, and LeetCode in greedy decoding results.
  • PanGu-Coder2 attains 62.20% pass@1 on HumanEval, 38.26% on CoderEval, and 32/30/10 on LeetCode (easy/medium/hard) in Table 3.
  • Dataset size and training epochs similarly influence accuracy, with 3-4 epochs generally achieving convergence.
  • Inference optimization via quantization (CTranslate2, GPTQ) reduces memory and speeds up inference with varying impacts on HumanEval.
  • PanGu-Coder2 surpasses several larger-scale models despite being smaller, and closes gaps to GPT-4 in some comparisons.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.