Files
prime-rl/examples/basic/wordle/README.md
T
faresobeidandGitHub 23017482f9 chore(configs): remove configs/basic and unreferenced debug configs (#3777)
Removes `configs/basic/` and the debug configs
`configs/debug/concurrency.toml` and `configs/debug/multi-env/`.

**Why:** `configs/basic/*` are dev-size copies of `examples/basic/*`,
and they have already drifted from them. For example,
`configs/basic/reverse-text/rl.toml` no longer has the eval block. The
remaining differences are GPU count, batch size and group size, which
can all be set from the CLI. No test runs these configs;
`test_configs.py` only checks that they parse, using a glob. Nothing in
the repo references the two debug configs, so they have no owner and
will drift the same way.

**Changes**
- Deleted
`configs/basic/{alphabet-sort,hendrycks-sanity,reverse-text,wiki-search,wordle}`,
`configs/debug/concurrency.toml`, and `configs/debug/multi-env/`. Kept
`configs/debug/{algo,eval,fake}`.
- `README.md`: the 2-GPU check now uses
`examples/basic/reverse-text/rl.toml`. That example already defaults to
1 trainer GPU + 1 inference GPU.
- `configs/README.md` / `examples/README.md`: removed the `basic/` and
`multi-env/` entries and the "smoke-tested" claim.
- `examples/basic/{wiki-search,wordle,hendrycks-sanity}/README.md`:
added the 2-GPU overrides `--deployment.num-train-gpus 1
--deployment.num-infer-gpus 1 --orchestrator.batch-size 128`. Inference
DP adjusts to the GPU count automatically.

**Breaking:** commands like `uv run rl @ configs/basic/...` no longer
work. Use `examples/basic/...`, with the overrides above for 2 GPUs.

**Validation**
- `rl @ examples/basic/{wiki-search,wordle,hendrycks-sanity}/rl.toml
--deployment.num-train-gpus 1 --deployment.num-infer-gpus 1
--orchestrator.batch-size 128 --dry-run`: all three resolve. For wordle,
the resolved inference has `data_parallel_size = 1`.
- `pytest tests/unit/test_configs.py -m "not gpu"`: 199 passed.
- `ruff check .` and `ruff format --check .`: clean.
- No GPU runs; this machine has no GPU.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation and config path removal only; users must switch to
example configs and optional CLI flags for 2-GPU dev runs.
> 
> **Overview**
> Removes duplicate **`configs/basic/`** tutorial configs and two
unreferenced debug configs (**`concurrency.toml`**,
**`multi-env/rl.toml`**), so **`examples/basic/`** is the single source
for small end-to-end runs.
> 
> **Breaking:** `uv run rl @ configs/basic/...` no longer works. The
root README’s 2-GPU stack check now uses
**`examples/basic/reverse-text/rl.toml`**. **`configs/README.md`**
documents **`debug/algo`**, **`fake`**, and **`eval`** only.
> 
> For former 2-GPU **`basic`** setups, **`hendrycks-sanity`**,
**`wiki-search`**, and **`wordle`** READMEs document CLI overrides:
`--deployment.num-train-gpus 1 --deployment.num-infer-gpus 1
--orchestrator.batch-size 128`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4776cecdef44708f93c73075a5d57b5eb87a007f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-10-03 12:37:05 -07:00

4.9 KiB

Wordle

In this example, we demonstrate how to train Qwen3-1.7B to play Wordle. This will require a SFT warmup to learn the format and, finally, multi-turn RL against the wordle taskset to improve performance.

The commands in this example were designed to be run on 2 GPUs (one trainer and one inference GPU). It is possible to run on less or more GPUs using different deployment strategies. If you run on a different setup, you may need to adjust the start commands.

Setup

The taskset is included through the Verifiers workspace. After syncing the repository, verify it with:

uv run python -c "import wordle"

We'll use two terminals: one for the inference server, one for everything else. To watch the run while it trains — metrics, resolved configs, rollout traces, and logs in one place — start the local dashboard and open http://localhost:7788:

uv run dashboard

Before training, we want to get a baseline score and test how well Qwen3-1.7B does out-of-the-box in the wordle environment so that we quantify our training effect. To do so, first start a local inference server to serve Qwen3-1.7B.

# Run this in the inference terminal
uv run inference --vllm.model Qwen/Qwen3-1.7B

Then, use the eval entrypoint to evaluate the model in the wordle environment. We evaluate on the 20 evaluation examples which are distinct words not appearing in the training set of the environment. We constrain the response length to 1024 tokens as this should be more than enough to play a full game.

# Run this in the other terminal
uv run eval @ examples/basic/wordle/eval.toml

We got an average reward of ~0.2 across the 20x3 rollouts. From the summary, we can see that the most of the reward is coming from format and partial rewards. In fact, the model does not guess the correct word within any game, leading to a win rate of 0%. Looking at some samples, it is evident repeatedly submitting guesses in the wrong format and is not able to revise its strategy from the environment feedback. Let's do some SFT warmup to get the model to learn the format of the environment.

SFT

We will fine-tune PrimeIntellect/Qwen3-1.7B (HF), which is a clone of Qwen/Qwen3-1.7B (HF) with a chat template suitable for multi-turn RL, on willcb/V3-wordle (HF). It is a multi-SFT dataset with traces of Wordle games from the environment. A few steps should be enough to get the model to learn the expected response format of the environment.

Check out the logs of the SFT run on W&B.

To train on a single GPU, run

# Run this in the other terminal
uv run sft @ examples/basic/wordle/sft.toml \
  --run.name sft \
  --monitors.wandb.project ... \
  --monitors.wandb.name ...

To train on multiple GPUs, run

# Run this in the other terminal
uv run torchrun \
  --local-ranks-filter 0 \
  --nproc-per-node ... \
  src/prime_rl/trainer/sft/train.py @ examples/basic/wordle/sft.toml \
  --monitors.wandb.project ... \
  --monitors.wandb.name ... 

After training completes, you will find the final DCP checkpoint in outputs/sft/checkpoints/step_20.

We have uploaded the final model as PrimeIntellect/Qwen3-1.7B-Wordle-SFT.

RL

Finally, we will do multi-turn RL against the wordle environment using the model PrimeIntellect/Qwen3-1.7B-Wordle-SFT (HF), we obtained from the SFT warmup. We will do sizable RL training, with 100 training steps, each generating training batches of 32x16 rollouts, for a total batch size of 512, at a context length of 4096.

Check out the logs of the RL run on W&B.

# Run this in the other terminal
uv run rl @ examples/basic/wordle/rl.toml \
  --model.name ... \
  --run.name rl \
  --monitors.wandb.project ... \
  --monitors.wandb.name ... 

This config runs on 8 GPUs (6 for inference, 2 for training). To run on 2 GPUs (1 inference, 1 trainer), add --deployment.num-train-gpus 1 --deployment.num-infer-gpus 1 --orchestrator.batch-size 128.

This will write a DCP checkpoint in outputs/rl/checkpoints/step_100.

We have uploaded the final model as PrimeIntellect/Qwen3-1.7B-Wordle-RL.

Evals

Let's see how our final RL checkpoint performs on the eval set.

# Run this in the inference terminal
uv run inference --vllm.model PrimeIntellect/Qwen3-1.7B-Wordle-RL
# Run this in the other terminal
uv run eval @ examples/basic/wordle/eval.toml -m PrimeIntellect/Qwen3-1.7B-Wordle-RL

Way better! Our model now wins ~60% and gets an average reward of ~1.5.