Skip to main content
The book builds agentrl one #@save block at a time. Each entry links to the chapter that derives it. Regenerate the package with python3 scripts/build_library.py.

2. Reinforcement Learning Fundamentals

3. Language Models as Policies

4. Environments and Tools: the BugFix Gym

5. Trajectories, Templates, and Masks

6. Policy Gradients

7. Advantages and Credit Assignment

8. PPO: Reusing Samples Safely

9. GRPO and the Critic-Free Family

10. KL, Entropy, and Regularization

11. Rewards, Verifiers, and Reward Hacking

12. Multi-Turn Agents and Long Horizons

13. Rollout Systems and Off-Policy Correction

14. Scaling and Efficiency

15. SFT, Rejection Sampling, and Preferences

16. Distillation for Agents

17. Evaluation

18. Debugging RL Runs

A. Mathematical Tools