# pass@k vs pass^k

> What pass@k and pass^k measure when an AI agent runs the same task many times, and why the two numbers split apart, explained for your AI interview.

**In short:** pass@k is the chance that at least one of k tries on a task works. pass^k is the chance that all k tries work. They match at k=1, then pass@k rises and pass^k falls as k grows, so the right one depends on whether one good answer is enough.

AI and LLM interview question Q255, Evaluation and observability. Advanced, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/pass-at-k-vs-pass-power-k

## Say it in 30 seconds

pass@k asks whether at least one of k tries on a task works. pass^k asks whether every one of the k tries works. At one try they are the same number. As k grows, pass@k climbs and pass^k falls. So for a customer-facing agent I check pass^k, because customers expect the right answer every time. I use pass@k when one good answer is enough.

## Say it in 2 minutes

Both numbers come from running the same task several times. An AI agent is a model that uses tools to finish a job. Each run either passes the task's checks or fails. If 3 of 5 runs pass, the pass rate is 60%. pass@k and pass^k are two ways to count those runs.

pass@k is the chance that at least one of k runs passes. It fits when one good answer is enough, such as a draft that a person picks from. pass^k is the chance that all k runs pass. It fits when users expect the same result every time, such as a refund bot. The 2021 Codex paper, about a model trained to write code, used pass@k to score it. tau-bench, a 2024 test set for tool-using agents, proposed pass^k.

At k=1 both equal the plain pass rate. As k grows, pass@k rises and pass^k falls. In my made-up claims test, pass@3 was 87.5% and pass^3 was 35%. The same agent looks strong or weak depending on the count. So I say which metric I am reporting, and what k is.

Two caveats. pass@k only helps if something picks the right answer, like a test or a person. And every extra try costs money. For a refund bot I would still put a human check in front of any payment.

## What are pass@k and pass^k, in plain words?

pass@k and pass^k look alike, but they answer two different questions about the same runs. An AI agent is run several times on one task, and each run either passes the task's checks or fails. The k is how many runs you count together.

Picture a courier with five tries to deliver a parcel to a tricky address. If the question is whether they get there on at least one try, that is the pass@k view. If the customer needs every delivery to land right, that is the pass^k view.

Now the AI case. A claims agent at a mid-size insurer is tested on four claim tasks, five runs each. Across those 20 runs, 12 pass, so the pass rate is 60%. Whether that is good enough depends on which question the team asks.

- **Task:** One job the agent must do, with checks that say pass or fail.
- **Run (or trial):** One attempt at a task, start to finish.
- **Pass rate:** The share of runs that pass.
- **Eval:** A test for an AI system: give it an input, then grade its output.
- **k:** How many runs you count together, such as 3 or 5.

## How do pass@k and pass^k differ?

Anthropic's engineering team defines the two like this:

> "pass@k measures the likelihood that an agent gets at least one correct solution in k attempts." (Anthropic, Demystifying evals for AI agents)
>
> "pass^k measures the probability that all k trials succeed." (Anthropic, Demystifying evals for AI agents)

Both are chances, so each runs from 0% to 100%. With one try (k=1) they give the same answer, which is just the plain pass rate.

The 2021 Codex paper, about a model trained to write code, used pass@k to score it. Its rule is that a sample counts as correct when it passes a set of unit tests, which are small automatic checks of the code.

*Diagram, Two ways to count the same runs: Both counts start from the same runs of one task. pass@k asks whether any of the runs worked, so it climbs as you add runs. pass^k asks whether every run worked, so it falls.*
1. Use it when one good draft is enough.
2. Use it when users need the same answer every time.

## What happens to each as k grows?

pass@k climbs with k, because each extra try is one more chance. pass^k falls, because each extra try is one more way to fail.

Here is the arithmetic. An agent that passes 75% of single runs still passes three runs in a row only about 42% of the time, since 0.75 times 0.75 times 0.75 is about 0.42. Anthropic uses the same example.

Here is a small made-up check: four tasks, each run five times. The code counts the passes per task, then averages across the tasks. pass@k is one minus the chance that all k picked runs fail. pass^k is the chance that all k picked runs pass.

```python
# Made-up claims-triage eval: 4 tasks, each run 5 times (n = 5).
# c = how many of the 5 runs passed that task's checks.
from math import comb

n = 5
runs = {
    "Route claim to adjuster": 5,
    "Quote the policy excess": 4,
    "Check hospital bill": 2,
    "Draft refund reply": 1,
}

def pass_at_k(c, k):  # chance that at least one of k runs passes
    return 1 - comb(n - c, k) / comb(n, k)

def pass_power_k(c, k):  # chance that all k runs pass
    return comb(c, k) / comb(n, k)

for k in (1, 3):
    at_least = sum(pass_at_k(c, k) for c in runs.values()) / len(runs)
    every = sum(pass_power_k(c, k) for c in runs.values()) / len(runs)
    print(f"k={k}: pass@k {at_least:.1%}, pass^k {every:.1%}")

# At k=1 both metrics equal the plain average pass rate.
avg = sum(c / n for c in runs.values()) / len(runs)
assert abs(sum(pass_at_k(c, 1) for c in runs.values()) / len(runs) - avg) < 1e-9
assert abs(sum(pass_power_k(c, 1) for c in runs.values()) / len(runs) - avg) < 1e-9
print(f"k=1 average pass rate: {avg:.1%}")
```

