Repository navigation
Add an end-to-end agent training notebook: SFT, GRPO and AsyncGRPO on an OpenEnv game - #8751
Closed
behroozazarkhalili wants to merge 1 commit into
Closed
behroozazarkhalili wants to merge 1 commit into
behroozazarkhalili wants to merge 1 commit into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. Pages changed in this PR: |
Member
|
Closing, see #8686 (comment). SFT then GRPO on a TextArena env is covered by |
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.
This adds
examples/grpo_guess_the_number/grpo_guess_the_number.ipynband its row in the examples overview.The notebook trains Qwen3-0.6B with LoRA to play TextArena's GuessTheNumber through a tool, on an OpenEnv server it starts locally. SFT on scripted games comes first, then
GRPOTrainerwithenvironment_factoryandAsyncGRPOTrainerwith a vLLM server, both starting from the SFT model and evaluated on the same 50 held-out games. In the committed run, with 200 steps per stage on a 10 GB slice of an H100, the solve rate goes from 0% to 70% after SFT, then to 94% with GRPO and 100% with AsyncGRPO.The reward is 1 minus 0.1 per guess after the first for a win, and 0 for a loss. With a 0/1 reward the rollouts of a game soon all score 1 and AsyncGRPO drops those groups.
The AsyncGRPO stage needs a vLLM server and is skipped without one. The outputs come from one end-to-end run; I did not run it on a T4.
Note
Low Risk
Documentation and a self-contained example notebook only; no library or training-core code changes.
Overview
Adds
examples/grpo_guess_the_number/grpo_guess_the_number.ipynb, an end-to-end tutorial that trains Qwen3-0.6B with LoRA to play TextArena GuessTheNumber via a locally started OpenEnv server.The pipeline is three stages, each evaluated on the same 50 held-out games: SFT on mediocre scripted tool-calling traces (so RL still has reward variance), GRPO with
environment_factoryand in-process generation, then AsyncGRPO from the merged SFT checkpoint with a vLLM server (skipped ifvllmis missing). The notebook documents a guess-cost reward (wins penalized per extra guess) so AsyncGRPO does not drop constant-reward groups, and includes smoke-test configuration, committed benchmark outputs, and tree-packing metrics for AsyncGRPO.docs/source/example_overview.mdgains an index row for the new example, noting AsyncGRPO needs vLLM and is not runnable on free Colab.Reviewed by Cursor Bugbot for commit 1869157. Bugbot is set up for automated code reviews on this repo. Configure here.