30 min

What it takes to say a policy works

A success rate is an estimate with a denominator, an uncertainty and a protocol, and all three belong in the claim.

Where you are. You can train ACT and Diffusion Policy on your own demonstrations. This lesson is about the sentence you write afterwards, which is the part everyone else will actually read.

Friday’s number and Monday’s number

Six o’clock on a Friday. The checkpoint finishes, you run it ten times on cube-to-bin, and nine of the ten work. You screen-record the good one, write 90% success, and post it.

Monday morning, someone else runs the same checkpoint on the same rig. Six work.

Nothing changed. Same weights, same camera, same cube, same lighting. The number moved thirty points, and neither of you did anything wrong. Ten is a very small number, and what you measured on Friday was never the thing you wrote down.

The idea in one paragraph

A success rate is not a score, it is an estimate. You are guessing at the bias of a coin from a handful of flips, and every such guess comes with a range of biases consistent with what you saw. At ten trials that range is roughly forty-five points wide, which is wider than nearly any policy difference worth arguing about. So the bare number is not a claim. The claim is the number, the trial count under it, the interval around it, and the protocol that produced all three. Writing less than that is not brevity; it is publishing something that will not survive being rerun.

A success rate is a coin, not a score

Each trial either works or it does not, and the trials are independent given a fixed policy and a fixed reset distribution. That makes the count of successes a binomial quantity, and the thing you want, the policy’s true success rate, is the binomial’s unknown parameter. You never observe it. You observe kk successes out of nn, and you infer.

The standard way to state what you can infer is a confidence interval: the range of true rates that would have made your observation unsurprising. For a proportion, use the Wilson score interval,

interval=p^+z22n1+z2n  ±  z1+z2np^(1p^)n+z24n2\text{interval} = \frac{\hat{p} + \frac{z^{2}}{2n}}{1 + \frac{z^{2}}{n}} \;\pm\; \frac{z}{1 + \frac{z^{2}}{n}}\sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^{2}}{4n^{2}}}

where p^=k/n\hat{p} = k/n is what you observed and z=1.96z = 1.96 for 95% confidence. In words: shrink the observed rate a little towards one half, by an amount that matters only when nn is small, then put a band around it whose width falls roughly as 1/n1/\sqrt{n}. That last part is the whole economics of evaluation. Halving the width costs four times the trials.

image/svg+xml Matplotlib v3.11.1, https://matplotlib.org/ 5 10 20 50 100 200 trials run 40% 60% 80% 100% true success rate consistent with the result 0.45 0.34 0.22 0.16 0.11 every dashed-line result is a reported 80%. At 10 trials it means anywhere from 49% to 94%.
The 95% interval around an observed 80% success rate, from 5 trials to 300

TrialsSuccesses95% intervalWidth
10849% to 94%45 points
201658% to 92%34 points
504067% to 89%22 points
1008071% to 87%16 points
20016074% to 85%11 points

The claim the field makes most often

Now put two policies side by side. Yours got 90%, the baseline got 80%, ten trials each. That is the single most common shape of claim in robot learning, and it is one trial of difference.

image/svg+xml Matplotlib v3.11.1, https://matplotlib.org/ n = 10 n = 20 n = 50 n = 100 n = 200 40% 60% 80% 100% true success rate consistent with the result the new policy the baseline two-sided exact test on each pair p = 1.000 p = 0.661 p = 0.262 p = 0.073 p = 0.007
Two policies at 90% and 80% with their 95% intervals, at five different trial counts

Run the exact test on that pair and the p-value is 1.000. Not 0.06, not “trending”. One. At twenty trials it is 0.661, at fifty 0.262, at a hundred 0.073. The gap only becomes something you can state at around two hundred trials per policy, and that is not an accident of these particular numbers; it is what the arithmetic of proportions costs.

The gap you want to claimTrials needed, per policy
90% against 85%686
90% against 80%199
90% against 75%100
90% against 70%62

Two spreads, not one

There is a second source of variation that trial counts do nothing about. Retrain the same architecture on the same data with a different random seed and you get a different policy, sometimes a materially different one. That variation lives between training runs, not between trials.

