NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Neural Model Meets NL2Code: A Survey

Daoguang Zan, Bei Chen, Fengji Zhang, Dianjie Lu, Bingchao Wu, Bei Guan, Yongji Wang, Jian-Guang Lou

Abstract

The task of generating code from a natural language description, or NL2Code, is considered a pressing and significant challenge in code intelligence. Thanks to the rapid development of pre-training techniques, surging large language models are being proposed for code, sparking the advances in NL2Code. To facilitate further research and applications in this field, in this paper, we present a comprehensive survey of 27 existing large language models for NL2Code, and also review benchmarks and metrics. We provide an intuitive comparison of all existing models on the HumanEval benchmark. Through in-depth observation and analysis, we provide some insights and conclude that the key factors contributing to the success of large language models for NL2Code are "Large Size, Premium Data, Expert Tuning". In addition, we discuss challenges and opportunities regarding the gap between models and humans. We also create a website https://nl2code.github.io to track the latest progress through crowd-sourcing. To the best of our knowledge, this is the first survey of large language models for NL2Code, and we believe it will contribute to the ongoing development of the field.

Introduction

For decades, the "holy grail" of software engineering has been enabling anyone to create software simply by describing their requirements. This field, known as NL2Code, has evolved from rigid, rule-based expert systems to deep learning models that require massive amounts of labeled data.

While recent Large Language Models (LLMs) like Codex have shown startling "emergent" abilities to write code in a zero-shot manner, the field is moving so fast that it’s hard to keep track of which architectures work best, which datasets are most effective, and what challenges remain. This survey systematizes the current landscape to help researchers understand why these models work and where they still fail.

Timeline of the rapid evolution of NL2Code models and their parameter scales.

Methodology and Architectures

The survey conducts a multi-dimensional analysis of 27 representative LLMs, categorizing them into two main architectural camps:

  • Decoder-only: (e.g., GPT-J, Codex, CodeGen) These are currently favored for larger scales and excel at causal language modeling (predicting the next token).
  • Encoder-Decoder: (e.g., CodeT5, AlphaCode) These models are often better at understanding the relationship between the natural language prompt and the resulting code.

The analysis goes beyond a simple list, examining training configurations including de-duplication strategies, tokenization (Byte-level BPE vs. SentencePiece), and hyper-parameter choices like learning rate decay and sampling temperatures.

Data and Evaluation Benchmarks

The paper reviews 17 benchmarks, noting a shift toward execution-based evaluation (running the code against test cases) rather than just text-matching metrics like BLEU scores.

  • Training Data: Models leverage massive unlabeled corpora like The Stack, GitHub-Code, and BigQuery.
  • Evaluation Benchmarks: Key mentions include HumanEval (164 hand-written Python problems) and MBPP (974 entry-level programming tasks).
  • Multilingual Benchmarks: Newer benchmarks like HumanEval-X and MultiPL test models across languages like C++, Java, and JavaScript.

Key Insights: The Three Pillars of Success

The authors conclude that the most successful models share three traits: Large Size (billions of parameters), Premium Data (rigorous de-duplication and quality filtering), and Expert Tuning (careful selection of hyper-parameters).

Syntax vs. Semantics

As models grow, their syntax error rates plummet (some as low as 6%). However, their ability to solve the actual logic of a problem (semantic correctness) doesn't improve at the same rate. They write "perfect-looking" code that simply does the wrong thing.

Comparison of pass@1 performance and syntax error rates relative to model parameter size.

Context and Temperature

  • The Context Window Advantage: A smaller model with a larger context window can sometimes outperform a much larger model with a small window. For example, a 165M parameter model with an 8k context window can rival a 20B parameter model with only a 2k window.
  • Temperature Trade-offs: Higher sampling temperatures lead to more diverse code solutions (better for pass@100), while lower temperatures are better for getting a single correct answer on the first try (pass@1).

Key Performance Results

  • Codex (12B) remains a milestone, solving 72.31% of human-created Python problems.
  • Code-davinci-002 (an evolution of Codex) achieved a staggering 47.0% pass@1 and 92.1% pass@100 on the HumanEval benchmark.
  • The survey shows a clear correlation: as parameter count increases from 100M to 100B+, performance on benchmarks like MBPP and HumanEval scales almost linearly on a log scale, suggesting we haven't hit the ceiling yet.

Challenges and the "Ability Gap"

Despite the hype, a significant "ability gap" remains between LLMs and humans:

  1. Understanding: Models are brittle and sensitive to prompt phrasing, struggling with complex, multi-step requirements.
  2. Judgment: Unlike humans, LLMs don't know when they can't solve a problem; they will always return code, even if it's nonsensical.
  3. Adaptive Learning: Humans can learn a new API by reading documentation once. LLMs generally require expensive re-training or fine-tuning to update their knowledge.
  4. Self-Validation: While humans test and debug their own code, most LLMs are "one-shot" generators. Future work in self-repair and reinforcement learning from human feedback (RLHF) is the next frontier.

The authors have launched a live website, nl2code.github.io, to track new models and benchmarks in real-time.

Summary updated

BibTeX
@inproceedings{zan2023when,
  author = {Daoguang Zan and Bei Chen and Fengji Zhang and Dianjie Lu and Bingchao Wu and Bei Guan and Yongji Wang and Jian-Guang Lou},
  title = {{When Neural Model Meets NL2Code: A Survey}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.411},
}
Figure