The Markov Property & Agent State
Histories, sufficient statistics, and building a state from what the agent observes.
An Atari frame does not show which way the ball is moving, and a robot's camera does not show what is behind it. Real agents receive observations, not states. This lesson makes "state" precise: the history, information states and sufficient statistics, the agent state an RL system must build for itself, and what goes wrong when an agent learns on a state that is not Markov.
What you’ll learn
- Define histories, information states and the Markov property as a conditional independence, and explain why an information state supports an exact Bellman equation.
- Construct agent states by frame stacking, recurrent updates, belief states and predictive state representations, and compare what each guarantees.
- Analyze perceptual aliasing: show that the best memoryless policy may need to randomize, and why TD learning on aliased observations converges to the wrong values.
- Define bisimulation, and prove that bisimilar states have equal optimal values.
Histories, information states and the Markov property
Suppose the agent receives observations rather than the environment's state. Everything it has seen is its history
and anything it could ever use to act is a function of . A candidate state is Markov if, given and the action, the rest of the history carries no further information about what comes next, that is, :
In a POMDP whose model the agent knows, which of these is an information state?
- The last observation
- The last four observations
- The belief
- The number of steps taken so far
Show the answer
C. The belief
The next observation and reward depend on the hidden state, so the posterior over it predicts them exactly as well as the full history, and Bayes' rule updates it recursively from . The belief state is the classic information state of POMDPs (Åström, 1965; Kaelbling, Littman & Cassandra, 1998). Finite windows of observations qualify only in special environments.
Building an agent state
An RL agent must construct its own agent state, usually without a model of the environment; Sutton and Barto (§17.3) write the update as . The main options trade guarantees for practicality.
| Agent state | Update | Markov when | Used in |
|---|---|---|---|
| Last observations (frame stacking) | Shift a window | The environment is -th order Markov in its observations | DQN's four stacked Atari frames, which recover velocities |
| A recurrent network's state | , learned | Never guaranteed; trained to serve the agent's losses | Recurrent value-based and actor–critic agents |
| Belief state | Bayes' rule with a known model | Always, if the model is correct | POMDP planning, and the tiger problem below |
| Predictive state | Update predictions of future observations | Always, for systems with a finite linear PSR | Predictive state representations (Littman, Sutton & Singh, 2001) |
| A transformer's context window | Append, keep the last tokens | Like frame stacking, with a long window | Language-model agents and in-context RL |
Predictive state representations show that a state need not be a guess about hidden variables at all. A test is a sequence of future actions and observations, and the state is the vector of probabilities that a few core tests would succeed if attempted. Littman, Sutton and Singh (2001) showed that every system that can be modeled as a POMDP with hidden states has a linear PSR with at most core tests: predictions about the future are always as compact as a hidden-state model, and they are grounded in quantities the agent can observe.
A tiger hides behind the left or the right door, and listening reports the correct side with probability . Write the belief as log-odds . Hearing left multiplies the odds by the likelihood ratio:
Hearing right subtracts the same amount, and the tiger stays put until a door is opened. Starting from , that is , the belief depends on the whole history of reports only through the difference :
Two agreeing reports give . A history of any length compresses to one integer, which is a sufficient statistic and an information state for this problem. Optimal play can be stated on it directly: with the long-run optimal policy listens until one side leads by two reports, then opens the other door.
Aliasing: learning on a state that is not Markov
In the two-rooms world, what is the average reward per step of the memoryless policy that takes with probability 0.75?
Show the answer
-0.25
. The chain is in a quarter of the time, earning per step there, and in three quarters of the time, earning : in total .
Singh, Jaakkola and Jordan (1994) studied exactly this setting, learning without state estimation. They showed that the best stationary stochastic memoryless policy can be arbitrarily better than the best deterministic one (scale the rewards above), that TD learning on observations converges under the usual conditions but in general not to the values one wants, and that the values of memoryless policies do not satisfy a Bellman equation of the usual form. They also conjectured that Q-learning on observations does not in general find even the best deterministic memoryless policy.
The reason is visible in the example. must be one number for two situations with different futures, and which of them dominates the estimate depends on how often the behavior policy visits each, so the estimate shifts whenever the policy does. Policy-gradient methods can find the stochastic optimum because they search over stochastic policies directly. The short corridor of The Policy Gradient Theorem & REINFORCE is the classic instance: every state looks the same, the actions are reversed in one of them, and the best memoryless policy goes right with probability .
What should count as the same state? Bisimulation
Aliasing merges states that should be kept apart. The opposite question matters just as much when building compact states: when can two states be merged without loss? Equal observations are neither necessary nor sufficient.
Run value iteration with the Bellman optimality operator from . Suppose is constant on equivalence classes, so that takes a single value for all . Then for the backup only sees class probabilities:
So every iterate is constant on classes, and so is the limit . The class-level iterates are exactly value iteration on the quotient MDP, which therefore has the same optimal values; a policy that is greedy for them is greedy for .
Exact bisimulation is brittle: rewards that differ by break it. Ferns, Panangaden and Precup (2004) defined bisimulation metrics, the fixed point of a recursion that combines reward differences with a Wasserstein distance between next-state distributions, and showed that they bound differences in optimal values. Coarser state abstractions preserve less: Li, Walsh and Littman (2006) order abstractions from bisimulation, which preserves the whole model, down to ones that keep only , only the optimal action or only an optimal policy, and show that the coarser ones can make some learning algorithms fail. Deep RL uses bisimulation-style objectives to learn representations that ignore task-irrelevant detail (Representation Learning for RL).
Key takeaways
- The history is always Markov but grows without bound; an information state compresses it without losing anything needed to predict rewards and its own future, and optimal policies can act on it alone.
- Agent states trade guarantees for practicality: frame stacks are Markov only for -th order environments, recurrent states never by construction, belief states only with a correct model, and predictive states are grounded in observable predictions.
- Under aliasing the best memoryless policy may need to randomize (it can be arbitrarily better than any deterministic one), and TD learning on aliased observations converges to values that depend on the behavior policy.
- Bisimilar states have identical rewards and transition probabilities into equivalence classes, hence identical optimal values; bisimulation metrics relax this to an approximate notion of "the same state".
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Which statement expresses the Markov property of an agent state ?
- is independent of
- determines the next observation exactly
- Given and , the next observation and reward are independent of the rest of the history
- The agent's policy depends only on
Show the answer
C. Given and , the next observation and reward are independent of the rest of the history
The Markov property is a conditional independence: once and the action are known, nothing else in the past helps to predict what comes next. The future may still be random.
When does stacking the last observations give a Markov state?
- When the next observation and reward depend on the past only through the last observations and actions
- Always, once
- Only in deterministic environments
- Never: only recurrent states can be Markov
Show the answer
A. When the next observation and reward depend on the past only through the last observations and actions
A window of length is Markov exactly for environments that are -th order Markov in their observations. Two frames recover a velocity, but no fixed window recovers a key picked up a hundred steps ago.
In the two-rooms world, where the best memoryless policy takes each action with probability ½, why can ε-greedy Q-learning on the shared observation not find it?
- Its step size is too small
- It needs positive rewards
- It finds it after enough episodes
- Its greedy choice is one fixed action per observation, and ε adds a fixed amount of randomness, not the amount the task requires
Show the answer
D. Its greedy choice is one fixed action per observation, and ε adds a fixed amount of randomness, not the amount the task requires
With and two actions, ε-greedy takes its greedy action with probability 0.95, for an average reward of , far from the optimum 0. Methods that learn action probabilities directly, such as policy gradients, can find the 50/50 policy.
Two states have equal expected rewards for every action and, for every action, equal probabilities of moving into each class of a bisimulation that relates them. What follows?
- They must produce the same observation
- Nothing, unless the transitions are deterministic
- They have the same optimal Q-values, so they can be merged without loss
- They have the same value under every policy, including policies that act differently in the two states
Show the answer
C. They have the same optimal Q-values, so they can be merged without loss
Value iteration keeps every iterate constant on bisimulation classes, so , and the quotient MDP has the same optimal values and, lifted back, the same optimal policies.
Further reading
- M. L. Littman, R. S. Sutton & S. Singh, "Predictive representations of state," Advances in Neural Information Processing Systems 14 (2001).
- S. P. Singh, T. Jaakkola & M. I. Jordan, "Learning without state-estimation in partially observable Markovian decision processes," ICML, 284–292 (1994).
- R. Givan, T. Dean & M. Greig, "Equivalence notions and model minimization in Markov decision processes," Artificial Intelligence 147(1–2), 163–223 (2003).
- L. P. Kaelbling, M. L. Littman & A. R. Cassandra, "Planning and acting in partially observable stochastic domains," Artificial Intelligence 101(1–2), 99–134 (1998).
- R. S. Sutton & A. G. Barto, Reinforcement Learning: An Introduction, §17.3 (MIT Press, 2nd ed., 2018).