Evaluating agents

How to tell honestly whether a new build is better than the old one.

The ladder is noisy. Your local evaluator is less noisy. But even the evaluator can lie if you use it carelessly. Here's how to run it so the answers mean something.

The golden rule

Trust a difference only when it's larger than the ± column of the output.

run2/agent.npz vs run1/agent.npz : +83 ± 29 bb/100

+83 ± 29 means roughly 95% confident the difference is positive. You can keep run2.

run2/agent.npz vs run1/agent.npz : +40 ± 55 bb/100

+40 ± 55 means the difference might be zero, or even negative. Don't claim improvement.

Scale deals to the question you're asking

Noise shrinks as 1/sqrt(deals). Rough numbers for heads-up NLHE with all-in EV:

deals± at 95% CI
1,000~60 bb/100
3,000~35 bb/100
5,000~27 bb/100
10,000~20 bb/100
30,000~11 bb/100

Pick deals based on how small a difference you're trying to resolve. If you expect +20 bb/100 between builds, 5000 deals won't settle it; you need 30,000+.

python tools/evaluate.py new.npz --vs old.npz --deals 10000 --jobs 8

Evaluate against a set, not a single opponent

A new build that beats only one specific opponent might be a specialist. Run the eval against several opponents and look at the aggregate:

for opp in baselines/baseline.npz EquityBot CallingStation runs/v3/agent.npz; do
    python tools/evaluate.py new.npz --vs "$opp" --deals 5000 --jobs 8
done

A new build worth keeping usually wins (or at least holds) against all of these. One that wins +500 vs. the baseline but loses −200 vs. a generic opponent is a specialist — it might still be useful, but it's not a strict upgrade.

Use parallel jobs

--jobs N runs matches on N cores. Typical 8-core machines finish 10,000-deal evals in minutes. Set it to your physical core count; hyper-threads don't help as much as you'd hope.

Compare against previous versions, not only "the best"

Track a rolling comparison across your own run:

  • v3 vs v2
  • v4 vs v3
  • v4 vs v2

If v4 beats v3 (+50 ± 20) but loses to v2 (−80 ± 20), you've got a non-transitive progression — progress stalled. Roll back and rethink the training setup.

Don't evaluate against yourself

An agent vs. a frozen copy of itself produces close to 0 bb/100 by construction. It's useless as a progress signal. Always evaluate against different opponents.

The ladder is not your evaluator

Ladder matches update your rating — don't use them to A/B builds. The matchmaker won't give you consistent opponents, and each match is one small observation.

Workflow that scales:

  1. Train a candidate.
  2. Evaluate locally against a fixed opponent set.
  3. If it wins by more than the error bar, upload.
  4. Watch the ladder rating converge over many matches — that's the independent confirmation, not the signal.