HumanEval
OpenAI's hand-crafted Python coding benchmark: 164 programming problems with function signatures, docstrings, and unit tests. Models are evaluated by Pass@k — the probability of generating at least one correct solution in k tries. The definitive benchmark for code generation ability.
from datasets import load_dataset
ds = load_dataset("openai/openai_humaneval")Preview a sample row
{
"task_id": "HumanEval/0",
"prompt": "def has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check whether any two numbers in the list are closer than threshold. \"\"\"",
"canonical_solution": " for idx, elem in enumerate(numbers):\n for idx2, elem2 in enumerate(numbers):\n if idx != idx2:\n distance = abs(elem - elem2)\n if distance < threshold:\n return True\n return False",
"test": "assert has_close_elements([1.0, 2.0, 3.0], 0.5) == False"
}Frequently asked questions
Can I use HumanEval commercially?
Yes — HumanEval is released under MIT, a permissive license that allows commercial use, including training models you ship in a product. Check the dataset card for attribution requirements before release.
How much data does HumanEval contain, and do I need all of it?
HumanEval contains 164 Problems. It is an evaluation benchmark, so it is used in full to measure models — never mix it into training data, or your benchmark scores become meaningless.
What is HumanEval best used for?
Benchmarking Python code generation - never train on it. It belongs to the Evaluation & Benchmarks section of our dataset hub, where you'll find alternatives and complementary sets.