pass@k
Definition
The probability that at least one of k generated solutions passes the tests, used to score code generation and other checkable tasks.
In more detail
The metric was popularised by the 2021 Codex paper that introduced the HumanEval benchmark. You generate n samples per problem, count how many pass the unit tests, and estimate the chance that a random set of k would include a pass. pass@1 is the closest to 'does it work first time'.
Higher k always looks better, because it rewards getting lucky once. That suits settings where a person or test suite picks the working answer, and flatters settings where the first answer is used. Report pass@1 alongside any higher k.
Related terms
Benchmark
A public, standard test set used to compare models on a capability such as coding, maths or knowledge, under the same conditions.
Eval
A repeatable test that measures how well an AI system performs on a defined set of cases, so you can compare versions instead of guessing.
Self-consistency
Sampling several reasoning paths for the same question and taking the most common final answer, instead of trusting a single response.
Read more about pass@k
- LLM evaluation
Measuring AI system quality with datasets, code checks and model-graded tests.
- Benchmark
A public, standard test set used to compare models on a capability such as coding, maths or knowledge, under the same conditions.
- AI-assisted coding
Working with coding agents: tasks, instruction files, review and verification.