Reinforcement learning

My notes tracing reinforcement learning from Sutton and Barto's first principles through to the policy alignment methods that train reasoning LLMs. Seven chapters, in the order the ideas actually build on each other: the problem, then the formal framework, then two different ways of solving it, then what happens when the state space is a sequence of tokens.

Written for me, so the emphasis is on why each method exists rather than on covering everything. Entries in grey are notes I have not written yet.

The problem

The formal framework

Solving it when you know the world

Solving it from experience

Optimising the policy directly

RL for language models

Reference

Prerequisites: calculus (derivatives and the chain rule), linear algebra, probability (expectations and distributions), and basic Python.