State Abstraction in MDPs: Bisimulation and Safe State Merging
Merging states is not compression. It is a claim about the future, and most merges quietly change the problem.

Key topics
Merging states is not compression. It is a claim about the future, and most merges quietly change the problem.
Picture a tabular agent with a million states. The table is too big to fill, the backup loop is too slow to run, and somewhere in the middle of the state space you notice two states that "look the same." The instinct is immediate: merge them, shrink the table, move on. That instinct is where most silent bugs in value-based systems are born.
Here is the test this article builds toward. A merge is safe only if it preserves rewards and the distribution over future merged states, recursively, for every action. That single sentence is the whole idea. Everything below is the machinery that makes it checkable, plus one worked merge that survives and one plausible merge that does not.
I'll assume you already have the MDP tuple, discounted return, and , and the Bellman backup. If those are shaky, the formal map of MDPs and the derivation of the Bellman relationships are the two pieces to revisit first — this article leans on both without re-deriving them.
Why Merging States Is a Claim About the Future
The practical motivation is real. Tabular methods scale with the number of states: memory grows linearly, and the cost of a full sweep grows with . Aggregation is one of the few levers that attacks both at once. Fewer states means a smaller table, fewer samples to fill it, and cheaper planning.
But the lever has a hidden hinge. When you merge two states, you are asserting that no future decision can distinguish them. Not that they look alike — that they are behaviorally interchangeable. Feature similarity is a statement about the present. Interchangeability is a statement about every trajectory that could follow.
That distinction is the weak model to kill early. Two states can share every observable feature and still be different problems: one sits next to a cliff, the other next to a wall. Two states can look completely different and be the same problem: a corridor at sunrise and the same corridor at noon, when lighting is irrelevant to the task.
The stronger model is recursive. Two states are interchangeable only if, for every action, they yield the same immediate reward and lead to futures that are themselves interchangeable. Equivalence is defined in terms of equivalence. That self-reference sounds circular, but it is exactly what makes the condition checkable: it gives you a fixed-point equation, and fixed points can be computed.
Knowledge check
Check your understanding
Answer this question before you continue.
Notation and the Abstraction Map
Fix the MDP with finite and , stationary dynamics , expected reward , and discount . State values and action values are the usual discounted expectations.
An abstraction is a surjective map onto a smaller set of abstract states. Each is an equivalence class — a block — of ground states, and means state belongs to block .
The abstraction induces a new decision process on . The natural lift averages over the members of a block:
Warning: The induced process is not automatically Markov. If two states inside a block have different next-state distributions, the block's transition probabilities depend on which member you are actually in — information the abstract state has thrown away. The abstract process can be non-Markov even when the ground process is perfectly Markov.
This is where two ideas get conflated. State aggregation is a representation choice: you picked a map . Bisimulation is a correctness condition on that choice. Aggregation is what you did; bisimulation is whether it was allowed.
Exact Conditions: Reward Preservation and Transition Preservation
Two conditions define a bisimulation relation on the ground states. Both must hold for every action.
Reward preservation. For all with , and every :
Same action, same immediate payoff. This forbids merging a state that pays with one that pays under the same action, no matter how similar their transitions look.
Transition preservation. For all with , every , and every abstract target :
Read the left side carefully: it is the total probability mass that action in state sends into block . The condition requires that mass to match for every block.
The block-level phrasing is not a technicality. It is the permission slip. The merge is allowed to reshuffle which member of a block you land in — that is invisible to the abstract agent. What it cannot do is change how much probability flows into each block. If sends 0.9 of its mass into block and sends 0.4, the two states are not interchangeable, even if they both sometimes reach .
Recursive closure. The conditions above are stated over blocks, and blocks are made of states that must themselves satisfy the conditions. That closure is what makes this bisimulation rather than one-step aggregation. A one-step check can pass while the recursion fails two steps later, because the blocks you land in are not internally consistent.
What each condition rules out is clean. Reward mismatch breaks the immediate comparison — the agent cannot even rank actions within the block. Transition mismatch breaks the value of the future even when rewards agree perfectly, because the two states face different distributions over where they end up.
Knowledge check
Check your understanding
Answer this question before you continue.
Worked Example: A Valid Merge
Take a four-state corridor. States in a line, two actions: left and right. Moving right from or left from stays put. Reward is on entering and otherwise. Discount .
Now consider merging and into a single block , keeping and as singleton blocks.
Reward check. and . Rewards match for both actions.
Transition check. Compute block-level mass for each action.
| From | Action | Mass into | Mass into | Mass into |
|---|---|---|---|---|
| right | 0 | 1.0 | 0 | |
| right | 0 | 1.0 | 0 | |
| left | 1.0 | 0 | 0 | |
| left | 1.0 | 0 | 0 |
Both rows match for both actions. The merge is valid.
Now solve. On the ground MDP, (absorbing, no further reward), , , .
On the abstract MDP with block , the block's value under the optimal policy is the same for both members, because both members have identical reward and identical block-level transitions. The optimal action in the block is right for both. The abstraction bought a smaller table without buying a different problem.
That is what planning equivalence looks like in numbers: same values, same policy, fewer rows.
Knowledge check
Check your understanding
Answer this question before you continue.
Counterexample: A Merge That Looks Fine and Is Not
Now the trap. Two states, and , with identical rewards for every action — say for all . They look mergeable. They are not.
Let the dynamics differ. From , action sends you to a high-value state with probability 1. From , action sends you to a low-value state with probability 1. Rewards are identical; futures are not.
Solve the ground MDP with , , :
The merged block averages the transition: half the mass to , half to . The abstract value becomes:
The merged value is wrong for both states. It overstates by 4.5 and understates by 4.5. Any policy computed on the abstract MDP is optimizing a problem that does not exist.
Second variant: transitions match, rewards do not. Let and have identical next-state distributions for every action, but and . The merged reward is . The abstract MDP now prefers an action that is optimal in the average and suboptimal in the ground problem — the agent learns a policy that is worse than either state deserved.
Common mistake: Treating a failed merge as a compression error. It is not. It is a change of objective. The abstract MDP is a different problem, and its optimal policy is optimal for that different problem.
Knowledge check
Check your understanding
Answer this question before you continue.
What the Equivalence Guarantees — and What It Does Not
Under the two conditions, with the recursion closed, optimal values and an optimal policy transfer between the ground MDP and the abstract MDP. That is the payoff: you can plan on the small problem and act on the large one.
The result rests on assumptions worth naming. Finite state and action sets. Stationary dynamics and rewards. A fixed discount. Exact knowledge of and . Drop any of these and the guarantee weakens.
Estimated or drifting models are the common failure. If your and come from samples, the equality checks become approximate, and small estimation errors can flip a merge from valid to invalid. Non-stationary rewards break the fixed-point structure entirely. Continuous or high-dimensional state spaces make exact partitions brittle: the relation is hypersensitive to infinitesimal changes in rewards or dynamics, so a partition that holds today may not hold after one more update.
The relaxation path is the bisimulation metric. Instead of asking whether two states are exactly equivalent, you ask how far apart they are. The metric replaces the binary partition with a distance that varies smoothly as rewards and dynamics change, and a distance of zero recovers the exact merge. That smoothness is what makes the idea usable when the MDP is estimated or continuous — you trade exactness for robustness.
The honest boundary: exact bisimulation is a correctness criterion for a known finite MDP. It is not a general recipe for learning good representations from raw observations.
When to Reach for This — and When Not To
Use it when you have a known or well-estimated finite MDP, a state space too large to tabulate, and a need to prove that aggregation is safe. Use it as a diagnostic when a learned representation underperforms: check whether the encoder is collapsing states that are not behaviorally equivalent, because that is a silent objective change, not a capacity problem.
Do not reach for it first on a raw pixel environment. Exact partitions are impractical there, and the metric relaxation is the realistic tool. Do not treat it as a substitute for a good state representation — it is a test you run on a representation you already have.
The practical check is mechanical. Before merging any pair of states, write down two equalities for every action: reward equality, and block-level transition equality into every abstract target. If either fails, you have not simplified the problem. You have replaced it.
That is the decision rule. Write the equalities. Check them. A failed check is evidence, not an inconvenience.
When the MDP is estimated rather than known, the next step is replacing the exact partition with a bisimulation distance — the same recursive idea, softened into a metric that tolerates small perturbations. Take a small MDP you already understand, propose a merge, and verify or falsify it numerically. The exercise is short, and it will change how you look at every state table you build afterward.
Knowledge check
Final check
Finish the article by checking the ideas you just learned.
References
Build a stronger RL mental model
Use structured resources to connect equations, algorithms, and observable agent behavior.


