Skip to content

0bserver07/Study-Reinforcement-Learning

Repository files navigation

Study Reinforcement Learning

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 on your own.

What's here

  • notes/ — the lecture series (notes/lectures/), plus cheat sheets and diagrams. Currently unreviewed; see notes/README.md for the index and review status.
  • exercises/ — small coding exercises with tests and reference solutions. Built to be worked through step by step, with a coding agent or on your own.
  • CURRICULUM.md — the ordered path through the lectures and exercises.
  • Archive/ — the original 2017 course notes (CS294 Deep RL, Berkeley) and a short Sutton & Barto digest. Kept as written.
  • reference/papers/ — reading lists of recent papers, collected from arXiv by the script in tools/.
  • tools/arxiv-collector/ (fetches arXiv papers), lit-builder/ (conference-paper triage — a retuned copy of iclr-lit-builder: fetches ICLR/NeurIPS/ICML paper lists, keyword-filters, LLM-scores 0–3 with a reason), and content-pipeline/ (drafts blog posts / threads from papers; auxiliary).

Start here

  • New to RL: read CURRICULUM.md, then start notes/lectures/01-mdps-bellman.md. Do the exercises as you go.
  • Know RL, here for the LLM part: skim lectures 1–5, then 9 onward (reward modeling → PPO for LLMs → DPO → GRPO).
  • Want the original 2017 notes: Archive/2017-Course-Notes/.
  • Working in this repo with Claude Code or Codex? Read AGENTS.md first.

For the foundational external material the repo has always pointed at — talks, books, courses — see below. It's still the best starting point if you want lectures from the people who built the field.

The landscape

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.

The landscape — six reward sources, one MDP. Where each RL family fits: classical RL, RLHF, RLAIF, RLVR, agentic RL, and offline RL.


Talks to start with

  • 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:

      • states
      • actions (Probabilistic effects)
      • Reward function
      • Initial state distribution
                                      +-----------------+
               +--------------------- |                 |
               |                      |      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:

      • Episodic tasks
      • Continuing tasks
        • The discount factor, gamma γ
    • What is the policy & what to do with it?

      • A policy defines the action-selection strategy at every state:
    • Value functions:

      • The value of a policy equations are (two forms of) Bellman’s equation.
      • (This is a dynamic programming algorithm).
      • Iterative Policy Evaluation:
        • Main idea: turn Bellman equations into update rules.
    • Optimal policies and optimal value functions.

      • Finding a good policy: Policy Iteration (Check the talk Below By Peter Abeel)
      • Finding a good policy: Value iteration
        • Asynchronous value iteration:
        • Instead of updating all states on every iteration, focus on important states.
    • Key challenges in RL:

      • Designing the problem domain
        • State representation – Action choice – Cost/reward signal
      • Acquiring data for training – Exploration / exploitation – High cost actions – Time-delayed cost/reward signal
      • Function approximation
      • Validation / confidence measures
    • The RL lingo.

    • In large state spaces: Need approximation:

      • Fitted Q-iteration:
        • Use supervised learning to estimate the Q-function from a batch of training data:
        • Input, Output and Loss.
          • i.e: The Arcade Learning Environment
    • Deep Q-network (DQN) and tips.

  • Deep Reinforcement Learning by Pieter Abbeel, EE & CS, UC Berkeley

Books

Courses

Some landmark papers in RL for LLMs

(With identifiers so you can check them. The lecture series goes into these.)

  • AlphaCode — Competition-level code generation with AlphaCode, Li et al., Science 2022. arXiv:2203.07814
  • CodeRL — CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning, Le et al., NeurIPS 2022. arXiv:2207.01780
  • InstructGPT — Training language models to follow instructions with human feedback, Ouyang et al., 2022. arXiv:2203.02155
  • DPO — Direct Preference Optimization: Your Language Model is Secretly a Reward Model, Rafailov et al., 2023. arXiv:2305.18290
  • DeepSeek-R1 — DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning, DeepSeek-AI, 2025. arXiv:2501.12948

More, organized by topic, in reference/papers/.

Communities


Contributing

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.

License

cc

Licensed under Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages