Skip to content

Multi-seed statistics

Single-seed deltas are noise until proven otherwise. The template makes the honest version — N seeds, paired tests, effect sizes — a two-command workflow:

flowchart LR
    A["run_seeds.sh<br><i>ours, seeds 42…1337</i>"] --> M1["seed_42/metrics.json<br>seed_123/ · seed_456/ · …"]
    B["run_seeds.sh<br><i>baseline, same seeds</i>"] --> M2["seed_42/ · seed_123/ · …"]
    M1 --> AG["aggregate_seeds.py"]
    M2 -->|--baseline| AG
    AG --> R["mean ± std · 95% bootstrap CI<br>paired Wilcoxon · Cohen's d"]

1. Run the seeds

# locally, sequential
bash scripts/run_seeds.sh experiment=ours seeds="42,123,456,789,1337,7,31,99"

# on SLURM, parallel (one array task per seed)
sbatch scripts/sbatch_seeds.sh experiment=ours

Each seed writes outputs/multi_seed_<stamp>/seed_<s>/metrics.json (train.py saves it at the end of every run).

For a paired comparison, run the baseline with the same seeds:

bash scripts/run_seeds.sh experiment=baseline seeds="42,123,456,789,1337,7,31,99"

2. Aggregate

uv run python scripts/aggregate_seeds.py outputs/multi_seed_ours \
    --baseline outputs/multi_seed_baseline --metric val/acc
Metric: val/acc
Mean:   0.9234 ± 0.0045
95% CI: [0.9145, 0.9310]

--- Paired Comparison ---
Ours:     0.9234 ± 0.0045
Baseline: 0.8912 ± 0.0051
Delta:    +0.0322 **
Test:     Wilcoxon signed-rank
Stat:     0.0000, p=0.0079
Effect:   Cohen's d = 6.712
Significant at p<0.01

What's underneath (src/<pkg>/utils/stats.py)

  • Bootstrap CI (10k resamples) for the mean — no normality assumption.
  • Wilcoxon signed-rank by default (non-parametric, paired); falls back to a paired t-test below 6 seeds, where Wilcoxon can't reach significance anyway.
  • Cohen's d so reviewers see magnitude, not just a p-value.

The functions take plain lists — reuse them for any paired comparison (per-dataset benchmark scores, ablations), as the tabular benchmark aggregator does. What each of these numbers actually tells you — and when it misleads — is on Statistics, explained.

Reporting checklist

  • Report mean ± std (N seeds) and the test used: "0.923 ± 0.005 vs 0.891 ± 0.005, p < 0.01, Wilcoxon signed-rank over 8 shared seeds."
  • Same seeds for both methods — that's what "paired" means.
  • 5 seeds is the floor for a claim (the aggregator uses a paired t-test there); 8+ lets Wilcoxon speak, and more is better when the delta is small relative to the std.
  • Decide the metric you'll test on before running.