RL study guide — foundations through RLHF, DPO, GRPO, RLVR, agentic RL, and offline RL. Hand-written CS294 notes, 19 lecture drafts, 5 tested exercises, citations that resolve.
Python
165
32 commits
updated Jul 1, 2026
Notes, lectures, and exercises for learning reinforcement learning and how it's used to train language models, from MDPs and policy gradients through RLHF, DPO, and GRPO.
This is a personal study repo, not a library. It mixes notes a person wrote (some going back to a 2017 Berkeley course) with a newer lecture series that hasn't been reviewed yet. Every doc under notes/ and reference/ says at the top whether it's hand-written, reviewed, or unreviewed. See AGENTS.md for how the repo is organized and how to work in it, with a coding agent or solo.
Trusted, hand-written:
notes/cs294-2017/: personal student notes from CS 294 Deep RL (Berkeley, Spring 2017; Levine, Schulman, Finn). 246 lines of real-time notes from the field being built. Idiosyncratic, opinionated, with the cannon-trajectory aside. Kept as written.notes/sutton-barto-digest/: short distillation of the four elements of an RL system, from Sutton & Barto.exercises/: five small coding exercises with pytest tests and reference solutions, verified to pass. Implement REINFORCE on CartPole, Q-learning on FrozenLake, value iteration on a gridworld, actor-critic, a tiny GRPO loop on a verifiable arithmetic task.AI-drafted, useful as scaffold (unreviewed, treat with skepticism):
notes/lectures/: a 34-lecture series, MDPs through RLHF / DPO / GRPO / RLVR / agentic / offline. Editorial pass done (broken links, code bugs, made-up citations all caught and fixed), but no person has read each one end-to-end. Cross-check the math against the cited papers before relying on it. Index and per-lecture status in notes/README.md; ordered study path in CURRICULUM.md.notes/cheat-sheets/, notes/diagrams/: quick reference. Same caveat. (The diagrams file caught and fixed two wrong loss diagrams during the audit, FWIW.)reference/papers/: auto-collected paper lists from arXiv (~430 abstracts). Use as a search index, not a curated reading list.tools/: arxiv-collector/ (fetches arXiv papers), lit-builder/ (ICLR/NeurIPS/ICML triage with keyword filter + LLM scoring), content-pipeline/ (drafts blog posts from papers; auxiliary).AGENTS.md explains the <!-- status: hand-written | reviewed | unreviewed --> convention every doc carries.
notes/cs294-2017/) give you one student's working notes through the same material if you like that genre.exercises/. They're tested and they actually run. Five of them, a couple of hours each.notes/lectures/ covers RLHF, DPO, GRPO, RLVR, agentic, offline. Drafts; cross-check the claims against the cited papers.AGENTS.md first.Everything in the lecture series is the same underlying object: an MDP, where an agent picks actions and some signal tells it whether things are going well. What changes between sub-fields is mostly what that signal is and who provides it. Classical RL gets a reward from the environment. RLHF infers a reward from human preference labels. RLAIF replaces the human with an LLM judge or a written constitution. RLVR skips the learned reward model entirely and uses a verifier: a checker for math, a test suite for code. Agentic RL puts the model in a multi-turn loop with an environment that tells it whether the task ultimately succeeded. Offline RL works from logged data only, no fresh interaction.
The map below shows where each family fits. The lectures fill in the details; CURRICULUM.md is the suggested order.
Introduction to Reinforcement Learning by Joelle Pineau, McGill University:
Applications of RL.
When to use RL?
RL vs supervised learning
What is MDP? Markov Decision Process
Components of an RL agent:
+-----------------+
+--------------------- | |
| | Agent |
| | | +---------------------+
| +----------> | | |
| | +-----------------+ |
| | |
state | | reward | action
S(t) | | r(t) | a(t)
| | |
| | + |
| | | r(t+1) +----------------------------+ |
| +-----------+ | |
| | | | <-----------+
| | | Environment |
| | S(t+1) | |
+---------------------+ |
| +----------------------------+
+
* Sutton and Barto (1998)
Explanation of the Markov Property:
Why Maximizing utility in:
What is the policy & what to do with it?
Value functions:
Optimal policies and optimal value functions.
Key challenges in RL:
The RL lingo.
In large state spaces: Need approximation:
Deep Q-network (DQN) and tips.
Deep Reinforcement Learning by Pieter Abbeel, EE & CS, UC Berkeley
Why Policy Optimization?
Cross Entropy Method (CEM) / Finite Differences / Fixing Random Seed
Likelihood Ratio (LR) Policy Gradient
Natural Gradient / Trust Regions (-> TRPO)
Actor-Critic (-> GAE, A3C)
Path Derivatives (PD) (-> DPG, DDPG, SVG)
Stochastic Computation Graphs (generalizes LR / PD)
Guided Policy Search (GPS)
Inverse Reinforcement Learning
Explanation with Implementation for some of the topics mentioned in the Deep Reinforcement Learning talk, written by Arthur Juliani
Reinforcement Learning by David Silver (UCL):
CS 294: Deep Reinforcement Learning, Spring 2017 by Sergey Levine, John Schulman, Chelsea Finn. My notes from taking it are at notes/cs294-2017/.
CS 285: Deep Reinforcement Learning (Berkeley), the current version of CS294, updated each year.
Deep RL Course (Hugging Face). Hands-on, uses current tooling.
Spinning Up in Deep RL (OpenAI). Explanations plus reference implementations.
(With identifiers so you can check them. The lecture series goes into these.)
More, organized by topic, in reference/papers/.
Suggestions and corrections welcome via issues or pull requests. If you fix an error in an unreviewed lecture, note what was wrong. That's the most useful kind of contribution here.

