Execute the answer: verifiers as ground truth
For code and math, the answer can be checked by running it. Programmatic grading extracts a candidate program or expression, executes it against tests or a reference implementation, and returns a deterministic pass/fail. This is the strongest form of automatic scoring because it cannot be fooled by fluent prose.
Robust extraction
Find the code block or final answer before grading. Extraction failures masquerade as model failures and are a common source of bogus scores.
Test harnesses
Unit tests, property checks, and reference implementations provide binary or partial credit.
pass@k
When sampling k solutions, report the fraction of problems solved by at least one sample.
With 10 samples and 5 correct, pass@1 = 0.5 while pass@5 ≈ 0.996. pass@k measures reachable capability; pass@1 measures reliability.
- HumanEval and MBPP execute generated Python against hidden tests and report pass@1 and pass@k.
- SWE-bench verifies patches by running a repository's own test suite in an isolated container.