A Markov decision process (MDP) is a mathematical model of an agent making a sequence of decisions in an environment whose next state depends only on the current state and action. It is the formal setting in which almost all of reinforcement learning is defined, analysed and solved.
Definition
An MDP is a tuple : a set of states , a set of actions , a transition function, a reward function and a discount factor . The transition function gives the probability of each next state:
and is the expected reward for taking action in state . The word "Markov" refers to the assumption that this probability does not depend on anything earlier than . An agent acts through a policy , and the goal is to find a policy that maximises the expected discounted return .
Worked example
A cleaning robot has two states, charged and low, and two actions, clean and dock. Cleaning while charged earns reward 2 and leaves the battery charged with probability 0.7, otherwise it drops to low. Cleaning while low earns 2 with probability 0.6 and strands the robot (reward ) with probability 0.4. Docking earns 0 and always returns the robot to charged. The expected immediate reward of cleaning when low is , so a sensible policy docks when low and cleans when charged. Writing the problem down this way turns "be a good robot" into something you can compute with.
Common variants
- Finite-horizon MDPs stop after steps and often use .
- POMDPs hide the state behind observations (see state).
- Constrained MDPs add cost functions with budgets, the usual formalism for safe RL.
- Bandits are MDPs with a single state (see multi-armed bandit).
Why it matters
The MDP is what makes reinforcement learning precise. Once a problem is an MDP, the Bellman equations hold, optimal policies exist, and algorithms such as value iteration, Q-learning and policy gradients come with guarantees. It is also where many real failures start: if the reward function leaves out something you care about, the optimal policy of the MDP you wrote is not the behaviour you wanted. Most of the safety questions in RL are questions about whether the written MDP matches the intended one.
Related terms
Sources
- Richard S. Sutton, Andrew G. Barto. Reinforcement Learning: An Introduction (2nd edition), 2018. incompleteideas.net
- Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming, 1994. doi.org