Repository navigation
Train a Sudoku agent: SFT, then GRPO - #1554
Open
sergiopaniego wants to merge 2 commits into
Open
sergiopaniego wants to merge 2 commits into
sergiopaniego wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a2dd4ef. Configure here.
This branch has not been deployed
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 a Sudoku tutorial that follows the Wordle one (#1479): Qwen3-1.7B, an SFT warmup on solver-played games, then GRPO against the TextArena
Sudoku-v0environment, with oneplace(row, col, number)tool call per cell.examples/sudoku/: puzzles, SFT data, SFT, GRPO, evaluation, summary and GIF scripts, plus the 30 fixed evaluation puzzles at 26 and 16 empty cells.docs/source/tutorials/sudoku-grpo.md: the whole pipeline with the numbers, hardware and cost of our run (about $42 in total on Hugging Face Jobs).Results on the same 30 puzzles, greedy:
Models, data and curves: SFT, SFT + GRPO, dataset, trackio.
The "Long runs against a Space" section explains the mid-game reconnects we hit during GRPO, which led to #1536.
The two images point to
huggingface/documentation-images(openenv/sudoku-progress.gifandopenenv/sudoku-grpo-curve.png).Note
Low Risk
Changes are limited to documentation and standalone example scripts; no core OpenEnv runtime or training library code is modified in this diff.
Overview
Adds an end-to-end Train a Sudoku Agent path parallel to the Wordle tutorial: docs navigation and a long-form guide (
sudoku-grpo.md), plus a newexamples/sudoku/package.The example wires Qwen3-1.7B to TextArena
Sudoku-v0with oneplace(row, col, number)tool call per cell. Scripts cover puzzle generation, solver-driven SFT dataset export, SFT and GRPO (TRLGRPOTrainer+environment_factoryagainst a duplicated HF Space), greedy evaluation on fixedpuzzles_c55.json/puzzles_c65.json, summarization, and a side-by-side GIF helper. GRPO uses dual rewards (solved + cells-filled progress), memory-safe batching for ~16k-token games, and closes/reopens the Space client on every game to avoid mid-episode WebSocket drops corrupting training (documented alongside #1536).Doc updates link the tutorial from the Training sidebar and the tutorials index table; the guide includes run costs, hardware, and operational notes (Space env vars, Trackio, Hub artifacts).
Reviewed by Cursor Bugbot for commit a54055a. Bugbot is set up for automated code reviews on this repo. Configure here.