Repository navigation
Conversation
Add a frozen Harbor task adapter, Docker-isolated Terminus-2 harness, Qwen3.5-9B training and evaluation recipes, and CPU/Docker coverage. Reuse the existing Verifiers bridge without changing TitanRL core or importing training-data evolution artifacts. Co-authored-by: Yichuan Wang <[email protected]> Co-authored-by: Shuhua Yu <[email protected]>
wwwjn
added a commit
that referenced
this pull request
Oct 9, 2026
…-A3B) (#4942) Human Note: - This PR is using Agent-in-sandbox pattern. - End to end run verified using coreweave cluster. ## Summary Adds a Terminal-Bench 2.1 example: the task adapter under `torchtitan/rl/examples/verifiers/terminal_bench`, the recipes in `torchtitan_recipes/rl/verifiers_terminal_bench.py`, using the existing TitanRL/Verifiers bridge. Verifiers runs a Docker-isolated Terminus-2 agent and the Harbor verifier; TitanRL handles rollout grouping, generation, and training. TitanRL's core is unchanged. This PR contains the whole experiment: the implementation from #4888 (commit `b758984eb`, unchanged), four fixes for rollouts that report `reward=0.000` without the model having failed, and training recipes for Qwen3.5-9B and Qwen3.5-35B-A3B. - Training and validation tasks are Harbor datasets selected by id (`org/name@ref`), fetched and cached by the `harbor` CLI the way Verifiers does it; the recipe refuses to run if the two are the same dataset. The task-specific XML harness stays inside this experiment. - Two model sizes share the datasets, sampling, loop and optimizer settings. Each recipe is one self-contained config in `torchtitan_recipes/rl/verifiers_terminal_bench.py`. Both train on `local/tmax@v1` (AI2 TMax, converted by `prepare_tmax.py` into `~/.cache/harbor/local_tmax_v1`) and validate on `terminal-bench/terminal-bench-2-1`. - Validation over the 89 Terminal-Bench 2.1 tasks runs at the start and end of training, so there is no separate eval-only config. - Setup, fidelity limits and open dependencies are documented in the experiment README. ## **100-step run (Qwen3.5-9B-Base, TMax-15K, stock Verifiers Terminus-2, lr 1e-6)** | | step 0 (base) | step 100 | |---|---|---| | held-out reward (507 unseen tasks x 8 rollouts) | 0.334 | **0.417** | | held-out pass@8 | 0.586 | 0.655 | | training reward (mean over steps 1-50 → 51-100) | 0.344 | 0.393 | - On held-out tasks, reward goes up by +0.083 +- 0.008 (11 SE) after 100 steps. The step-100 policy is better on 217 tasks and worse on 46. - Most of the gain is the policy finishing tasks within the 30-turn cap more often, with the same accuracy when it finishes. The held-out reward is the clearest evidence that training works: the per-step training curve is noisy because each step trains on 16 new tasks. Here are the internal wandb links in case the summary stays internal; I left them out above in case it's the public PR: - 100-step training run: https://meta.wandb.io/jianiw/titanrl_tb35b_sweep/runs/t2f08wy3 - Held-out reward vs training step: https://meta.wandb.io/jianiw/titanrl_tb35b_sweep/runs/04kwm6md Note the above run is slightly different some verifiers stock verison. The above run used agent-outside-sandbox due to network fireware restriction. We also verified the code runs for agent-in-sandbox (the PR version as-is): https://meta-fair.wandb.io/jianiw/sandoq-terminal-bench-agent-in-sandbox/workspace?nw=nwuserjianiw ## Known gaps / follow-ups - Daytona is not supported by Verifiers 0.3.1. This experiment uses Docker. - Datasets are fetched by Harbor id into `~/.cache/harbor`. A cluster without access to the Harbor Hub can pre-populate that cache; loading from an arbitrary local path is not supported here. - The published TB2.1 images do not all ship `tmux`; Harbor's Terminus-2 session installs it at run time, so the task container needs network then, as scoring already does. - Mainline TitanRL uses GRPO rather than the colleague run's DPPO trust-region loss, uses independent generator replicas rather than one eight-way DP generator, and does not offer the same per-group KV-cache salting or dedicated asynchronous periodic validation. - Evaluation is greedy pass@1, not the colleague's pass@5. Comparable results need pinned task/image revisions and a live GPU run against the same checkpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
torchtitan/rl/experiments/verifiers/terminal_bench, using the existing TitanRL/Verifiers bridge. Verifiers runs a Docker-isolated Terminus-2 agent and Harbor verifier; TitanRL handles rollout grouping, generation, and training.Why
This makes the colleague branch's Terminal-Bench workflow available as a scoped TorchTitan experiment using the Verifiers integration already on
main, while preserving the mainline RL interfaces and keeping experimental data generation out of the upstream codebase.Validation
24 passedacross the new tests and existing Verifiers tests, including a Docker Harbor grading smoke test and parsing all 89 published Terminal-Bench 2.1 tasks.pre-commit run --all-filespassed withpyrefly-check,lychee-link-checkerskipped. Pyrefly cannot complete in this environment because of pre-existing missing dependencies and its configured unused-ignore rewrite; external link checking was not run.Known gaps / follow-ups
tmux.