This repo supports four methodologies:
- Parallel Sampling
- Sequential Refinement
- Harness Evolution
- Harness Scaling
Requirements:
- Python 3.13+
uvtmux(Harness Evolution long runs viascripts/evolve.sh)- access to the benchmark dataset path used in the config files
Install dependencies:
uv sync
cp .env.example .env # fill in API keys — see .env.example for the full listSet the required environment variables before running experiments:
export CLAUDE_API_KEY="your_api_key" # Scaling / Sequential / Parallel
export E2B_API_KEY="your_e2b_key"
export GITHUB_TOKEN="your_github_token"For Harness Evolution (configs/experiments/), also set GPT54_LLM_*, ANTHROPIC_*,
ADB_LLM_*, and SERPER_API_KEY as needed — see .env.example.
Update the path field in the config files under configs/our-experiments/
so it points to your local benchmark task directory.
Before the first Terminal-Bench 2.1 rollout, build E2B templates once:
uv run python scripts/build_templates.py --dataset-dir /path/to/terminal-bench-2-1/tasks -j 16First run the pass@k baseline:
uv run python run_code_agent_baseline.py \
--config configs/our-experiments/parallel-exp-claude-opus46-k5.yaml \
--experiment parallel-exp-claude-opus46-k5Then run blind rollout selection:
uv run python run_blind_rollout_selector.py \
--experiment-dir experiments/parallel-exp-claude-opus46-k5 \
--provider claude \
--name claude-reasoning-high-select-fullFinally audit the selected rollouts:
uv run python audit_blind_rollout_selection.py \
experiments/parallel-exp-claude-opus46-k5/blind_rollout_selector/claude-reasoning-high-select-fulluv run python evolve_seq.py \
--config configs/our-experiments/exp-seq-claude-opus46-local-iter5-c10.yaml \
--experiment exp-seq-claude-opus46-local-iter5-c10Use evolve_ahe.py for configs under configs/experiments/:
uv run python evolve_ahe.py --config configs/experiments/exp-simple-code-gpt54-w.yamlOr launch in tmux via the helper script:
./scripts/evolve.sh --attach configs/experiments/exp-simple-code-gpt54-w.yamlAfter a train-split run finishes, evaluate held-out test/val splits:
uv run python scripts/eval_held_out_iters.py \
--experiment <train-exp-dir> \
--test-config configs/experiments/exp-simple-code-gpt54-w-test.yaml \
--val-config configs/experiments/exp-simple-code-gpt54-w-val.yaml \
--splits test valResume or skip evaluation:
./scripts/evolve.sh \
--experiment <existing-exp-dir> \
--start-iteration 3 \
configs/experiments/exp-simple-code-gpt54-w.yamluv run python evolve.py \
--config configs/our-experiments/exp-per-task-claude-opus46-local-iter5-c10.yaml \
--experiment exp-per-task-claude-opus46-local-iter5-c10Experiment artifacts are written under experiments/. Important summary files
include:
baseline_summary.jsonandbaseline_summary.mdfor Parallel Samplingblind_rollout_selection_summary.jsonfor blind rollout selectioniteration_scores.md/iteration_scores.yamlfor evolution runsheld_out_scores.md/held_out_scores.yamlafter held-out evaluation- per-task workspaces and trajectory histories under
experiments/<name>/tasks/
- Harness Scaling configs live under
configs/our-experiments/; Harness Evolution configs live underconfigs/experiments/. - Two evolution entry points:
evolve.py— Harness Scaling (configs/our-experiments/)evolve_ahe.py— Harness Evolution (configs/experiments/)
- The provided configs use Claude-style or OpenAI-style API settings. To use another model, edit the corresponding config file.
- Large experiments can be resumed by reusing the same
--experimentname and passing the appropriate resume options supported by each script.