Reinforcement Learning
Learning control policies from reward.
Prerequisites
Why it matters in robotics
Reinforcement learning lets a robot learn control policies that are hard to hand-engineer — locomotion, dexterous manipulation, and whole-body control — by trying actions in a state, receiving rewards, and gradually improving its behavior. Sample efficiency, reward design, the exploration/exploitation trade-off, and the choice between different families of learning algorithms shape whether a policy is learnable. The gap between simulation and the real world, addressed with randomized training conditions and careful reward shaping, dominates real-robot deployment.
What to study
- ✓MDP formulation: states, actions, rewards, returns, discounting, and the Bellman equations / value functions
- ✓Core algorithm families: value-based (Q-learning, DQN) vs policy-gradient / actor-critic (REINFORCE, PPO, SAC) and their tradeoffs
- ✓Exploration vs exploitation, on-policy vs off-policy learning, and sample efficiency
- ✓Robotics specifics: reward shaping, continuous control, and the sim-to-real gap (domain randomization, system identification)
Where to study
Cheatsheet
Symbols used below
MDP and return
An MDP is the tuple with transition dynamics and reward, satisfying the Markov property: the next state depends only on the current state and action.
The return is . Discounting () keeps infinite sums finite and weights near-term reward more heavily.
Bellman equation
This recursive relationship — value now equals immediate reward plus discounted value of what follows — is what every value-based method exploits.
Value-based: Q-learning / DQN
Q-learning updates toward the best next action regardless of what was actually taken (off-policy): .
DQN replaces the table with a neural network and adds experience replay and a target network to stabilize training with correlated, non-stationary data.
Policy-gradient & actor-critic
REINFORCE directly increases the probability of actions that led to high return: it moves 's parameters along .
Actor-critic methods (PPO, SAC) add a learned value function (the critic) to reduce the variance of that gradient estimate, and constrain or regularize the policy update for stability — PPO clips the policy change per step, SAC adds an entropy bonus to keep exploring.
Exploration vs exploitation, on- vs off-policy
An agent must trade exploiting the best-known action against exploring to discover better ones — common tactics are -greedy, entropy bonuses, or optimism under uncertainty.
On-policy methods (REINFORCE, PPO) learn only from data generated by the current policy; off-policy methods (Q-learning, SAC) can reuse past experience from any policy, which is usually more sample-efficient but less stable.
Sim-to-real gap
Policies trained in simulation often fail on the real robot because dynamics, sensor noise, and visuals differ from the sim model.
Domain randomization varies simulated physics/appearance during training so the policy generalizes across that uncertainty; system identification instead tunes the simulator's parameters to better match the real robot. Reward shaping — adding intermediate signals — helps sparse-reward tasks learn faster but risks encouraging unintended shortcuts if misdesigned.
| Value-based (Q-learning, DQN) | Policy-gradient / actor-critic (REINFORCE, PPO, SAC) | |
|---|---|---|
| Learns | Action-value function | Policy directly (plus a critic in actor-critic) |
| Action space | Best suited to discrete actions | Handles continuous action spaces naturally |
| On/off-policy | Typically off-policy, sample-efficient | REINFORCE/PPO on-policy; SAC off-policy |
| Stability | Can be unstable without replay + target nets | Generally smoother but needs variance reduction |