Skip to main content
QUICK REVIEW

[论文解读] OctoPack: Instruction Tuning Code Large Language Models

Niklas Muennighoff, Qian Liu|arXiv (Cornell University)|Aug 14, 2023
Software Engineering ResearchComputer Science被引用 16
一句话总结

本文介绍 CommitPack 和 CommitPackFT,4TB 与 2GB 的许可代码提交数据集,用于指令微调代码大型语言模型。它提出 OctoCoder 和 OctoGeeX,最佳的宽松许可代码 LLMs,在扩展的 HumanEvalPack 基准上评估,包括 Code Repair、Code Explanation 和 Code Synthesis,覆盖六种语言。

ABSTRACT

Finetuning large language models (LLMs) on instructions leads to vast performance improvements on natural language tasks. We apply instruction tuning using code, leveraging the natural structure of Git commits, which pair code changes with human instructions. We compile CommitPack: 4 terabytes of Git commits across 350 programming languages. We benchmark CommitPack against other natural and synthetic code instructions (xP3x, Self-Instruct, OASST) on the 16B parameter StarCoder model, and achieve state-of-the-art performance among models not trained on OpenAI outputs, on the HumanEval Python benchmark (46.2% pass@1). We further introduce HumanEvalPack, expanding the HumanEval benchmark to a total of 3 coding tasks (Code Repair, Code Explanation, Code Synthesis) across 6 languages (Python, JavaScript, Java, Go, C++, Rust). Our models, OctoCoder and OctoGeeX, achieve the best performance across HumanEvalPack among all permissive models, demonstrating CommitPack's benefits in generalizing to a wider set of languages and natural coding tasks. Code, models and data are freely available at https://github.com/bigcode-project/octopack.

研究动机与目标

  • 证明在许可宽松的代码数据上进行指令微调可以在多种语言和任务上提升 Code LLM 的泛化能力。
  • 创建 CommitPack 和 CommitPackFT,提供大规模且高质量的代码指令数据。
  • 开发并在扩展的 HumanEvalPack 基准上评估改进的宽松许可代码 LLM(OctoCoder、OctoGeeX)。
  • 证明将 CommitPackFT 与自然语言数据结合在一起,在宽松模型中可实现最佳性能。

提出的方法

  • 构建 CommitPack,是一个涵盖 350 种语言的 4TB Git 提交数据集,通过过滤 GitHub Actions 元数据及相关代码改动实现。
  • 创建 CommitPackFT,是一个高质量的 2GB 子集,具有指令式风格的提交信息和受限过滤条件(以大写祈使句开头、包含多词短语等)。
  • 汇编 HumanEvalPack,将 HumanEval 扩展到 Code Repair、Code Explanation 和 Code Synthesis,覆盖六种语言,进行基于执行的严格评估。
  • 在 CommitPackFT 与 OASST 类数据上微调基于 StarCoder 的模型以创建 OctoCoder,并同样微调 CodeGeeX2 以创建 OctoGeeX。
  • 使用 pass@k 在 HumanEvalPack 上评估模型,大多数模型取 20 次样本,GPT-4 取 1 次,覆盖三项任务和六种语言。
  • 将宽松许可模型与非宽松许可模型以及 GPT-4 进行比较,覆盖三种任务变体(Code Synthesis、Code Repair、Code Explanation)。

实验结果

研究问题

  • RQ1在一个大型、许可宽松的代码数据集上进行指令微调,能否提升 Code LLM 在多种编程语言上的表现?
  • RQ2将高质量的提交指令数据集(CommitPackFT)与自然语言数据(OASST)结合,是否为代码任务带来最佳收益?
  • RQ3指令微调的 Code LLM 在预训练中未充分覆盖的语言和任务上泛化能力如何?
  • RQ4当前宽松许可的 Code LLM 在诸如修复错误和代码解释等挑战性任务上的局限性是什么?
  • RQ5指令微调模型与封闭源代码模型在 HumanEvalPack 任务上的对比如何?

主要发现

  • OctoCoder 在 HumanEvalPack 的所有三个评测场景中在宽松模型中取得最高平均分。
  • OctoGeeX,具备 6B 参数,优于之前的宽松许可 Code LLM,展现出较强的泛化能力。
  • GPT-4 仍然是总体表现最佳者,但是闭源且不可宽松许可。
  • CommitPackFT 加上自然语言数据(OASST)在代码生成方面在宽松模型中实现最佳表现,较 StarCoder 的绝对提升为 23%。
  • HumanEvalPack 显示代码修复对许多模型仍具挑战性,针对性提交帮助 OctoCoder 处理 bug 修复。
  • 模型难以生成自然语言解释,强调在指令微调时需要带有自然语言目标(outputs with NL targets)。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。