Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Glossary

pass@k

Also called: pass at k, pass@1, unbiased pass@k estimator

pass@k is the probability that at least one of k sampled attempts at a task is correct, the standard metric for code generation and reasoning evals.

pass@k is the probability that at least one of independent samples from a model solves a task, averaged over tasks. pass@1 is plain per-attempt accuracy; larger measures what a model can reach when it is allowed several tries and something (a test suite or verifier) picks out the correct one.

The unbiased estimator

Computing pass@k by drawing exactly samples is high variance. Instead, draw samples per task, count the correct ones, and use

The fraction is the probability that a random subset of of the samples contains no correct answer, so one minus it is the probability that the subset contains at least one. Averaging this over tasks gives an unbiased estimate of pass@k. The naive alternative, , is biased low because it plugs a noisy estimate into a nonlinear function.

Worked example

A model generates programs for a task and pass the unit tests. pass@1 is . For pass@5, and , so the estimate is . A task the model solves only 30% of the time is solved more than 90% of the time with five tries.

Pitfalls

  • pass@k with large assumes a perfect selector. Without one, users see pass@1, not pass@k.
  • For reliability questions, the opposite metric matters: the probability that all attempts succeed, sometimes written pass^k. A model with pass@1 of 0.9 succeeds on all of 5 tries only of the time on a typical task.
  • Always report , , the sampling temperature and a confidence interval. Tasks, not samples, are the unit of independence.

Why it matters

pass@k connects evaluation to how models are used and trained. Best-of-n sampling and RL with verifiable rewards both exploit the gap between pass@1 and pass@k, and a widening or narrowing gap is a useful diagnostic of what training changed. For safety, the same arithmetic describes an attacker who retries a jailbreak: a small per-attempt success rate becomes a large one over many attempts.

Sources

  1. Mark Chen et al.. Evaluating Large Language Models Trained on Code, 2021. arxiv.org

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.