Reinforcement Learning Resources: Courses, Books, Libraries and Environments (2027 Guide)
A curated, opinionated map of the best reinforcement learning resources: free courses, legally free books, Python libraries, simulation environments, landmark papers and project ideas, organized into a staged roadmap from your first Q-table to PPO, offline RL and RL for large language models.
Last reviewed: December 2026
Reinforcement learning (RL) is the branch of machine learning where an agent learns by trial and error, collecting rewards from an environment instead of labels from a dataset. It powers game-playing systems like AlphaGo, robot locomotion trained in simulation, and the “RL from human feedback” and “RL with verifiable rewards” stages that turn pretrained language models into reasoning assistants. The field is also famous for being hard to get into: the math is dense, results are noisy, and many tutorials are outdated (OpenAI Gym, for example, was replaced by Gymnasium years ago). This guide collects the reinforcement learning courses, books, libraries and environments that are worth your time today, explains what each one is best for, and puts them in an order that works.
Everything listed here was checked during the December 2026 review. Paid resources are marked (paid). Every free book listed is hosted by its authors or publisher.
Table of Contents
- Who This Guide Is For
- Prerequisites (and Where to Patch Gaps)
- The Roadmap at a Glance
- Stage 0: Intuition (1 week)
- Stage 1: Tabular RL Foundations (3-5 weeks)
- Stage 2: Deep RL Algorithms (6-10 weeks)
- Stage 3: Advanced Topics (ongoing)
- Stage 4: RL for Language Models
- Courses Compared
- Books: Free and Paid
- Libraries and Frameworks
- Environments and Benchmarks
- Landmark Papers Reading List
- Blogs, Tutorials and Talks
- Projects and Exercises
- Debugging RL: A Practical Checklist
- Hardware and Compute
- Common Mistakes
- FAQ
- Where to Go Next
- Contributing
Who This Guide Is For
- Software engineers and ML practitioners who know supervised learning and want to understand how agents learn from rewards.
- Students taking an RL course who want better explanations, extra practice and a sense of what matters.
- Researchers from adjacent fields (robotics, control, operations research, economics, neuroscience) looking for the modern deep RL toolbox.
- LLM engineers who keep hearing “PPO”, “GRPO” and “reward model” and want to understand the RL underneath.
If you have never trained any machine learning model, start with a general path first (see How to Learn Machine Learning) and come back.
Prerequisites (and Where to Patch Gaps)
| Skill | What you actually need | Free resource to patch it |
|---|---|---|
| Python | Comfortable with functions, classes, NumPy arrays | Python official tutorial |
| Probability | Expectations, conditional probability, sampling, variance | Harvard Statistics 110 lectures |
| Linear algebra | Vectors, matrices, dot products, gradients | 3Blue1Brown: Essence of Linear Algebra |
| Calculus | Partial derivatives, chain rule | 3Blue1Brown: Essence of Calculus |
| Deep learning | Train an MLP / CNN in PyTorch, understand loss and optimizers | PyTorch tutorials |
| Optimization | Gradient descent, learning rates, why things diverge | Mathematics for Machine Learning (free book) |
You do not need measure theory or functional analysis to be productive. You do need to be comfortable with expectations, because nearly every RL equation is an expectation over trajectories.
The Roadmap at a Glance
| Stage | Goal | Time (8-10 h/week) | Core resources | Milestone |
|---|---|---|---|---|
| 0. Intuition | Know what an MDP, policy, value and reward are | 1 week | HF Deep RL Course Unit 1, Spinning Up Part 1 | Explain exploration vs exploitation to a friend |
| 1. Tabular | Dynamic programming, Monte Carlo, TD, Q-learning | 3-5 weeks | Sutton & Barto ch. 1-6, Silver lectures 1-5 | Q-learning solves FrozenLake and Taxi from scratch |
| 2. Deep RL | DQN, policy gradients, actor-critic, PPO, SAC | 6-10 weeks | Spinning Up, CleanRL, CS285 or CS234 | Your own PPO solves CartPole and an Atari game |
| 3. Advanced | Model-based, offline, multi-agent, exploration, theory | ongoing | CS285 later lectures, papers, Murphy overview | Reproduce one paper’s main plot |
| 4. RL for LLMs | RLHF, DPO, GRPO, verifiable rewards | 3-6 weeks | RLHF Book, TRL docs, DeepSeekMath / R1 papers | Fine-tune a small LM with GRPO on a math reward |
Realistic total to “can read new papers and implement them”: 4-8 months part-time.
Stage 0: Intuition (1 week)
Goal: build a mental picture before the math.
- Read Unit 1 of the Hugging Face Deep RL Course and train the LunarLander agent in the notebook. The course is now officially in a low-maintenance state, but the theory units and notebooks are still among the friendliest introductions available.
- Read Spinning Up Part 1: Key Concepts in RL. It is short, precise, and introduces the notation used by most deep RL papers.
- Watch Andrej Karpathy’s classic essay in text form: Deep Reinforcement Learning: Pong from Pixels. It derives policy gradients in plain language with about 130 lines of NumPy.
Check yourself: can you say, in one sentence each, what a state, action, reward, policy, return, value function and discount factor are?
Stage 1: Tabular RL Foundations (3-5 weeks)
Goal: understand why algorithms work when everything fits in a table.
Primary text: Reinforcement Learning: An Introduction (2nd ed.) by Richard Sutton and Andrew Barto, free from the authors’ site. Read chapters 1-6 carefully, then skim 7-8.
Lectures (pick one):
- David Silver’s UCL course (2015), the classic. Lectures 1-5 map almost exactly onto Sutton & Barto ch. 1-6. Slides are on davidsilver.uk/teaching.
- DeepMind x UCL Reinforcement Learning Course (2018) by Hado van Hasselt and colleagues, slightly more modern.
- Stanford CS234 (Spring 2024, Emma Brunskill), if you prefer a full university course with a stronger emphasis on evaluation and offline settings. Course site: web.stanford.edu/class/cs234.
Topics, in order:
| Week | Topic | Sutton & Barto | Implement |
|---|---|---|---|
| 1 | Multi-armed bandits, epsilon-greedy, UCB | ch. 2 | 10-armed testbed |
| 1-2 | MDPs, Bellman equations | ch. 3 | Write out Bellman equations for a 3-state MDP by hand |
| 2 | Dynamic programming: policy and value iteration | ch. 4 | Value iteration on GridWorld / FrozenLake |
| 3 | Monte Carlo prediction and control | ch. 5 | Blackjack with MC control |
| 3-4 | TD(0), SARSA, Q-learning, expected SARSA | ch. 6 | Q-learning on Taxi-v3, SARSA vs Q-learning on CliffWalking |
| 5 | n-step returns, eligibility traces, planning (Dyna) | ch. 7, 8, 12 | Dyna-Q on a maze |
Code references: ShangtongZhang/reinforcement-learning-an-introduction reproduces nearly every figure in the book in Python. Try writing your version first, then compare.
Best pick for this stage: Sutton & Barto + Silver lectures. Nothing else gives the same depth for free.
Stage 2: Deep RL Algorithms (6-10 weeks)
Goal: replace tables with neural networks and get modern algorithms working.
Primary resources:
- OpenAI Spinning Up: the best compact explanation of VPG, TRPO, PPO, DDPG, TD3 and SAC, with a list of key papers. Its code targets old Gym and is no longer maintained, so read the docs but use CleanRL for code.
- CleanRL (docs): single-file, readable implementations of DQN, PPO, SAC, TD3, C51 and more, each with benchmark results. Ideal for learning because each algorithm is one file you can read top to bottom.
- A full course: UC Berkeley CS 185/285 Deep RL by Sergey Levine (the Spring 2026 lectures are on YouTube), or Pieter Abbeel’s shorter Foundations of Deep RL six-lecture series.
Algorithm sequence:
| Order | Algorithm | Why learn it | Key paper |
|---|---|---|---|
| 1 | REINFORCE / vanilla policy gradient | The simplest gradient of expected return; foundation for everything on-policy | Williams 1992 |
| 2 | DQN | Value-based deep RL; replay buffers and target networks | Mnih et al. 2013 |
| 3 | Double DQN, Dueling, Prioritized replay, Rainbow | How small fixes add up | Rainbow |
| 4 | A2C / A3C | Actor-critic with advantage estimates | Mnih et al. 2016 |
| 5 | GAE | The advantage estimator nearly everyone uses | Schulman et al. 2015 |
| 6 | TRPO then PPO | The default on-policy workhorse | TRPO, PPO |
| 7 | DDPG then TD3 | Continuous control, deterministic policies | DDPG, TD3 |
| 8 | SAC | Maximum-entropy off-policy; strong default for continuous control | SAC |
Must-read companion: The 37 Implementation Details of Proximal Policy Optimization. Most “my PPO doesn’t learn” problems are answered here (observation normalization, advantage normalization, learning-rate annealing, orthogonal init, and more).
Milestones:
- DQN solves CartPole-v1 (average return near 500).
- Your PPO solves CartPole, then LunarLander, then reaches a reasonable score on Atari Breakout or Pong.
- SAC or TD3 learns HalfCheetah or Hopper in MuJoCo.
- You can explain, without notes, why PPO clips the probability ratio.
Stage 3: Advanced Topics (ongoing)
Pick by interest. Each row gives an entry point and a “go deeper” pointer.
| Topic | What it is | Start here | Go deeper |
|---|---|---|---|
| Model-based RL | Learn a world model, plan or train inside it | CS285 model-based lectures | MuZero, DreamerV3 |
| Offline RL | Learn from a fixed dataset with no new interaction | Levine et al. tutorial | CQL, IQL, Minari datasets |
| Imitation learning | Learn from demonstrations | CS285 imitation lecture | imitation library (BC, GAIL, AIRL, DAgger) |
| Sequence models for RL | Treat RL as sequence modeling | Decision Transformer | Compare to IQL on the same dataset |
| Multi-agent RL | Many learning agents, cooperative or competitive | PettingZoo docs | OpenSpiel, Melting Pot |
| Distributional RL | Learn the full return distribution, not just its mean | Distributional RL book (free web draft) | C51 and QR-DQN in CleanRL |
| Exploration | Curiosity, count-based bonuses, hard-exploration games | CS285 exploration lectures | Montezuma’s Revenge, Craftax |
| Bandits | One-step decision making, regret bounds | Sutton & Barto ch. 2 | Bandit Algorithms (free PDF) |
| RL theory | Sample complexity, convergence | RL: Theory and Algorithms (free) | Szepesvari, Bertsekas (below) |
| Sim-to-real robotics | Train in simulation, deploy on hardware | Isaac Lab, MuJoCo Playground | Domain randomization papers |
| GPU-accelerated RL | Run thousands of environments on the accelerator | PureJaxRL | Brax, Gymnax, Jumanji |
| Reliable evaluation | Confidence intervals instead of single best seeds | Deep RL at the Edge of the Statistical Precipice | rliable library |
For a single, up-to-date map of the whole field, keep Kevin Murphy’s Reinforcement Learning: An Overview open. It is a book-length monograph on arXiv, revised several times since December 2024, covering value-based, policy-based, model-based and LLM-related RL in one consistent notation.
Stage 4: RL for Language Models
Since 2022, RL has become a core step in training chat and reasoning models. The ideas are the same ones from Stage 2, applied to a policy that outputs tokens.
| Step | Concept | Read | Practice |
|---|---|---|---|
| 1 | RLHF: reward model from human preferences + PPO | InstructGPT paper | Read the RLHF Book by Nathan Lambert (free online) |
| 2 | Direct preference optimization (no explicit RL loop) | DPO | Run DPO with TRL on a small model |
| 3 | GRPO: group-relative advantages, no value network | DeepSeekMath | TRL’s GRPO trainer on a math dataset with an exact-match reward |
| 4 | RL with verifiable rewards for reasoning | DeepSeek-R1 | Reward correct final answers and valid format; watch response length grow |
| 5 | Scale-out training | verl, OpenRLHF | Multi-GPU runs with vLLM rollouts |
Best pick: TRL for learning (it sits on top of the Hugging Face stack and runs on a single GPU for small models), verl or OpenRLHF when you need multi-node throughput.
Tip: the vocabulary maps directly. The “policy” is the language model, an “action” is a token, an “episode” is one completion, and the “reward” usually arrives only at the end of the completion, which is why advantage estimation and KL penalties to a reference model matter so much.
Courses Compared
| Course | Provider | Level | Format | Cost | Best for |
|---|---|---|---|---|---|
| Deep RL Course | Hugging Face | Beginner | Text + Colab notebooks | Free | First hands-on contact |
| Spinning Up | OpenAI | Beginner-intermediate | Docs + paper list | Free | Clean deep RL theory and key papers |
| RL Course (2015) | David Silver, UCL | Beginner-intermediate | 10 video lectures | Free | Tabular foundations |
| RL Course (2018) | DeepMind x UCL | Intermediate | Video lectures | Free | Updated foundations, function approximation |
| CS234 | Stanford | Intermediate | Videos + assignments | Free online materials | Rigorous intro, evaluation, offline RL |
| CS 185/285 | UC Berkeley | Advanced | Videos + PyTorch homeworks | Free online materials | Deep RL research skills |
| Foundations of Deep RL | Pieter Abbeel | Intermediate | 6 lectures | Free | Fast tour of modern deep RL |
| Reinforcement Learning Specialization | University of Alberta on Coursera | Beginner-intermediate | Graded MOOC | (paid) certificate; auditing options vary | Structured deadlines, built on Sutton & Barto |
| A Course in RL lectures | Dimitri Bertsekas, ASU | Intermediate-advanced | Video lectures + free book | Free | Control and optimization view of RL |
Best overall path: Hugging Face Unit 1 -> Silver lectures + Sutton & Barto -> Spinning Up + CleanRL -> CS285. That sequence is entirely free.
Books: Free and Paid
Free (legally, from authors or publishers)
| Book | Authors | Level | Best for |
|---|---|---|---|
| Reinforcement Learning: An Introduction, 2nd ed. | Sutton, Barto | Beginner-intermediate | The standard textbook; read it first |
| Reinforcement Learning: An Overview | Kevin Murphy | Intermediate-advanced | Modern deep RL survey, including LLM topics |
| A Course in Reinforcement Learning, 2nd ed. (2025) | Dimitri Bertsekas | Intermediate-advanced | Optimal control and rollout perspective; free PDF on the author’s page |
| Algorithms of Reinforcement Learning | Csaba Szepesvari | Advanced | Concise, mathematical, short |
| Reinforcement Learning: Theory and Algorithms | Agarwal, Jiang, Kakade, Sun | Advanced | Sample complexity and theory |
| Mathematical Foundations of Reinforcement Learning | Shiyu Zhao | Intermediate | Math-first explanations; the author shares the PDF and lecture videos on GitHub (the print edition is from Springer) |
| Distributional Reinforcement Learning | Bellemare, Dabney, Rowland | Advanced | Return distributions; free web draft (not a PDF) |
| Bandit Algorithms | Lattimore, Szepesvari | Advanced | Everything about bandits |
| Algorithms for Decision Making | Kochenderfer, Wheeler, Wray | Intermediate | Planning, POMDPs and multi-agent decision making, with Julia code |
| RLHF Book | Nathan Lambert | Intermediate | Preference tuning and RL for LLMs |
Paid (worth buying if you like the format)
| Book | Why buy |
|---|---|
| Grokking Deep Reinforcement Learning, Miguel Morales (Manning) (paid) | Visual, gentle explanations with code |
| Deep Reinforcement Learning Hands-On, Maxim Lapan (Packt) (paid) | Practical PyTorch projects across many algorithms |
| Foundations of Deep Reinforcement Learning, Graesser and Keng (Addison-Wesley) (paid) | Clear derivations plus engineering advice |
Best pick: Sutton & Barto for foundations, Murphy’s overview for the modern landscape. Buy a paid book only if you want more hand-holding with code.
Libraries and Frameworks
Most of the following had commits or releases in 2026 at the time of review; exceptions are noted.
General-purpose (PyTorch)
| Library | Style | Best for | Notes |
|---|---|---|---|
| Stable-Baselines3 (docs) | High-level model.learn() API |
Getting a reliable baseline fast | Pair with RL Baselines3 Zoo for tuned hyperparameters and sb3-contrib for extra algorithms |
| CleanRL | Single-file scripts | Learning and research prototypes | Read, copy, modify; not a library you import |
| TorchRL | Modular building blocks | Custom research pipelines in PyTorch | Official PyTorch project |
| Tianshou | Modular, many algorithms | Research needing many algorithm variants | |
| skrl | Modular, PyTorch and JAX | Robotics with Isaac Lab | |
| RLlib (part of Ray) | Distributed, production | Multi-node training, multi-agent at scale | Heavier setup |
| Sample Factory | High-throughput async PPO | Fast single-machine training on fast simulators | Last PyPI release was 2023; repo still receives commits |
| PufferLib | Fast vectorization + PPO | Very high steps-per-second on many environments |
JAX and accelerator-native
| Library | What it does |
|---|---|
| PureJaxRL | Whole training loop (env + agent) compiled with JAX; reference PPO/DQN. Last commits in 2024, but still the clearest example of the pattern |
| Brax | Differentiable physics simulator in JAX plus PPO/SAC training |
| MuJoCo Playground | GPU-accelerated MuJoCo (MJX) environments for locomotion and manipulation |
| Gymnax | Classic control, bsuite and MinAtar environments in JAX |
| Jumanji | Combinatorial and logistics environments in JAX |
Research frameworks from labs
| Library | Notes |
|---|---|
| Dopamine | Google’s compact value-based research framework (DQN family) |
| Acme | DeepMind’s research framework for distributed agents |
Specialized
| Library | Purpose |
|---|---|
| imitation | Behavioral cloning, DAgger, GAIL, AIRL on top of SB3 (last release Jan 2025) |
| d3rlpy | Offline RL algorithms (CQL, IQL, and more); updates slowed in 2025 |
| CORL | Single-file offline RL implementations, CleanRL style (no commits since 2024, still a good reference) |
| rliable | Statistically sound evaluation and plotting (repo archived but usable) |
| TRL | SFT, DPO, PPO and GRPO trainers for language models |
| verl | Large-scale RL post-training for LLMs (PPO, GRPO, DAPO and others) |
| OpenRLHF | Ray + vLLM based RLHF framework |
Which library should I use?
| Situation | Pick | Why |
|---|---|---|
| Learning how algorithms work | CleanRL | Every line is visible in one file |
| Need a working baseline for a custom env today | Stable-Baselines3 | Reliable defaults, great docs, tuned zoo |
| Writing a research method in PyTorch | TorchRL or CleanRL | Composability vs. hackability |
| Massive parallel simulation on GPU | Brax / MuJoCo Playground / PureJaxRL | Environment and agent on the same device |
| Robotics with NVIDIA simulation | Isaac Lab + skrl or rsl_rl | Integrated workflows |
| Multi-node distributed training | RLlib | Built on Ray |
| LLM post-training | TRL, then verl / OpenRLHF | Hugging Face integration, then scale |
Environments and Benchmarks
Gymnasium is the standard API. Gymnasium by the Farama Foundation is the maintained successor to OpenAI Gym, with a slightly different step() signature (it returns terminated and truncated separately). If a tutorial imports gym, expect to update it. Shimmy wraps older APIs (DeepMind Control, OpenSpiel, old Gym) into Gymnasium.
| Environment suite | Type | Difficulty | Best for |
|---|---|---|---|
| Gymnasium classic control and toy text | CartPole, MountainCar, FrozenLake, Taxi, CliffWalking | Easy | First algorithms |
| Gymnasium Box2D | LunarLander, BipedalWalker, CarRacing | Easy-medium | First deep RL wins |
| Arcade Learning Environment | Atari 2600 games | Medium | DQN family, pixel-based RL |
| MuJoCo via Gymnasium | HalfCheetah, Hopper, Walker2d, Ant, Humanoid | Medium | Continuous control (SAC, TD3, PPO) |
| DeepMind Control Suite | MuJoCo tasks with pixel observations | Medium-hard | Continuous control from pixels |
| MiniGrid | Grid worlds with goals, keys and doors | Easy-hard | Exploration, partial observability, language goals |
| Procgen | 16 procedurally generated games | Medium-hard | Generalization |
| Craftax | JAX Crafter/NetHack-like open world | Hard | Exploration, long horizons on one GPU |
| NetHack Learning Environment | The NetHack roguelike | Very hard | Long-horizon, procedurally generated challenges (moved from the archived facebookresearch repo to this new home) |
| PettingZoo | Multi-agent standard API | Varies | Multi-agent RL |
| OpenSpiel | Board, card and matrix games | Varies | Game theory, search, poker |
| Melting Pot | Social dilemmas | Hard | Cooperative and mixed-motive multi-agent |
| Minari | Offline datasets (successor to D4RL) | Varies | Offline RL |
| Gymnasium-Robotics | Fetch, Shadow Hand, maze, Franka kitchen | Medium-hard | Goal-conditioned manipulation |
| Meta-World | 50 robot manipulation tasks | Hard | Multi-task and meta-RL |
| ManiSkill | GPU-parallel manipulation | Hard | Robot learning at scale |
| Isaac Lab | NVIDIA robotics simulation | Hard | Sim-to-real locomotion and manipulation (needs an NVIDIA GPU) |
| HighwayEnv | Autonomous driving decisions | Medium | Lightweight driving scenarios |
| Unity ML-Agents | Unity game engine | Varies | Custom 3D game environments |
| Godot RL Agents | Godot game engine | Varies | Open-source game-engine environments |
Suggested ladder: CartPole -> LunarLander -> one Atari game -> HalfCheetah -> MiniGrid KeyCorridor -> Procgen or Craftax -> your own custom environment.
Writing your own environment
The Gymnasium “Create a Custom Environment” tutorial is the reference. Checklist:
- Define
observation_spaceandaction_spaceprecisely (useBox,Discrete,Dict). - Return
terminatedwhen the task truly ends andtruncatedwhen you cut it off for time. Mixing these up silently breaks value bootstrapping. - Keep rewards on a sensible scale (roughly -10..10 per step is a good start) and shape them carefully.
- Run
gymnasium.utils.env_checker.check_env(env)before training. - Test with a random agent and a hand-coded heuristic agent first. If the heuristic can’t succeed, RL probably won’t either.
Landmark Papers Reading List
Read in roughly this order. All links go to arXiv or the publisher.
| Year | Paper | Why it matters |
|---|---|---|
| 1992 | Simple statistical gradient-following algorithms (REINFORCE) | The policy gradient estimator |
| 2013 | Playing Atari with Deep RL (DQN) | Deep RL from pixels |
| 2015 | TRPO | Trust regions for stable policy updates |
| 2015 | DDPG | Deep RL for continuous actions |
| 2015 | GAE | Bias-variance control for advantages |
| 2016 | A3C | Asynchronous actor-critic |
| 2017 | PPO | The default on-policy algorithm |
| 2017 | Rainbow | Combining DQN improvements |
| 2017 | Deep RL that Matters | Reproducibility and seed variance |
| 2018 | SAC | Maximum entropy off-policy learning |
| 2018 | TD3 | Fixing overestimation in actor-critic |
| 2019 | MuZero | Planning with a learned model |
| 2020 | Offline RL tutorial | Learning from fixed data |
| 2020 | CQL | Conservative offline value learning |
| 2021 | Decision Transformer | RL as sequence modeling |
| 2021 | IQL | Simple, strong offline RL |
| 2021 | Statistical Precipice | How to report RL results |
| 2022 | InstructGPT | RLHF for language models |
| 2023 | DreamerV3 | One world-model agent across many domains |
| 2023 | DPO | Preference optimization without RL loops |
| 2024 | DeepSeekMath (GRPO) | Critic-free RL for LLMs |
| 2025 | DeepSeek-R1 | Reasoning emerging from RL with verifiable rewards |
Also see Spinning Up’s longer Key Papers in Deep RL list.
Blogs, Tutorials and Talks
- Lilian Weng: Policy Gradient Algorithms, a dense, well-referenced derivation of most policy-gradient methods.
- Lilian Weng: A (Long) Peek into Reinforcement Learning, the whole field on one page.
- Andrej Karpathy: Pong from Pixels, the most intuitive policy-gradient explanation.
- Alex Irpan: Deep Reinforcement Learning Doesn’t Work Yet, an honest look at why RL is hard; still relevant.
- Andy Jones: Debugging Reinforcement Learning Systems, the best practical debugging guide.
- The 37 Implementation Details of PPO, essential if you implement PPO.
- Hugging Face blog: Illustrating RLHF, a clear visual overview of the RLHF pipeline.
- Gymnasium tutorials, small official training examples.
- Stable-Baselines3 RL tips and tricks, practical advice on normalization, hyperparameters and evaluation.
Projects and Exercises
Ordered from first weekend to portfolio piece.
| # | Project | Skills | Success criterion |
|---|---|---|---|
| 1 | Bandit testbed: epsilon-greedy vs UCB vs Thompson sampling | Exploration, regret | Reproduce Sutton & Barto Figure 2.2 shape |
| 2 | Value iteration and policy iteration on FrozenLake | Bellman equations | Optimal policy matches the known solution |
| 3 | Tabular Q-learning on Taxi-v3 | TD learning | Average reward above 7 over 100 episodes |
| 4 | SARSA vs Q-learning on CliffWalking | On- vs off-policy | Explain why SARSA’s path is safer |
| 5 | DQN from scratch on CartPole | Replay, target nets | Average return near 500 |
| 6 | REINFORCE then add a baseline | Variance reduction | Plot variance with and without baseline |
| 7 | PPO from scratch (compare to CleanRL) | Clipping, GAE | Within noise of CleanRL’s curve on CartPole/LunarLander |
| 8 | SAC on a MuJoCo task | Off-policy continuous control | Learning curve over 5 seeds with confidence bands |
| 9 | Custom Gymnasium environment (e.g., a warehouse robot or a trading simulator with fake data) | Env design, reward shaping | Agent beats a hand-written heuristic |
| 10 | Offline RL: train BC, CQL and IQL on one Minari dataset | Offline evaluation | Ranked results with intervals using rliable |
| 11 | Self-play for Connect Four with OpenSpiel or PettingZoo | Multi-agent, self-play | Agent beats a minimax depth-2 opponent |
| 12 | GRPO on a small language model with a math reward | RL for LLMs | Accuracy improves on a held-out set; analyze reward hacking |
Write each project up with plots over multiple seeds. A short blog post with honest failure analysis is more impressive to reviewers than a single lucky curve.
Debugging RL: A Practical Checklist
RL bugs rarely crash; they just make learning silently worse. Work through this list before tuning hyperparameters.
- Start tiny. Verify on an environment where the answer is known (e.g., a one-step environment where the optimal action is obvious).
- Use a known-good implementation as reference. Run CleanRL or SB3 on the same environment. If it also fails, the environment or reward is the problem.
- Check
terminatedvstruncated. Bootstrapping through a time-limit truncation is correct; bootstrapping through a true terminal state is a bug. - Normalize. Observations (running mean/std) and advantages per batch. Consider reward scaling.
- Log the right things: episode return, episode length, value loss, policy entropy, approximate KL (for PPO), clip fraction, explained variance, Q-value magnitudes (for DQN/SAC).
- Watch entropy. If it collapses early, the policy stopped exploring.
- Watch value estimates. Exploding Q-values point to overestimation or a learning-rate problem.
- Use several seeds (at least 3, ideally 5-10) before concluding anything.
- Render episodes. Watching your agent often reveals reward hacking immediately.
- Change one thing at a time and keep a run log (Weights & Biases, TensorBoard, or a plain CSV).
Hardware and Compute
| Goal | Hardware | Notes |
|---|---|---|
| Tabular RL, CartPole, LunarLander | Any laptop CPU | Minutes |
| Atari with DQN/PPO | One consumer GPU, or a free Colab/Kaggle GPU | Hours per game; vectorized envs help a lot |
| MuJoCo continuous control | CPU is often fine; a GPU speeds up networks | MuJoCo is free and open source |
| JAX/GPU-native environments | One modern GPU | Millions of steps per minute are possible |
| Isaac Lab robotics | NVIDIA RTX-class GPU | Check Isaac Sim’s system requirements |
| LLM RL (GRPO on small models) | One 24 GB+ GPU for sub-1B models; multiple GPUs beyond that | Use LoRA and vLLM-backed generation where supported |
Free compute: Google Colab and Kaggle Notebooks both offer free GPU time with usage limits.
Common Mistakes
- Using the old
gympackage. Use Gymnasium; API differences cause subtle bugs. - Judging an algorithm by one seed. RL variance is huge.
- Skipping the tabular stage. Deep RL bugs are much easier to diagnose if you have implemented Q-learning by hand.
- Tuning hyperparameters before checking the implementation. Compare with a reference first.
- Over-shaping rewards. Agents exploit any loophole. Reward what you want, not how you think it should be done.
- Ignoring evaluation mode. Evaluate with a deterministic or greedy policy separately from training rollouts.
- Reading papers before running code. Papers make more sense once you’ve seen a learning curve wobble.
FAQ
Is reinforcement learning worth learning in 2027? Yes, if you work on robotics, games, recommendation and control systems, operations research, or LLM post-training. RL fine-tuning is now a standard step in building reasoning models, which has renewed demand for people who understand policy gradients and reward design.
How long does it take to learn reinforcement learning? With ML background and about 8-10 hours a week: roughly a month for tabular foundations, two to three months to implement DQN, PPO and SAC confidently, and six months or more to read and reproduce current research.
What math do I need for reinforcement learning? Probability and expectations, basic linear algebra, and multivariable calculus (gradients). Theory-heavy work also uses concentration inequalities and contraction mappings, which you can learn when you need them.
Should I start with Sutton & Barto or a deep RL course? Sutton & Barto (chapters 1-6) first, ideally alongside the Silver lectures. Deep RL concepts like target networks and advantage estimates make much more sense afterward.
Is OpenAI Gym dead? OpenAI Gym is no longer maintained. Its successor is Gymnasium, maintained by the Farama Foundation. Most libraries (Stable-Baselines3, CleanRL, TorchRL) target Gymnasium.
Which is better: PPO or SAC? PPO is the default for discrete actions, massively parallel simulators and LLM fine-tuning. SAC is usually more sample-efficient for continuous control when environment steps are expensive. Try both on your problem.
Stable-Baselines3 or CleanRL? SB3 if you want to use RL; CleanRL if you want to understand or modify RL algorithms.
Can I learn RL without a GPU? Yes. Tabular methods, classic control and even many MuJoCo experiments run fine on a CPU. Use free Colab or Kaggle GPUs for Atari and pixel-based tasks.
What is the difference between RLHF, DPO and GRPO? RLHF trains a reward model from human preference pairs and then optimizes the language model with an RL algorithm (classically PPO). DPO skips the explicit reward model and RL loop, optimizing a closed-form objective on preference pairs directly. GRPO is an RL algorithm that estimates advantages by comparing a group of sampled answers to the same prompt, removing the need for a value network; it is widely used with automatically checkable rewards like math correctness.
What are good RL research areas right now? Active areas include RL for LLM reasoning and agents, offline-to-online RL, world models, sim-to-real robotics, scalable GPU-native training, and better evaluation methodology. Read recent proceedings of NeurIPS, ICML, ICLR and the Reinforcement Learning Conference (RLC) to see what is current.
Where to Go Next
- Machine learning foundations: How to Learn Machine Learning
- Programming fundamentals: How to Learn Programming
- Building systems that serve models at scale: How to Learn System Design
- Communities: the Farama Foundation projects’ GitHub discussions, and the issue trackers of the libraries above, are good places to ask well-formed questions.
- Conferences: RLC, NeurIPS, ICML and ICLR. Many talks are posted online for free.
Contributing
Corrections and additions are welcome. Please open an issue or pull request with:
- A real, working link (author- or publisher-hosted for free books; no pirated copies).
- One sentence on what the resource is best for and its level.
- A note if it is paid.
Broken links, outdated versions and clearer explanations are the most valuable contributions.
If this helped you, a star helps others find it.
More free resources
Part of the Ralpberry Labs open-source collection. See also Top 100 Open Source.