pass@k

pass@k is an evaluation metric giving the share of problems an AI model solves when it is allowed k attempts and at least one attempt passes the checks; pass@1 is the single-attempt score.

pass@k answers a simple question: if a model gets k tries at each problem, on what share of problems does at least one try succeed? It is used wherever an answer can be checked automatically. For code, a sample passes if it runs and passes the problem's unit tests. pass@1 is the score with a single attempt and is the number most launch tables quote. pass@10 or pass@100 allow ten or a hundred attempts, which always gives an equal or higher score.

The metric was used by Sumith Kulal and colleagues in their 2019 paper SPoC: Search-based Pseudocode to Code, and OpenAI adopted it in July 2021 in Evaluating Large Language Models Trained on Code, the Codex paper that also introduced the HumanEval set of 164 hand-written programming problems. The Codex authors argued that matching code against a reference answer was the wrong test, because many different programs can be correct. What matters is whether the code works.

The Codex paper also fixed how to calculate it. Simply generating k samples once gives a noisy number, so the authors generated more samples than needed for each problem, 200 in their case, counted how many were correct, and used a formula for the chance that a random set of k of those samples contains at least one correct one. That estimate, averaged across problems, is the pass@k figure reported today.

The gap between pass@1 and larger k can be big. Codex solved 28.8% of HumanEval problems with a single sample, but 70.2% when 100 samples were drawn per problem and any working one counted. That is why the k matters when reading a claim. A high pass@100 shows the right answer is somewhere in what the model can produce, but a user only benefits if something picks the right attempt, such as a test suite.

Agent benchmarks have added a stricter cousin. The 2024 tau-bench paper proposed pass^k, which asks whether a model succeeds on all k tries of the same task, as a measure of reliability. GPT-4o scored below 25% on pass^8 in the benchmark's retail tasks. For anyone deploying AI, pass@k describes the best case with retries, while pass^k is closer to what it is like to depend on the system every time.

Common questions

What does pass@1 mean?

pass@1 is the share of problems a model solves on a single attempt, with the answer checked automatically, for example by unit tests. It is usually estimated by sampling several answers per problem and averaging, which gives a steadier number than one run.

Why is pass@k higher than pass@1?

With more attempts there are more chances that one of them is correct, so pass@k never falls as k grows. A large difference between pass@1 and pass@100 means the model often can produce a correct answer but does not reliably produce it first.

How is pass@k calculated?

The standard method from the 2021 Codex paper generates n samples per problem, where n is at least k, and counts the c that pass. It then computes the probability that a random set of k samples includes at least one of the correct ones, and averages that across all problems.

What is the difference between pass@k and pass^k?

pass@k counts a task as solved if any of k attempts succeeds, so it rewards getting it right at least once. pass^k, introduced with tau-bench in 2024, counts a task only if all k attempts succeed, so it measures consistency.

Finding more

Search for "pass@k metric", "unbiased pass@k estimator" or "pass^k reliability" to see how scores are defined. The most reliable sources are the original papers on arXiv, especially the 2021 Codex paper, and benchmark repositories that publish their scoring code. When a company quotes a coding or maths score, check the k, how many samples were averaged and whether a separate selection step was used, since all three change the number.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.