Skip to main content
QUICK REVIEW

[论文解读] A Survey on Large Language Models for Code Generation

J.-H.R. Jiang, Fan Wang|arXiv (Cornell University)|Jun 1, 2024
Natural Language Processing TechniquesComputer Science被引用 54
一句话总结

对大型语言模型在从自然语言到代码生成中的应用进行全面系统的综述,提出一个分类体系,评估数据、训练、评估和实际应用,并提供基于 HumanEval 和 MBPP 基准的实证参考。

ABSTRACT

Large Language Models (LLMs) have garnered remarkable advancements across diverse code-related tasks, known as Code LLMs, particularly in code generation that generates source code with LLM from natural language descriptions. This burgeoning field has captured significant interest from both academic researchers and industry professionals due to its practical significance in software development, e.g., GitHub Copilot. Despite the active exploration of LLMs for a variety of code tasks, either from the perspective of natural language processing (NLP) or software engineering (SE) or both, there is a noticeable absence of a comprehensive and up-to-date literature review dedicated to LLM for code generation. In this survey, we aim to bridge this gap by providing a systematic literature review that serves as a valuable reference for researchers investigating the cutting-edge progress in LLMs for code generation. We introduce a taxonomy to categorize and discuss the recent developments in LLMs for code generation, covering aspects such as data curation, latest advances, performance evaluation, ethical implications, environmental impact, and real-world applications. In addition, we present a historical overview of the evolution of LLMs for code generation and offer an empirical comparison using the HumanEval, MBPP, and BigCodeBench benchmarks across various levels of difficulty and types of programming tasks to highlight the progressive enhancements in LLM capabilities for code generation. We identify critical challenges and promising opportunities regarding the gap between academia and practical development. Furthermore, we have established a dedicated resource GitHub page (https://github.com/juyongjiang/CodeLLMSurvey) to continuously document and disseminate the most recent advances in the field.

研究动机与目标

  • 将代码生成定义为在大语言模型中的从自然语言到代码,并阐明其重要性。
  • 提出一个分类体系,以组织代码生成的数据、训练、评估和应用。
  • 综合整理数据收集、预训练、微调和提示在代码大模型中的进展。
  • 批判性地讨论将研究与实践衔接的挑战与机遇。
  • 通过 HumanEval 和 MBPP 基准提供经验背景以展示进展。

提出的方法

  • 提出一个分类体系,将数据整理、训练、评估和应用用于代码生成进行分类。
  • 调查数据来源、基准和在数据预训练、指令微调和微调中的模型族。
  • 总结诸如检索增强、自治编码代理及将大语言模型作为评审者等前沿主题。
  • 讨论评估指标以及在行业工具如 Copilot 和 CodeWhisperer 中的实际应用。
  • 通过引用在知名基准(HumanEval、MBPP)上的进展,提供经验视角。
  • 提供一个资源页面(codellm.github.io)以获取持续更新。

实验结果

研究问题

  • RQ1定义代码生成的语言模型的核心组成部分和阶段(数据、训练、评估、部署)有哪些?
  • RQ2数据整理、模型架构和微调策略如何演变以提升从自然语言到代码的能力?
  • RQ3哪些基准和评估方法最能反映真实世界中的代码生成性能?
  • RQ4哪些挑战阻碍研究与实践的转化,以及如何应对?
  • RQ5面向代码的语言模型最具潜力的机会与未来方向是什么?

主要发现

  • 代码大模型在代码生成方面显示出显著进展,随着模型规模的扩大,出现了如遵循指令和上下文学习等新兴能力。
  • 引用的 HumanEval 进展:在 Pass@1 上从 3.6%(PaLM 8B)到 95.1%(LDB),显示标准 NL-to-code 任务上性能的巨大提升。
  • 一个广泛的专门化代码模型生态(如 StarCoder、Code LLaMA、CodeGemma)补充了通用大模型在代码任务上的作用。
  • 一个广泛的分类体系涵盖数据整理、预训练、指令微调、评估、提示、检索增强生成和自治代理等作为代码生成管线的关键方面。
  • 本文强调数据质量、隐私和对齐等方面的持续挑战,并概述了弥合学术界与工业实践的机会。
  • 一个专门的资源站 codellm.github.io 已建立,用于记录和传播进展。

阅读本论文

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

在 Nubint 中阅读本论文

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