Start here
New to RL for LLMs? Take these in order.
- Learn the classic loopAgent observes a state, takes an action, gets a reward. Do the first units of the HF Deep RL course or skim Spinning Up.
- See how it maps onto LLMsThe model is the agent, a multi-turn conversation is the episode, tool calls are actions, and a verifier is the reward. Read the anatomy section below.
- Understand GRPOMost open reasoning results use GRPO or a variant of it: sample a group of answers per prompt and reward each one relative to the group. Read the DeepSeekMath and DeepSeek-R1 papers.
- Run one environment locallyInstall a framework that does most of the work for you (
pip install verifiers) or a bare one (pip install openenv-core), then run a toy environment end to end. - Train something smallWire that environment into TRL's GRPO trainer with a small model and watch the reward curve move.
- Scale outMove the environment onto its own CPU nodes behind HTTP, run many copies at once, and harden your reward against hacking.
The anatomy of an LLM RL system
Classic RL environments are tiny: CartPole is four numbers in and two actions out. In the LLM era the environment is a sandbox with tools, and an episode is a whole conversation. Every training system, whichever framework you use, sits on the same five stages:
Environment frameworks
Libraries for defining an environment: its tools, its state, and how it scores an episode.
There are two designs. HTTP frameworks run the environment as a separate server, so it can live on cheap CPU nodes and scale on its own. In-process frameworks run it as Python inside the training process: simpler, but it shares the GPU node and its dependencies.
| Framework | From | Design | Install | Best for |
|---|---|---|---|---|
| OpenEnv | Meta PyTorch + HF | HTTP · MCP | openenv-core | A thin standard protocol; you bring the tasks and the trainer. Deploys to HF Spaces. |
| Verifiers | Prime Intellect | In-process | verifiers | Most included: dataset, tools, rubric and rollouts in one place. Pairs with prime-rl. |
| NeMo Gym | NVIDIA | HTTP | nemo_gym | Large production setups built on Ray. Expect heavier dependencies. |
| ORS | OpenReward | HTTP | ors-sdk | A deployment protocol with the reward attached to each tool result. |
| SkyRL Gym | NovaSky (Berkeley) | In-process | skyrl-gym | Gym-style step() environments inside the SkyRL training stack. |
| GEM | Axon RL | In-process | gem-llm | A Gymnasium-style API with many built-in games and tasks. You bring the trainer. |
| Atropos | Nous Research | Env-driven | git | Environments run their own inference and post scored batches to a central API. |
| rLLM | Agentica | Wrapper | rllm | Wraps existing agent code and records its LLM calls for training. |
| RAGEN | RAGEN team | Full stack | git | Environment, the StarPO algorithm and veRL together. Multi-turn agent RL research. |
Environment hubs
Where you can find ready-made environments to plug into a training run.
Trainers
These turn rollouts into gradient updates. Pick one based on scale and what's already in your stack.
Tasks & verifiers
Problem generators and checkers. They give you a reward signal without a full environment.
generate() / verify() interface.Agentic environments & benchmarks
Long multi-step tasks in real sandboxes, where agent RL is heading.
Papers
A short reading list, roughly in the order the ideas appeared.
| Paper | Year | Why read it |
|---|---|---|
| PPO | 2017 | The workhorse policy-gradient method that RLHF was built on. |
| InstructGPT | 2022 | The RLHF recipe: SFT, then a reward model, then PPO. |
| DPO | 2023 | Learns from preferences without an RL loop. Useful as a contrast. |
| DeepSeekMath | 2024 | Introduces GRPO: advantages relative to the group, so no critic model is needed. |
| Tülu 3 | 2024 | Names RLVR: rewards from verifiable answers instead of a learned reward model. |
| DeepSeek-R1 | 2025 | Shows that RL alone can produce long chain-of-thought reasoning. |
| DAPO | 2025 | Practical GRPO fixes: clip-higher, dynamic sampling, token-level loss. |
Courses & books
How to pick a framework
| If you… | Start with |
|---|---|
| want the fewest moving parts | Verifiers + prime-rl, or GEM + TRL |
| want one environment many trainers can use | OpenEnv (MCP over HTTP, deploys to HF Spaces) |
| run large Ray clusters | NeMo Gym, or veRL with your own environment server |
| train coding agents in containers | Harbor or SWE-Gym environments with SkyRL or veRL |
| just need a reward for maths or logic | Reasoning Gym or Math-Verify with TRL GRPO |
Any of these can express the same environment. What really differs is how it connects to your trainer and how much of the stack you want to own.