The five things a problem needs to be an MDP
- : the set of states.
- : the set of actions.
- : the probability of landing in .
- : the reward for taking in .
- : the discount.
Writing a problem in this form is most of the work of applying reinforcement learning to it, and it is where most attempts go wrong.
The Markov property is the assumption that the current state contains everything relevant. The history adds nothing once you know where you are.
That is a claim about the state representation rather than about the world.
A state that omits something important makes the environment non-Markov, and the fix is a better state, not a better algorithm.
The Bellman equations
The value of a state is the immediate reward plus the discounted value of where you end up, averaged over the policy and the transitions.
The optimality equation replaces the average over actions with a maximum, and its solution is the value of behaving optimally forever.
This is a recursion rather than a formula, and every method in the field is a way of solving it: exactly when the model is known, and by sampling when it is not.
Solving it when and are known
- Initialise to zero for every state.
- Sweep every state, replacing with the right-hand side of the optimality equation.
- Repeat until the largest change in a sweep falls below a tolerance.
- Read the optimal policy off as the action achieving each maximum.
- Stop, since that policy is provably optimal.
Value iteration converges because the Bellman operator is a contraction with factor , so the error shrinks geometrically and the fixed point is unique.
That is also why it is unusable on real problems: the state space of a board game or a robot is astronomically large and cannot be swept once, let alone repeatedly.
When the assumptions fail
If the agent sees an observation rather than the state, the problem becomes a POMDP.
The standard response is to make the state a summary of the history, which is what a recurrent or attention-based policy does.
Unknown and call for model-free learning.
When the transition probabilities are unknown, the expectations cannot be computed and must be sampled instead, which is exactly what Q-learning and policy gradients do.
A continuous calls for function approximation.
And when the state space is continuous or enormous, the table becomes a network.
That is the step from classical reinforcement learning to the deep version, and the step that gives up every convergence guarantee above.