Partial Observability & POMDPs
Acting on beliefs when you cannot see the state.
A doctor never sees the disease, only symptoms and test results; a robot never sees its position, only what its sensors report. When the state is hidden, an agent must act on what it believes, and the belief itself becomes the state: a partially observable MDP turns into an MDP whose states are probability distributions. This lesson builds that belief MDP, solves the tiger problem with it, and shows why an optimal agent sometimes pays for information instead of acting.
What you’ll learn
- Define a POMDP and derive the belief update as a Bayes filter, with a predict step and a correct step.
- Build the belief MDP, with its rewards, transitions and Bellman equation, and explain why the belief is a sufficient statistic.
- Derive the tiger problem's one-step value function, and explain why optimal policies at longer horizons listen more before opening.
- Compare a belief-based policy with a policy that reacts only to the latest observation, and with planning as if the state were visible.
States you cannot see
A partially observable MDP (POMDP) is an MDP whose state the agent never sees. It is a tuple : an ordinary MDP, a finite set of observations , an observation model giving the probability of seeing after an action that led to state , and an initial distribution over the states. After each action the agent receives a reward and an observation , but not . All it can use is its history of actions and observations.
Hidden state is the rule, not the exception. A mobile robot estimates its position from noisy sensors (Thrun, Burgard & Fox, 2005); a spoken dialogue system must guess what the user wants from error-prone speech recognition (Williams & Young, 2007); a physician chooses tests and treatments for a disease that is observed only indirectly (Hauskrecht & Fraser, 2000).
A reactive policy chooses its action from the latest observation alone, ignoring everything before it. What is the best reactive policy in the tiger problem, with ?
- Open the right door after every hear left and the left door after every hear right, which is right 85% of the time
- Listen forever, worth
- Open a door at random
- Listen after hear left, open the left door after hear right
Show the answer
B. Listen forever, worth
A single report is wrong 15% of the time, so opening on it is worth before counting the listen, and after a door is opened the next report is pure noise, on which a reactive policy would act too. Every reactive policy that ever opens a door does worse than never opening: in total. A policy that tracks its belief earns about from the same start, as this lesson will show. (The Markov Property & Agent State shows a world in which the best reactive policy must randomize.)
The belief update is a Bayes filter
The agent's belief is the posterior over the hidden state given everything seen so far, . After action and observation , Bayes' rule updates it in two moves: predict where the state went, then weigh each candidate by how well it explains the observation.
Predict. Push the belief through the dynamics of the action taken:
Correct. Multiply by the likelihood of the observation and normalize. The normalizer is the probability of seeing , which the planner will need as well:
Write for this belief update. In the tiger problem, listening does not move the tiger, so the predict step does nothing, and each hear left multiplies the odds of TL by while each hear right divides them by it. From , after more hear left reports than hear right ones:
import numpy as np
def belief_update(b, a, o, P, Z):
"""b[s]: belief. P[a][s, s2] = P(s2 | s, a). Z[a][s2, o] = Z(o | s2, a).
Returns the new belief and the probability of having seen o."""
predicted = b @ P[a] # predict: sum_s b(s) P(s2 | s, a)
unnormalized = predicted * Z[a][:, o] # correct: weigh by the likelihood of o
prob_o = unnormalized.sum()
return unnormalized / prob_o, prob_oOne update costs . The belief is a sufficient statistic for control: it predicts future observations and rewards as well as the whole history does, and it updates recursively (Åström, 1965), so the agent can forget the history and keep only .
The belief MDP
Because the belief summarizes the history exactly, a POMDP is an MDP whose states are beliefs, the points of the probability simplex . Its rewards and transitions follow from the model.
With two hidden states the belief is one number, , and every value function is a curve over . With one decision left, each action's value is linear in :
Listening is worth whatever the belief. Opening the left door gains 10 if the tiger is on the right and loses 100 if it is on the left, and symmetrically for the right door:
Opening the left door beats listening when , that is , and opening the right door when . With one decision left, open only when at least 90% sure:
is the upper envelope of three lines, so it is piecewise linear and convex. Convexity is the value of information in geometric form: learning which of two beliefs you are in is never worse than staying at their average. Every horizon has this shape (Belief MDPs & α-Vectors).
With and starting from , what is the smallest net lead (reports for one side minus reports for the other) that makes your belief in that side at least 0.99?
Show the answer
3
gives , and gives . In log-odds, each report adds or subtracts , and 0.99 needs log-odds : three net reports.
Planning over beliefs: why listen several times
Value iteration works on the belief MDP as on any MDP, over beliefs, and for the tiger problem it can be computed exactly. The thresholds for opening move in a surprising way as the horizon grows:
| Decisions left | Open left if | Open right if | |
|---|---|---|---|
| 1 | 0.100 | 0.900 | −1.00 |
| 2 | 0.0243 | 0.9757 | −1.95 |
| 3 | 0.0115 | 0.9885 | 2.31 |
| 4 | 0.0686 | 0.9314 | 1.80 |
| 20 | 0.0389 | 0.9611 | 11.88 |
| 0.0397 | 0.9603 | 19.37 |
Why stop at a lead of two? Each round of "listen until one side leads by , then open the other door" trades the cost of listening against the risk of the tiger:
| Lead | Listens per round | Right door | Reward per round | Value from () |
|---|---|---|---|---|
| 1 | 1 | 85.0% | −7.5 | −73.6 |
| 2 | 2.7 | 97.0% | +4.0 | +19.37 |
| 3 | 4.2 | 99.5% | +5.2 | +16.26 |
| 4 | 5.7 | 99.9% | +4.2 | +8.64 |
Per round, waiting for a lead of 3 earns more (+5.2) than a lead of 2 (+4.0). Why is the lead-2 policy the optimal one with ?
- Its rounds are shorter, so it collects its rewards sooner and more often
- A lead of 3 is reached in fewer rounds
- The belief after a lead of 3 is less accurate
- It is not: the lead-3 policy is optimal
Show the answer
A. Its rounds are shorter, so it collects its rewards sooner and more often
A round with lead 3 takes about 4.2 listens plus the opening, against 2.7 plus the opening. Per step that is against , and discounting rewards the faster rhythm as well: 19.37 against 16.26 from .
Shortcuts, and why exact planning is hard
Planning as if you could see. A popular shortcut, QMDP, solves the underlying MDP and scores each action by , as if the state were revealed after one step. On the tiger problem it listens until passes 0.9 and then opens, which is the lead-of-two policy, by luck: it listens because listening is cheap, not because it is informative, and it cannot tell listening apart from an action that costs the same and reveals nothing (Approximate POMDP Planning shows it then fails).
Why exact planning is hard. Beliefs form a continuum of dimension , the curse of dimensionality, and the beliefs reachable in steps can multiply like , the curse of history. Finite-horizon POMDP planning is PSPACE-complete, against P-complete for MDPs (Papadimitriou & Tsitsiklis, 1987). Three families of methods respond: exact value iteration over α-vectors for small problems, point-based and online search methods for large ones, and, in deep RL, agents that learn a memory instead of a model.
Key takeaways
- A POMDP adds observations to an MDP. The agent acts on its belief , updated by a Bayes filter: predict through , correct with , normalize.
- The belief is a sufficient statistic, so a POMDP is an MDP over the simplex, with reward and a move to with probability .
- Value functions over beliefs are piecewise linear and convex (for the tiger, an upper envelope of lines), and convexity says that information never hurts.
- In the tiger problem the optimal policy listens until one side leads by two reports (), worth 19.37 from ; the best reactive policy never opens and earns .
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In the tiger problem () you start at and hear left, left, right, left. What is your belief that the tiger is on the left?
- 0.85
- 0.970
- 0.5
- 0.9945
Show the answer
B. 0.970
Only the net count matters: three left against one right is a lead of two, so , the same as two left reports in a row.
In the belief MDP, with what probability does belief move to after action ?
- for the true next state
- 1, because the belief update is deterministic
Show the answer
D.
The next belief is a deterministic function of , but the observation is random. Its probability, averaged over where the state might be and where it goes, is the normalizer of the Bayes update.
With one decision left in the tiger problem, for which beliefs is opening the left door optimal?
- Never: with one decision left, listening is always best
Show the answer
C.
Opening the left door is worth , which beats listening's when ; with no later step, listening cannot pay off. With two decisions left the threshold drops to about 0.024, because listening once and then deciding is better than gambling now.
QMDP scores actions by . Why can it fail to gather information?
- It assumes the state will be known after one step, so information has no value in its scores
- It uses the wrong discount factor
- It ignores the rewards of the POMDP
- It needs the belief to be exact
Show the answer
A. It assumes the state will be known after one step, so information has no value in its scores
Under QMDP's assumption the uncertainty vanishes after one step whatever you do, so an informative action scores the same as an uninformative one with the same cost. On the tiger problem it happens to act optimally; offered an action that costs slightly less than listening and reveals nothing, it would take that one forever.
Go deeper
- Belief MDPs & α-Vectors · Why POMDP values are piecewise-linear and convex, and how exact solvers use it.
- Approximate POMDP Planning · Point-based value iteration and Monte Carlo planning in belief space.
- Memory in Deep RL · Frame stacks, recurrent and transformer agents: learning to remember what matters.
Further reading
- 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).
- K. J. Åström, "Optimal control of Markov processes with incomplete state information," Journal of Mathematical Analysis and Applications 10, 174–205 (1965).
- R. D. Smallwood & E. J. Sondik, "The optimal control of partially observable Markov processes over a finite horizon," Operations Research 21(5), 1071–1088 (1973).
- S. Thrun, W. Burgard & D. Fox, Probabilistic Robotics (MIT Press, 2005).