Conflating them is the standard mistake. Twenty trials on one seed tells you about that one policy, tightly, and nothing at all about the recipe. Report both: at least three training seeds per configuration, and quote the seed-to-seed spread separately from the trial-to-trial interval. If the seeds disagree more than the trials do, your headline number is a property of a lucky initialisation.

Looking early is a decision

Here is the failure with the widest blast radius. You planned twenty trials, you are at trial fourteen, the new policy is ahead, and you stop.

That is not laziness. It feels like efficiency, and it silently breaks the test. Every extra look is another chance for noise to cross your threshold, so the rate at which you declare a winner between two policies that are genuinely identical climbs with the number of looks.

image/svg+xml Matplotlib v3.11.1, https://matplotlib.org/ 0% 5% 10% 15% experiments declaring a winner between two identical policies fix n = 40, test once peek every 10 trials peek every 5 trials peek after every trial the 5% you thought you were buying 2.8% 6.0% 8.0% 11.0%
How often a comparison between two identical policies declares a winner, by how often the running score is checked

Those bars are measured, not asserted: two simulated policies both truly at 70%, forty trials each, a hundred thousand simulated experiments. Fixing nn in advance and testing once declares a winner 2.8% of the time. Checking the running score after every trial and stopping at the first significant result declares one 11.0% of the time. Same data, same test, four times the false wins, purely from when you looked. (The honest bar lands below 5% rather than on it because the exact test is conservative on small counts. Compare the bars against each other, not against the line.)

What you sampled is part of the claim

A policy does not have one success rate. It has a success rate over a distribution of initial conditions, and you chose that distribution. Cube always at the same spot, one lighting condition, one background: the number is real, and it describes a much smaller world than the sentence implies.

So list the factors you varied, with ranges, and list the ones you froze. The frozen list is the more informative one.

Who ran it, and whether they knew

The last piece is social rather than statistical. You configured the baseline, you know which policy is running, and you decide when a marginal trial counts as a success. None of that requires bad faith to bias a result.

You will not have seven institutions. You can still interleave the policies instead of running all of A then all of B, hide which is which from whoever scores the trial, and pick your checkpoint on a held-out split rather than on the test rollouts. That last one matters more than it sounds: choosing the checkpoint that scored best on your evaluation set turns the evaluation into part of training, and the number stops being an estimate of anything.

protocol frozen Decide before any trial exists n fixed before the first trial seed list and factor ranges success rule written down checkpoint from held-out loss Run nothing is decided here conditions drawn from the seeds policies interleaved, never blocked nobody watches the running score Report the claim you can defend k out of n, with a 95% interval spread over at least three seeds failure modes, not just the count config and seeds published going back to change any of it starts a new experiment, with a new n
An evaluation protocol split by a freeze line: what is decided before the first trial, what happens during, and what gets reported

Wider than the screen; scroll it sideways.

Everything above collapses into one discipline: decide the whole protocol before the first trial exists, and treat any later change as the start of a new experiment rather than an edit to this one.

Review

A success rate is an estimate, not a score

A success rate is not a score, it is an estimate. Each trial either works or it does not, so the count of successes is a binomial quantity and the policy’s true rate is the parameter you never observe. You see so many successes out of so many trials, and you infer. The honest statement is a confidence interval: the range of true rates that would have made your observation unsurprising. Eight out of ten does not mean about eighty percent. It means somewhere between one in two and nineteen in twenty, and you cannot tell which. That band is forty-five points wide at ten trials, and it narrows only as one over the square root of the trial count, so halving the width costs four times the trials. That is the whole economics of evaluation.

Ten trials cannot separate ninety from eighty

Put two policies side by side, yours at ninety percent and the baseline at eighty, ten trials each. That is the single most common shape of claim in robot learning, and it is one trial of difference. Run the exact test and the p-value is one. Not zero point zero six, not trending. One. At twenty trials it is zero point six six, at fifty zero point two six, at a hundred zero point zero seven. Separating ninety from eighty takes about two hundred trials per policy, and ninety from eighty-five takes closer to seven hundred. You are not required to run two hundred. You are required to say which row your claim sits in. Ours reached eighteen of twenty and the baseline sixteen, which this many trials cannot separate, is a perfectly good sentence.

The two ways an honest-looking number goes wrong

