An MDP is a tuple :
- : states.
- : actions.
- : transition probabilities.
- or : reward.
- : discount factor.
A policy maps states to actions. The value of a policy at state is the expected discounted sum of rewards starting from and following :
Why discount?
- Mathematical convenience: infinite sums converge when .
- Models impatience: rewards now are worth more than rewards later.
- Models uncertainty about the future: with each step, more probability of "the world ending" before you collect the reward.
For episodic tasks with guaranteed termination, is fine. For continuing tasks, between 0.9 and 0.99 is standard.
Bellman equations
For value of a policy:
For the optimal value (Bellman optimality equation):
A policy is optimal iff .
Action-value (Q-) function
The optimal Q-function satisfies . A greedy policy w.r.t. is optimal — and importantly, you don't need to know the transition model to act optimally if you have . That's what makes Q-learning model-free.
Partial observability (POMDPs)
Extend by adding observations and emission probabilities . The agent doesn't see the state directly. Belief state — a distribution over states — replaces the state for policy purposes. POMDPs are dramatically harder to solve than MDPs; exact solution is undecidable in general.
When MDPs are the right model
- The state transitions and rewards are well-defined.
- The state is observable (or close enough).
- You can iterate to compute the value function or learn a policy from experience.
When they're a bad fit: continuous state spaces without good function approximation, partially observable problems with complex belief updates, environments with rich language input. For these you need POMDPs, deep RL, or more bespoke frameworks.