Output:

```text
k=1: pass@k 60.0%, pass^k 60.0%
k=3: pass@k 87.5%, pass^k 35.0%
k=1 average pass rate: 60.0%
```

Read the output. At k=1 both metrics give 60%, the plain pass rate. At k=3, pass@k reaches 87.5%, but pass^k drops to 35%. The same runs make the agent look strong or weak, depending on the count.

The formulas come from the sources. The Codex paper's equation (1) gives a pass@k estimate that is right on average (unbiased). tau-bench, a 2024 test set for tool-using agents, proposed pass^k, averaged across tasks.

## Which one should you report?

- **Use pass@k: One good answer is enough.** Drafts a person picks from, or code that a test suite checks. More tries give more chances.
- **Use pass^k: Every answer must be right.** A refund bot or a claims check. One wrong run is one wrong outcome for a customer.

> "Both metrics are useful, and which to use depends on product requirements: pass@k for tools where one success matters, pass^k for agents where consistency is essential." (Anthropic, Demystifying evals for AI agents)
>
> "We also propose a new metric (pass^k) to evaluate the reliability of agent behavior over multiple trials." (tau-bench, 2024)

- **pass@k needs a picker:** It only helps if something chooses the right answer: a test, a checker or a person.
- **Every try costs:** k tries cost about k times as much in model calls, so a bigger k costs more.
- **The formula assumes separate runs:** The estimates count each run on its own, as an independent repeat with the same odds. If runs share state, read the numbers with care.

> **Tip:** Asked which to report? Name the metric, the k, and the product that needs it, such as pass^k for a refund bot.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain split: pass@k is at least one good try, pass^k is every try.
- [ ] Both come from repeated runs of the same task.
- [ ] They match at k=1 and split apart as k grows.
- [ ] The choice depends on whether one good answer is enough.
- [ ] A worked example, with the k and the numbers said out loud.
- [ ] Caveats: something must pick the winner, extra runs cost money, and the formula assumes separate runs.

**Common traps**

- Trap: "A 90% pass rate means it works 90% of the time." Better: A 90% pass rate means 9 in 10 runs passed on that task. Ask which k: if runs are independent, all five passing in a row is only about 59% (0.9 to the power 5).
- Trap: "A higher pass@k means the agent is more reliable." Better: pass@k is the chance that at least one of k tries works. It can hide runs that fail. For customers, check pass^k.
- Trap: "pass^k is just pass@k with another name." Better: They differ. pass@k needs one success, pass^k needs every run to succeed. In my example, at k=3, they were 87.5% and 35%.

## Can you pick the right number?

**Spot the wrong line:** Which statement about pass@k and pass^k is wrong?

A. pass@k rises as k grows, because more tries give more chances.
B. pass^k falls as k grows, because every try has to pass.
C. At k=1, pass@k and pass^k are the same number.
D. pass^k rises as k grows, since more runs prove the agent is steady.

**Answer:** D. More runs make pass^k harder to hit, not easier. Each extra try is one more chance to fail, so it falls as k grows.

**Quick check:** A refund bot gets at least one of five tries right 96% of the time, but gets all five right only 61% of the time. Which number should you check before customers use the bot?

A. pass@5, the 96%
B. pass^5, the 61%
C. The average of the two
D. Whichever one is higher

**Answer:** B. Customers expect the right answer every time, so pass^5 is the number to check. pass@5 would hide the runs that failed.

## Can you answer these from memory?

**Flash cards**

- **What is pass@k?** The chance that at least one of k tries on a task works.
- **What is pass^k?** The chance that all k tries on a task work.
- **Are they equal at k=1?** Yes. Both equal the plain pass rate for the task.
- **What happens as k grows?** pass@k rises. pass^k falls.
- **Which one for a refund bot?** pass^k, because customers need the right answer every time.
- **What does pass^k assume?** That each run is an independent repeat with the same odds.

## Likely follow-up questions

- Q256 Capability evals vs regression evals? https://designervenkat.online/interview/ai/capability-evals-vs-regression-evals
- Q257 How do you regression-test prompts? https://designervenkat.online/interview/ai/how-to-regression-test-prompts
- Q253 Exact match, accuracy and F1 for LLM tasks? https://designervenkat.online/interview/ai/exact-match-accuracy-and-f1-for-llm-tasks
- Q248 What is a golden dataset, and how do you build one? https://designervenkat.online/interview/ai/what-is-a-golden-dataset
- Q249 What is LLM-as-a-judge? https://designervenkat.online/interview/ai/what-is-llm-as-a-judge
