Repository navigation
Add an RL evaluation example - #908
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Adds
example/rl-eval/, a single Python script that uses the public/v1Agents API as a rollout engine for RL and evaluation.Each rollout is one hosted Session with network
disabled: the task files go in as inline initial files, the instruction asinput, and the answer comes back as the Artifact/workspace/outputs/answer.json. The script grades it outside the sandbox (expected.jsonnever enters it), records the Items and Turn usage, deletes the Session, and appends one JSONL row per rollout. It runs a Harness × model × K-sample matrix in parallel, handles timeouts by cancelling the Turn, and prints mean reward and pass@k.--model-base-urlwith{rollout_id}points rollouts at a training-side inference server, which is where token ids and logprobs are recorded.Five bundled tasks (CSV aggregation, log counting, a small bug fix, nested JSON, SQLite) need only the managed sandbox image. Tasks graded inside their own container (SWE-bench, Terminal-Bench) need
self_hostedand are out of scope.Also:
docs/examples.md(+ zh) gets an "RL and evaluation rollouts" section;CONTRIBUTING.mdnames the example's owner and boundary.make check-exampleruns the example's unit tests;scripts/ci_plan.pyroutes.py/.shunderexample/to the example job.Verification
python3 example/rl-eval/rl_eval_test.py: 9 tests pass (grading, pass@k, summary, task loading).scripts/ci_plan_test.pyandcore-distribution-manifest.test.py BundledDocsTestspass.--harness codex --harness claude_sdk --samples 2: 20/20 rollouts completed with reward 1.0 (table in the README).--harness claude_sdk --model MiniMax-M2.7 --model-base-url … --model-protocol anthropic: 5/5 with reward 1.0 through the per-rollout provider path.--timeout 8: the rollout is recorded astimeoutwith its usage and Items; the Turn is cancelled and the Session deleted.errorand the batch continues.Need help on this PR? Tag
@codesmith-botwith what you need.