Maximising a sum of future rewards
- : the reward received at a step.
- : the discount factor.
The agent is not trying to be right about the next step. It is trying to maximise the total reward from here onward, which is the return.
Discounting makes the sum finite on an infinite horizon and expresses how much a reward later is worth compared with one now.
That is roughly the effective horizon: means the agent cares about the next hundred steps or so.
Why this is not supervised learning
Nobody says which action was correct. The agent receives a number, and it has to work out which of its past actions earned it.
This is the credit assignment problem.
A reward at step 100 may be due to a choice at step 3, and separating that from the ninety-seven irrelevant choices is the central difficulty.
The data is also not fixed.
The agent's own policy decides what it sees next, so the distribution changes as it learns, which breaks the independence assumption every supervised method relies on.
The value functions
The state value is how good a position is under the current policy. The action value is how good a particular move from it is.
Knowing gives the optimal policy immediately, which is why so many methods learn it instead of learning the policy.
One interaction, in order
- Observe the current state.
- Choose an action, usually mostly the best known one and occasionally an exploratory one.
- Receive a reward and the next state from the environment.
- Update the estimate of value or of the policy from that transition.
- Repeat until the episode ends, then start again.
The three families
Value-based methods learn and act greedily.
Q-learning and its deep variants estimate values and derive the policy from them, which suits discrete action sets.
Policy-based methods learn directly.
Policy gradients optimise the policy itself, which handles continuous actions and naturally represents a stochastic policy.
Actor-critic methods do both.
The actor chooses and the critic evaluates, which keeps the policy gradient's generality while using a learned value to reduce its variance.
PPO is in this family, and it is what trains language models from human feedback.
The practical constraint across all three is how many environment interactions are needed.
Millions is normal, which is why simulation dominates and why real-world reinforcement learning is hard.