AI Hero Club
← Course Overview

LEARNING PLAN/ Progress

Reasoning and Reinforcement Learning

Use the same two-step arithmetic trajectories to derive REINFORCE, leave-one-out group baselines, and KL divergence. Train a small Transformer and report training gains, compositional extrapolation failures, and format sensitivity separately.

Start with a question, derive the mechanism, then test your implementation with new inputs.

Logical model and enhanced learning cover
8 Chapter / Same full itemSection Learning Recommendations 18 HoursSeparate exercise and project reserved 16 hours

Times are author estimates that include derivation and practice. They have not been measured with learners; work through the sections at your own pace.

WHAT YOU WILL BUILD

What will you build to demonstrate understanding?

  • Definition of trajectory support, rigorous authentication and diagnostic data disaggregation
  • Rebuild score, leave a baseline and KL gradient and check bias with an enumeration
  • Two-step response to genuine shared parameters Transformer and actual RL update
  • Distinguishing learning gains from the same frozen weights, searching budgets, extrapolation failures and failure of formats
What should you know before starting?
  • Operation of Python functions, lists and local files
  • Reads limited summation, logarithm and basic orientation; condition probability, score and group estimation are derived in the body
  • Completion of Transformer field operations and reverse transmission base; recommended training after reading large models

Use the prerequisites to choose a starting point. You can read freely and return to earlier lessons whenever you need them.

THE LEARNING ROUTE

A clear path, one step at a time.

Marked Complete by You0 / 8

Saved in this browser only. Marking a lesson complete does not mean the project has passed verification.

01

Tasks and Estimators

Fixed trajectories and incentives, strategic gradients and group baseline conditions.

01

Define Tasks, Trajectories and Rewards

Which type, length and numerical conditions must a two-step arithmetic trajectory satisfy before it earns a reward?

135 minutes ↗
02

Derive the Full-trajectory Policy Gradient from Finite Sums

When a reward is not directly differentiable with respect to parameters, how do finite trajectory sums yield a policy gradient?

135 minutes ↗
03

Within-group Comparisons and Valid Advantage Estimates

Why can subtracting a group’s mean reward change the expected gradient, and when is a leave-one-out baseline unbiased?

135 minutes ↗
02

Objective and update

Distinguishing KL from cropping and connecting the sampling and full parameter update of the decoder.

04

Reference Policies, KL and Clipping: Distinct Objectives

KL, importance weights and clipping can all constrain updates. Which objective or estimator does each actually change?

135 minutes ↗
05

Connect Complete Trajectories to a Real Transformer

How do two numerical actions map to causal positions in a full Transformer and define one trajectory probability?

135 minutes ↗
06

A Real RL Update: Sampling, Verification and Backpropagation

How do 40 sampled trajectories become one full-parameter update through verification, leave-one-out advantages and rescoring?

135 minutes ↗
03

Evaluation and delivery

Separate training, setting aside, searching budgets, running back and retaining real failures.

07

Report Training Gains, Test Regressions and Sampling Budgets Separately

When training answers improve but every held-out task fails, what can additional sampling and parameter learning each establish?

135 minutes ↗
08

Reproduce from a Clean Directory and Report Failures

How can we reproduce the experiment from a clean directory and report both training gains and failures to generalize?

135 minutes ↗

BUILD / TEST / TRANSFER

2-step arithmetic trajectory enhancement learning lab

Accurate reference to the standard library + local complete Transformer; sample, verify, retain a return, KL, update, listing and freeze evaluation is fully functional.

Runtime Requirements
Python 3.11+ and PyTorch 2.6.0. Single-threaded CPU execution; no GPU or API key is required.

Download the Project ↓

Read the README after extracting the archive, then follow its environment and run instructions. Reference implementations and learning tasks are provided separately.

Project Checklist

This is a personal checklist, not an automatic grade. Keep your inputs, results, failures and reproduction commands.