Notes

Pass@k

Code either runs or it does not, which makes evaluating a coding model refreshingly concrete: generate a program, execute the tests, count the passes. The complication is that a model asked twice gives two different programs. Pass@k is the metric built around that fact.

What the number means

Pass@k is the probability that at least one of k sampled solutions passes all the unit tests for a problem. Pass@1 is the familiar case: right on the first try. Pass@10 asks whether a correct answer is anywhere in ten attempts. Measuring it by literally drawing k samples and checking is unbiased but very noisy, so the standard practice introduced with HumanEval is to draw a larger n, count the c correct samples, and use the combinatorial estimator 1 - C(n-c, k) / C(n, k) — one minus the chance that a random choice of k out of the n drawn contains no correct solution.

Reading it honestly
  • It exists only because tests can decide correctness automatically, which is why it belongs to HumanEval, MBPP and their descendants rather than to open-ended generation.
  • Pass@1 and pass@100 rank models differently: a high-temperature model explores more and wins at large k while losing at k equal to one.
  • A high pass@k is useful only if something downstream can identify the passing sample — a test suite, a compiler, a reviewer. Without that filter the metric flatters the model.
  • Hidden tests are incomplete, so a pass means not caught, not proven correct.

Report k alongside the score, and the sampling temperature with it. A pass@k quoted without both is not a comparable number.

Pass@k is the standard metric for code-generation benchmarks: the model is asked for k independent solutions to a problem and scores a success if any one of them passes the hidden unit tests. Pass@1 measures single-shot reliability; pass@10 measures whether a correct answer is reachable at all with sampling. It is the score reported on HumanEval, and stating k is what makes two code models comparable.

Imagine marking a programming test where the student may hand in ten attempts, and the paper counts as passed if any single attempt actually works. That is pass@k, and the k is how many tries the model gets. Pass@1 asks whether it gets the job done first time, which is what matters when the answer goes straight into a product. Pass@10 asks something gentler: can it find a working answer at all, if someone is willing to sift through ten suggestions and test them? The gap between those two numbers tells you whether a coding assistant is dependable or merely promising.