Back to Feed
Benchmarks & Evals

Evaluating Large Language Models Trained on Code

Original: Evaluating Large Language Models Trained on Code

Listen to the summary

Uses a voice available on your device

Audio options
On this page 4 sections
Related concepts 2 concepts

Key Takeaways

  • Codex solves 28.8% of the problems on HumanEval with a single sample, while GPT-3 solves 0% and GPT-J solves 11.4%.
  • Repeated sampling allows Codex-S to solve 70.2% of problems with 100 samples per problem.
  • Codex-S solves 37.7% of problems with a single sample after fine-tuning on standalone, correctly implemented functions.
  • The evaluation methodology involves assembling evaluation problems into prompts consisting of a header, a signature, and a docstring, and sampling tokens using nucleus sampling.

Summary & Methodology Analysis

This paper addresses the challenge of program synthesis and the evaluation of code-writing capabilities in large language models trained on code. Specifically, it focuses on generating standalone Python functions from docstrings and measuring functional correctness. The methodology involves assembling each evaluation problem into a prompt consisting of a header, a signature, and a docstring. Tokens are sampled from the language model until encountering specific stop sequences using nucleus sampling, which is a method for generating text by sampling from the subset of tokens whose cumulative probability exceeds a threshold. Generated code samples are then evaluated automatically through unit tests in a secure sandbox environment. Pass@k metrics are computed using an unbiased estimator based on the number of correct samples and total samples generated.

Key results demonstrate the performance differences across models and strategies. Codex solves 28.8% of the problems on HumanEval with a single sample, while GPT-3 solves 0% and GPT-J solves 11.4%. Repeated sampling allows Codex-S to solve 70.2% of problems with 100 samples per problem. Furthermore, Codex-S solves 37.7% of problems with a single sample after fine-tuning on standalone, correctly implemented functions, where fine-tuning is the process of adjusting pre-trained model weights on a specific downstream dataset.

Despite these results, the paper identifies several limitations. Codex has difficulty with docstrings describing long chains of operations. It also has difficulty with binding operations to variables. Additionally, Codex is not sample efficient to train, meaning it requires a large amount of data or compute relative to the performance gained.

Interactive System Flowchart

Click diagram to expand and zoom

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What is the primary focus of the paper?

The paper focuses on program synthesis and evaluating the code-writing capabilities of large language models trained on code, specifically generating standalone Python functions from docstrings and measuring functional correctness.

Q2. Which models and datasets are mentioned in the research?

The models and datasets mentioned are Codex, GPT-3, GPT-J, GitHub, HumanEval, CodeBERT, PyMT5, GPT-Neo, TabNine, APPS, and The Pile.

Q3. What is the main finding regarding Codex performance on HumanEval?

Codex solves 28.8% of the problems on HumanEval with a single sample.

Q4. How are evaluation problems structured in the prompt?

Each evaluation problem is assembled into a prompt consisting of a header, a signature, and a docstring.

Q5. How are the generated code samples evaluated?

Generated code samples are evaluated automatically through unit tests in a secure sandbox environment.

Q6. How is the pass@k metric calculated?

Pass@k metrics are computed using an unbiased estimator based on the number of correct samples and total samples generated.

Q7. What happens when using repeated sampling with Codex-S?

Repeated sampling allows Codex-S to solve 70.2% of problems with 100 samples per problem.

Q8. What effect does fine-tuning have on Codex-S?

Codex-S solves 37.7% of problems with a single sample after fine-tuning on standalone, correctly implemented functions.

Q9. What are the core limitations of Codex identified in the paper?

Codex has difficulty with docstrings describing long chains of operations, difficulty with binding operations to variables, and is not sample efficient to train.

Flag an issue

What is wrong with this summary?

What is wrong?