Skip to main content
QUICK REVIEW

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

A comprehensive systematic review of how large language models are used for NL-to-code generation, introducing a taxonomy, surveying data, training, evaluation, and practical applications, and providing an empirical reference using HumanEval and MBPP benchmarks.

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.

Motivation & Objective

  • Define code generation as NL-to-code within LLMs and justify its importance.
  • Present a taxonomy to organize data, training, evaluation, and applications for code generation.
  • Synthesize developments across data curation, pre-training, fine-tuning, and prompting for code LLMs.
  • Critically discuss challenges and opportunities to bridge research and practice.
  • Provide empirical context via HumanEval and MBPP benchmarks to illustrate progress.

Proposed method

  • Propose a taxonomy that categorizes data curation, training, evaluation, and applications for code generation.
  • Survey data sources, benchmarks, and model families in data pre-training, instruction tuning, and fine-tuning.
  • Summarize advanced topics such as retrieval augmentation, autonomous coding agents, and LLM-as-a-Judge.
  • Discuss evaluation metrics and practical applications in industry tools like Copilot and CodeWhisperer.
  • Offer an empirical perspective by referencing progress on well-known benchmarks (HumanEval, MBPP).
  • Provide a resource page (codellm.github.io) for ongoing updates.

Experimental results

Research questions

  • RQ1What are the core components and stages (data, training, evaluation, deployment) that define LLMs for code generation?
  • RQ2How have data curation, model architectures, and fine-tuning strategies evolved to improve NL-to-code capabilities?
  • RQ3What benchmarks and evaluation methods best reflect real-world code generation performance?
  • RQ4What challenges hinder the research-practice translation and how can they be addressed?
  • RQ5What are the most promising opportunities and future directions for code-focused LLMs?

Key findings

  • Code LLMs show substantial progress on code generation, with emergent abilities such as instruction following and in-context learning as models scale.
  • HumanEval progression cited: from 3.6% (PaLM 8B) to 95.1% (LDB) on Pass@1, illustrating dramatic performance gains on standard NL-to-code tasks.
  • A wide ecosystem of specialized code models (e.g., StarCoder, Code LLaMA, CodeGemma) complements general-purpose LLMs for code tasks.
  • A broad taxonomy covers data curation, pre-training, instruction tuning, evaluation, prompts, retrieval-augmented generation, and autonomous agents as essential facets of code-generation pipelines.
  • The paper highlights ongoing data quality, privacy, and alignment challenges and outlines opportunities to bridge academia and industry practice.
  • A dedicated resource site codellm.github.io is established to document and disseminate advances.

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.