HumanEval
by OpenAI
What is HumanEval? HumanEval is a coding eval made by OpenAI. A classic set of hand-written Python function problems, each checked by running hidden tests. Useful as a baseline, though top models have largely mastered it.
Editor note
A classic set of hand-written Python function problems, each checked by running hidden tests. Useful as a baseline, though top models have largely mastered it.
- What it tests
- Writing a short correct function from a docstring.
- Original source
- github.com/openai/human-eval
- Last updated
- Repo last commit 2025-01-17
- License
- MIT
When to use HumanEval
- You need a quick, cheap sanity check that a model can write short, correct Python functions from a docstring.
- You want pass@k numbers that can be compared with the many papers that report HumanEval.
Limitations
- It dates from 2021 and its problems are public, so newer models may have seen them during training.
- Problems are short, single functions. The paper notes models struggled with docstrings that describe long chains of operations, but the set does not test multi-file or repository work.
- The harness runs untrusted model-written code. The maintainers ship with execution disabled and tell users to run it only inside a security sandbox.
How to run it
- Install the harness and enable execution only after reading the safety note in execution.py.
- Write completions to a JSONL file with task_id and completion fields.
- Score with the provided command, which reports pass@1, pass@10 and pass@100.
git clone https://github.com/openai/human-eval
pip install -e human-eval
evaluate_functional_correctness samples.jsonlNotable results
- In the paper, Codex solved 28.8% of problems with one sample (GPT-3: 0%), and 70.2% when 100 samples per problem were drawn. [Paper (arXiv)]
Sources
Related on Evals Review
- LiveCodeBench: new contest problems you can filter by release date, to avoid problems a model may have memorised
- HumanEval vs LiveCodeBench: side by side
Compare HumanEval
Related coding evals
- SWE-bench — Fixing real bugs in real repositories, judged by unit tests.
- LiveCodeBench — Code generation, self-repair and test prediction on fresh problems.
- Aider leaderboards (Polyglot) — Practical multi-language code editing.
- BigCodeBench — Library-heavy, practical Python tasks.
Discussion
No one has discussed HumanEval yet. Have you run it? Share what it caught, what it missed or how you set it up.
Related reading
- A contamination-resistant successor: HumanEval vs LiveCodeBench
- Every coding benchmark side by side: best coding benchmarks