Licensed under Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.
25 commits
7 commits
Python
100.0%
RL study guide — foundations through RLHF, DPO, GRPO, RLVR, agentic RL, and offline RL. Hand-written CS294 notes, 19 lecture drafts, 5 tested exercises, citations that resolve.
Python
165
32 commits
updated Jul 1, 2026
Notes, lectures, and exercises for learning reinforcement learning and how it's used to train language models, from MDPs and policy gradients through RLHF, DPO, and GRPO.
This is a personal study repo, not a library. It mixes notes a person wrote (some going back to a 2017 Berkeley course) with a newer lecture series that hasn't been reviewed yet. Every doc under notes/ and reference/ says at the top whether it's hand-written, reviewed, or unreviewed. See AGENTS.md for how the repo is organized and how to work in it, with a coding agent or solo.
Trusted, hand-written:
notes/cs294-2017/: personal student notes from CS 294 Deep RL (Berkeley, Spring 2017; Levine, Schulman, Finn). 246 lines of real-time notes from the field being built. Idiosyncratic, opinionated, with the cannon-trajectory aside. Kept as written.notes/sutton-barto-digest/: short distillation of the four elements of an RL system, from Sutton & Barto.exercises/: five small coding exercises with pytest tests and reference solutions, verified to pass. Implement REINFORCE on CartPole, Q-learning on FrozenLake, value iteration on a gridworld, actor-critic, a tiny GRPO loop on a verifiable arithmetic task.AI-drafted, useful as scaffold (unreviewed, treat with skepticism):
notes/lectures/: a 34-lecture series, MDPs through RLHF / DPO / GRPO / RLVR / agentic / offline. Editorial pass done (broken links, code bugs, made-up citations all caught and fixed), but no person has read each one end-to-end. Cross-check the math against the cited papers before relying on it. Index and per-lecture status in notes/README.md; ordered study path in CURRICULUM.md.notes/cheat-sheets/, notes/diagrams/: quick reference. Same caveat. (The diagrams file caught and fixed two wrong loss diagrams during the audit, FWIW.)reference/papers/: auto-collected paper lists from arXiv (~430 abstracts). Use as a search index, not a curated reading list.tools/: arxiv-collector/ (fetches arXiv papers), lit-builder/ (ICLR/NeurIPS/ICML triage with keyword filter + LLM scoring), content-pipeline/ (drafts blog posts from papers; auxiliary).AGENTS.md explains the <!-- status: hand-written | reviewed | unreviewed --> convention every doc carries.
notes/cs294-2017/) give you one student's working notes through the same material if you like that genre.exercises/. They're tested and they actually run. Five of them, a couple of hours each.notes/lectures/ covers RLHF, DPO, GRPO, RLVR, agentic, offline. Drafts; cross-check the claims against the cited papers.AGENTS.md first.Everything in the lecture series is the same underlying object: an MDP, where an agent picks actions and some signal tells it whether things are going well. What changes between sub-fields is mostly what that signal is and who provides it. Classical RL gets a reward from the environment. RLHF infers a reward from human preference labels. RLAIF replaces the human with an LLM judge or a written constitution. RLVR skips the learned reward model entirely and uses a verifier: a checker for math, a test suite for code. Agentic RL puts the model in a multi-turn loop with an environment that tells it whether the task ultimately succeeded. Offline RL works from logged data only, no fresh interaction.
The map below shows where each family fits. The lectures fill in the details; CURRICULUM.md is the suggested order.
Introduction to Reinforcement Learning by Joelle Pineau, McGill University:
Applications of RL.
When to use RL?
RL vs supervised learning
What is MDP? Markov Decision Process
Components of an RL agent:
+-----------------+
+--------------------- | |
| | Agent |
| | | +---------------------+
| +----------> | | |
| | +-----------------+ |
| | |
state | | reward | action
S(t) | | r(t) | a(t)
| | |
| | + |
| | | r(t+1) +----------------------------+ |
| +-----------+ | |
| | | | <-----------+
| | | Environment |
| | S(t+1) | |
+---------------------+ |
| +----------------------------+
+
* Sutton and Barto (1998)
Explanation of the Markov Property:
Why Maximizing utility in:
What is the policy & what to do with it?
Value functions:
Optimal policies and optimal value functions.
Key challenges in RL:
The RL lingo.
In large state spaces: Need approximation:
Deep Q-network (DQN) and tips.
Deep Reinforcement Learning by Pieter Abbeel, EE & CS, UC Berkeley
Why Policy Optimization?
Cross Entropy Method (CEM) / Finite Differences / Fixing Random Seed
Likelihood Ratio (LR) Policy Gradient
Natural Gradient / Trust Regions (-> TRPO)
Actor-Critic (-> GAE, A3C)
Path Derivatives (PD) (-> DPG, DDPG, SVG)
Stochastic Computation Graphs (generalizes LR / PD)
Guided Policy Search (GPS)
Inverse Reinforcement Learning
Explanation with Implementation for some of the topics mentioned in the Deep Reinforcement Learning talk, written by Arthur Juliani
Reinforcement Learning by David Silver (UCL):
CS 294: Deep Reinforcement Learning, Spring 2017 by Sergey Levine, John Schulman, Chelsea Finn. My notes from taking it are at notes/cs294-2017/.
CS 285: Deep Reinforcement Learning (Berkeley), the current version of CS294, updated each year.
Deep RL Course (Hugging Face). Hands-on, uses current tooling.
Spinning Up in Deep RL (OpenAI). Explanations plus reference implementations.
(With identifiers so you can check them. The lecture series goes into these.)
More, organized by topic, in reference/papers/.
Suggestions and corrections welcome via issues or pull requests. If you fix an error in an unreviewed lecture, note what was wrong. That's the most useful kind of contribution here.

Licensed under Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.
25 commits
7 commits
Python
100.0%