esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

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.

10 min readAdvancedCommon · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

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.

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.

Key words

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.

Two ways to count the same runs

Any of k runs

pass@k

one good run is enough

Every one of k runs

pass^k

one miss breaks the streak

Drafts a person picks

a reviewer chooses the best

Refund bot for customers

same right answer each time

  1. 1Use it when one good draft is enough.
  2. 2Use it when users need the same answer every time.
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.

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

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."

    BetterA 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."

    Betterpass@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."

    BetterThey 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?

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?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q256Capability evals vs regression evals?10 min
  2. Q257How do you regression-test prompts?12 min
  3. Q253Exact match, accuracy and F1 for LLM tasks?12 min
  4. Q248What is a golden dataset, and how do you build one?11 min
  5. Q249What is LLM-as-a-judge?12 min

Last updated on 26 November 2026

Building an agent that has to get it right every time?

I design and build AI agents, and the tests that show whether they work. Book a short call and tell me what yours needs to do.