As mentioned on X, I got interested in a POMDP question more than 1 year ago, and discovered many interesting results against my initial intuition. After procrastinating forever, I eventually found time to write things down,1 and decided to share a piece of the counterintuitive results here as a teaser for the paper. The answer can be found in the paper, and I will post the link here after it appears on arXiv. (Update 11/26: paper link)


Background

Suppose we have a simulator modeled as a finite-horizon POMDP Γ\Gamma. When sampling a trajectory in the simulator, we sample latent states from the latent transition PP and generate observations from the emission process EE, and the record of an episode includes o0:H,a0:H,s0:Ho_{0:H}, a_{0:H}, s_{0:H}, i.e., the observations, the actions, and the latent states. The task is to use Monte-Carlo roll-outs to estimate the Q-value for any given (τt,at)(\tau_t, a_t) pair and target policy π\pi, where τt=(o0:t,a0:t1)\tau_t = (o_{0:t}, a_{0:t-1}) is the prefix of an observable trajectory, or history. Note that the Q-function for a POMDP can be defined through the corresponding history-based MDP, i.e., the POMDP induces a conditional distribution of τt+1τt,at\tau_{t+1} \mid \tau_t, a_t, which can be treated as the transition dynamics of an MDP with τt\tau_t as the state.2

In an MDP, we can roll-out multiple trajectories from a given (st,at)(s_t, a_t) pair to estimate Qπ(st,at)Q^\pi(s_t, a_t). Similarly, for the POMDP, we want to roll-out trajectories from (τt,at)(\tau_t, a_t) to estimate Qπ(τt,at)Q^\pi(\tau_t, a_t). The problem is that the given (τt,at)(\tau_t, a_t) does not include the value of sts_t, without which we cannot roll-out the simulation. The POMCP paper ran into this problem when they tried to apply MCTS to POMDPs, and suggested that the correct approach is to sample sts_t from the belief state, b=P[stτt]\mathbf{b}^\star = \mathbb{P}[s_t \mid \tau_t]. That is, if we have access to b\mathbf{b}^\star, below is the correct way to sample an unbiased estimate of Qπ(τt,at)Q^\pi(\tau_t, a_t):

  1. Sample stb(τt)s_t \sim \mathbf{b}^\star(\cdot \mid \tau_t).

  2. Take given action ata_t, and sample st+1P(st,at)s_{t+1} \sim P(\cdot\mid s_t,a_t), ot+1E(st+1)o_{t+1} \sim E(\cdot \mid s_{t+1}).

  3. Repeat Step 2 by taking actions according to π\pi till the end of the trajectory. Take the sum of rewards (assume they are functions of the observations) as the Monte-Carlo return.


Roll-out using an Inaccurate Belief State

The problem is that b\mathbf{b}^\star is not directly available, and must be approximated via various techniques in Bayesian inference.3 So let’s consider the setting where we are given some candidates B={b(i)}\mathcal{B} = \{\mathbf{b}^{(i)}\}, and we want to select an appropriate bB\mathbf{b} \in \mathcal{B} so that we can produce the correct roll-out for estimating Q-values.

There are many ways to perform the selection (this is what the paper is about!), one of which is the following: note that

  1. The value function for a POMDP is defined through the induced history-based MDP, which we denote as MΓM_{\Gamma}.

  2. Every bB\mathbf{b} \in \mathcal{B} also induces a history-based MDP from which we can efficiently sample: given any τt,at\tau_t, a_t, we can sample τt+1\tau_{t+1} as stb(τt),st+1P(st,at),ot+1E(st+1),τt+1=τtatot+1s_t \sim \mathbf{b}(\cdot \mid \tau_t), s_{t+1} \sim P(\cdot\mid s_t, a_t), o_{t+1} \sim E(\cdot \mid s_{t+1}), \tau_{t+1} = \tau_t \circ a_t \circ o_{t+1}. We denote this MDP as MΓ,bM_{\Gamma, \mathbf{b}}.

In general, if b\mathbf{b} is incorrect we would have MΓMΓ,bM_{\Gamma} \ne M_{\Gamma, \mathbf{b}}, so a natural selection criterion is to choose b\mathbf{b} such that MΓMΓ,bM_{\Gamma} \approx M_{\Gamma, \mathbf{b}}.4 This way, we can hope that the Q-functions defined in the two history-based MDPs are close to each other.


The Paradox

Suppose we successfully choose a b\mathbf{b} such that MΓM_{\Gamma} and MΓ,bM_{\Gamma, \mathbf{b}} are exactly the same. Then their corresponding Q-functions should also be identical. This should imply that our earlier roll-out procedure using Γ\Gamma and b\mathbf{b} should produce the right Monte-Carlo return, right?

The answer is no! And questions for you (answer can be found in the paper):

  1. Which step of the above reasoning went wrong?

  2. It is possible to fix this by changing the roll-out method. How? Note that we only have efficient sampling access to b,P,E,π\mathbf{b}, P, E, \pi.


Footnote Remarks

  1. The style of the paper does not quite fit the common standards of publications (I had an uphill battle before and do not want to try again), and the main purpose of writing is to offload the ideas from my mind so that they do not keep coming up and occupying my thought space forever… and for that I have to strike a trade-off between the rigor of the paper and the time spent on it. As a result, some proofs in the paper are not fully fleshed out, but I have expanded the key analyses to the extent that, I am reasonably confident I am not missing anything major. 

  2. We only consider policies that operate on the observable history. If the policy can depend on the latent states, there will be confounding issues. 

  3. What the POMCP paper did was the most basic ABC method, rejection sampling: to sample from b(τt)\mathbf{b}^\star(\cdot\mid \tau_t), they (1) naturally simulate trajectories by replaying the actions in τt\tau_t, and (2) reject the trajectory and start over again when any of the simulated observation disagrees with its counterpart in τt\tau_t. Obviously, this procedure is extremely inefficient without a heavy dose of approximations and heuristics. On a tangentially related note, I recently ran into a structural estimation problem in econ where similar rejection sampling is also needed. (Update 11/29: I took another look at the POMCP paper and realize that they may be doing a sample-with-replacement variant of this by sampling all trajectories simultaneously. My current understanding is that it should compromise unbiasedness but might still be correct in the limit of infinite particles.) 

  4. This is the principle of behavioral equivalence, which has a heavy influence in RL research, especially on topics related to POMDPs. See e.g., PSRs