Two failures survive any amount of care about the arithmetic. The first is looking early. You planned twenty trials, you are at fourteen, the new policy is ahead, and you stop. Every extra look gives noise another chance to cross the threshold. Measured on two policies both truly at seventy percent: fixing the trial count in advance declares a false winner two point eight percent of the time, and checking after every trial declares one eleven percent of the time. Same data, same test, four times the false wins, purely from when you looked. The second is the distribution you sampled. A policy has a success rate over the initial conditions you chose, so list the factors you varied and the ones you froze; the frozen list is the more informative one. And keep the seed- to-seed spread separate from the trial-to-trial spread, because no number of trials touches the first.

Check yourself

1. Your policy succeeds in 18 of 20 trials. What is the honest one-line claim?

“18/20, a 95% Wilson interval of 70% to 97%.” The point estimate is 90%, but the data are also consistent with a true rate of 71%, so writing “90%” alone overstates what you measured by a lot. Never report a rate without its nn; “70%” over 10 trials and over 200 trials are different claims that print identically.

2. Why does halving the width of your interval cost four times as many trials, rather than twice?

The width shrinks like 1/n1/\sqrt{n}, because the standard error of a proportion is p^(1p^)/n\sqrt{\hat{p}(1-\hat{p})/n}. To halve 1/n1/\sqrt{n} you must quadruple nn. This is why evaluation budgets blow up so fast, and why it is worth deciding in advance how large a difference you actually need to detect.

3. You are 14 trials into a planned 20 and the new policy is clearly ahead. Why is stopping there not free?

The test you are about to run assumed a fixed nn chosen before the data existed. Stopping at the first moment the result looks good gives noise many chances to cross the threshold instead of one, so the false-win rate climbs; measured on two identical 70% policies over 40 trials, it went from 2.8% to 11.0%. If you genuinely need to stop early, use a sequential test designed to remain valid under optional stopping.

4. What is the difference between trial-to-trial variance and seed-to-seed variance, and why must you report them separately?

Trial-to-trial variance is the coin flip within a fixed policy; more trials shrink it. Seed-to-seed variance is the difference between policies produced by retraining the same recipe with different random seeds, and no number of trials touches it. Reporting a tight interval from one seed tells the reader about that one checkpoint while implying something about the method, which is a different and unsupported claim.

5. You evaluate with the cube in one fixed start pose and report 95%. What claim have you actually made?

That the policy succeeds 95% of the time from that one initial condition, under the lighting and background you happened to have. Real performance lives over a combinatorial space of poses, viewpoints and lighting, and a single frozen condition samples one point of it. The fix is not necessarily more trials; it is stating which factors you varied and which you froze, so a reader can see the size of the world your number describes.

6. Why is picking the best checkpoint by its score on your evaluation rollouts a problem, even with a large nn?

Because that score is then a maximum over many checkpoints rather than an estimate of one, so it is biased upward, and the bias grows with the number of checkpoints you tried. It is training on the test set with extra steps. Select the checkpoint on a held-out validation split, then run the evaluation once on the checkpoint you already chose.

Do this

Run the arithmetic yourself. Open code/trial_math.py, fill in the three functions marked TODO(you) (the Wilson interval, the sample-size formula, and the peeking loop), then:

python module-03-robot-learning/code/trial_math.py

It takes about ten seconds and prints three blocks. Before you look at the second one, write down your guess for how many trials it takes to separate 90% from 80% at 80% power. Then answer three questions in your lab notes:

  1. Your last training run’s success rate: what is its 95% interval? Would it separate from a baseline five points below it?
  2. At the trial count you can actually afford on your rig, what is the smallest gap you could honestly claim?
  3. Pick a robot-learning demo video or paper you find convincing. Find its trial count. If it is not stated, that absence is itself the finding.

The reference implementation is in solutions/trial_math.py, with assertions that pin the numbers quoted in this lesson.

What you can now do

You can turn a raw success count into a claim: an interval instead of a point, a stated nn, a seed spread reported separately from the trial spread, and an explicit list of what varied and what was frozen. You can recognise the two ways an honest-looking comparison goes wrong, by peeking and by narrow sampling, and you can say what it would cost in trials to make the comparison you want. The next lesson turns this discipline into code, so that none of it depends on you remembering.

What you can now do

You can state a policy's success rate as something you can defend: with its trial count, its interval, its seed spread, and the protocol that produced it.