About this course
RLHF, AlphaGo, game-playing agents — they all stand on the same foundation: an
MDP that writes sequential decision-making as math, and one update rule that makes
value converge sweep by sweep. This is a flagship build-it-yourself course: no gym,
no GPU. Every world — a grid, a cliff, a continuous cart — is one you assemble in
pure numpy; every algorithm is one you derive by hand, complete a few critical
lines of, and actually run to convergence in your own sandbox. You'll prove value
iteration is a γ-contraction and watch the error shrink by a factor of γ each
sweep; watch SARSA and Q-learning develop two personalities at the cliff edge;
trigger the deadly triad until the weights blow up to infinity, then tame them;
build a mini-DQN with hand-written backprop in pure numpy and watch the return
curve climb; derive the policy gradient theorem, add a baseline, then bolt on a
critic to make actor-critic; and finally turn exploration from intuition into
theory with regret bounds via UCB and Thompson sampling — and see what offline
RL's distribution shift is afraid of. The course follows the knowledge skeleton of
Stanford CS234, but every session is an original hands-on script rewritten for the
online sandbox: formulas typeset, algorithms drawn, key knobs draggable, code run.
What you'll learn
- Cast sequential decision-making as an MDP, prove value iteration is a γ-contraction, and watch the error shrink by γ each sweep
- Implement model-free MC, TD(0), TD(λ), SARSA and Q-learning, and explain the on/off-policy personality gap
- Trigger the deadly triad's divergence with linear function approximation, then build a mini-DQN with hand-written backprop in pure numpy
- Derive the policy gradient theorem, write REINFORCE, add a baseline, then bolt on a critic to make actor-critic
- Turn exploration into theory with regret bounds via UCB and Thompson sampling, and understand offline RL's distribution shift
- Clone behavior from expert demos, simulate compounding errors εT² by hand, patch it with DAGGER and inverse RL, then hand-write UCT and AlphaZero's PUCT & temperature policy
Syllabus
1MDP Foundations: Formalism, Value Iteration & Policy Iteration5 sessions
- 1The MDP: States, Actions, Transitions, Return & Discount30 minStart →
- 2The Bellman Expectation Equation & Iterative Policy Evaluation30 minStart →
- 3Value Iteration & the Contraction Mapping (Bellman Optimality Operator)30 minStart →
- 4Policy Iteration & the Policy Improvement Theorem30 minStart →
- 5Challenge: Bellman Residual Performance Bounds & RiverSwim (A1)30 minStart →
2Model-Free: MC, TD(λ) & SARSA vs Q-learning4 sessions
3Value-Function Approximation: Linear FA, Semi-Gradient TD & the Deadly Triad3 sessions
4Deep Q-Networks: Hand-Written Backprop, Experience Replay & a Mini-DQN4 sessions
- 1A Neural Net as Q-Function: Forward Pass & Hand-Written Backprop30 minStart →
- 2Experience Replay & Target Network: Curing Correlation and Non-Stationary Targets30 minStart →
- 3Assemble a Mini-DQN and Train: Watch the Return Curve Climb30 minStart →
- 4Challenge: DQN Synthesis — from Tabular Q-learning to Replay Decorrelation (A2)30 minStart →
5Policy Gradient & Actor-Critic: The Theorem, REINFORCE & Advantage4 sessions
- 1The Policy Gradient Theorem: Likelihood Ratio & Score Function30 minStart →
- 2REINFORCE & Baseline: Variance Reduction30 minStart →
- 3Advantage & Actor-Critic: Critic Bootstrapping & A2C30 minStart →
- 4Challenge: Policy Gradient Synthesis — PPO Clipping, Occupancy Measure & the Performance-Difference Lemma (A2)30 minStart →
6Imitation Learning: Behavior Cloning, Compounding Errors, DAGGER & Inverse RL3 sessions
7Exploration Theory: Regret, UCB & Thompson Sampling3 sessions
8Monte Carlo Tree Search & Conquering Go: from UCT to AlphaZero3 sessions
9Offline RL & the Frontier Bridge: Distribution Shift, Conservative Q & Preference Learning3 sessions
Same series · 世界名校知名实验室系列
Flagship University Lab Series
Modeled on Stanford / MIT / Berkeley syllabi — learn from scratch with a mentor Agent guiding you in real time.
◎ Modeled on Stanford CS336
LLM from ScratchHand-build every piece of an LLM, along the 17-lecture skeleton of Stanford CS336View course →◎ Modeled on Berkeley’s LLM Agents course
LLM Agents: From Reasoning to Agentic SystemsAlong the 12-lecture skeleton of Berkeley's LLM Agents course — reasoning, frameworks, applications and safety, all hands-onView course →◎ Modeled on Stanford CS329A (Self-Improving AI Agents)
Self-Improving AI AgentsHand-build AI agents that make themselves better, along the skeleton of Stanford CS329AView course →◎ Modeled on MIT’s How to AI (Almost) Anything (multimodal)
Multimodal AI: Teaching Models to See, Hear, and ConnectTurn images, sound and text into tensors by hand — then build alignment, fusion, cross-modal retrieval and multimodal models piece by pieceView course →◎ Modeled on Princeton COS 511 (Theoretical ML)
Learning Theory: PAC, Boosting & Online LearningHand-derive PAC bounds, hand-build AdaBoost, hand-run regret curves — turn learning theory from formulas into experiments you runView course →◎ Modeled on CMU’s ML in Production (MLIP)
Machine Learning in ProductionTurn a model that merely runs into a system that survives productionView course →