MDP Planning as Policy Inference

summary

Video file (mp4)

The gist

The paper "MDP Planning as Policy Inference" by David Tolpin formulates episodic Markov decision process (MDP) planning as Bayesian inference over policies.

In short

The episode discusses "MDP Planning as Policy Inference," which reframes classic planning as Bayesian inference over policies. Instead of finding a single optimal action, the method derives a distribution over possible strategies, providing a measure of uncertainty. The technique uses variational sequential Monte Carlo (VSMC) and shows differences from Soft Actor-Critic (SAC) baselines.

Key concepts

MDP Planning as Policy Inference
This approach recasts the classic problem of Markov Decision Process planning into a Bayesian inference problem. Policies are treated as hidden variables, and the goal is to find a distribution over policies rather than just one optimal action.
Variational Sequential Monte Carlo (VSMC)
A computational method used in the paper to approximate the complex posterior distribution over policies. It requires two key modifications: enforcing policy consistency and coupling transition randomness across particles.
Policy Inference
The core idea is to assign an unnormalized probability to every possible policy based on its expected return. This results in a posterior distribution that quantifies not only the best strategy but also the uncertainty about it.
Soft Actor-Critic (SAC)
A standard reinforcement learning method used as a baseline. SAC optimizes for entropy, which encourages randomness and keeping options open, often leading to different behaviors than those derived from maximizing expected return.

Terminology used across episodes

This episode discusses

The paper

MDP Planning as Policy Inference · Read on arXiv

David Tolpin

Offtopia

We cast episodic Markov decision process (MDP) planning as Bayesian inference over policies. A policy is treated as the latent variable and is assigned an unnormalized probability of optimality that is monotone in its expected return, yielding a posterior distribution whose modes coincide with return-maximizing solutions while posterior dispersion represents uncertainty over optimal behavior. To approximate this posterior in discrete domains, we adapt variational sequential Monte Carlo (VSMC) to inference over deterministic policies under stochastic dynamics, introducing a sweep that enforces policy consistency across revisited states and couples transition randomness across particles to avoid confounding from simulator noise. Acting is performed by posterior predictive sampling, which induces a stochastic control policy through a Thompson-sampling interpretation rather than entropy regularization. Across grid worlds, Blackjack, Triangle Tireworld, and Academic Advising, we analyze the structure of inferred policy distributions and compare the resulting behavior to discrete Soft Actor-Critic, highlighting qualitative and statistical differences that arise from policy-level uncertainty.

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Next we'll be talking about the paper "MDP Planning as Policy Inference".

Jane: The paper was written by David Tolpin from Offtopia.

Tom: Stay tuned as we take you through the paper and discuss its implications.

Title and Core Idea: Tom: Welcome back to the arXiv channel, everyone. I'm Tom, and with me is Jane, and we are looking at a paper that just landed on arXiv called "MDP Planning as Policy Inference." Jane, I have to say, the title alone got me excited because it's taking something classic and flipping it on its head.

Jane: It really does, Tom. And the core idea is deceptively simple. Instead of trying to find the single best action or the single best policy through the usual reinforcement learning tricks, this paper says, let's treat the policy itself as a hidden variable and do Bayesian inference over it. So you're not just asking "what should I do?" but "which whole strategy is most likely to be the right one?"

Tom: Right, and that's a big shift. Normally, in MDP planning, you're optimizing an objective, maximizing expected return. Here, they assign each policy an unnormalized probability that goes up as its expected return goes up. So the most likely policies are the ones that get the highest rewards, but you get a whole distribution over policies instead of just one winner.

Jane: And that distribution is the magic. It gives you uncertainty. If two different strategies have nearly the same expected return, both of them will have high probability in the posterior. That means when you act, you can sample from that posterior, and you get a stochastic controller that naturally reflects how confident you are about what the optimal behavior is.

Tom: So it's not just about finding the answer, it's about knowing how sure you are of the answer. And the way they act is essentially Thompson sampling, which is a classic idea, but applied here at the policy level, not just the action level.

Jane: Exactly. And I love that they're explicit about this. They say the stochasticity in the final behavior is not entropy regularization, which is what you get in a lot of soft reinforcement learning methods. It's genuine uncertainty over which deterministic policy is the right one.

Tom: And that's a crucial distinction, because entropy regularization often forces randomness even when you're certain. Here, if the posterior is concentrated, you get a nearly deterministic policy. If it's diffuse, you get randomness. The uncertainty drives the behavior, not a fixed coefficient.

Jane: So the title really captures it. "MDP Planning as Policy Inference" means you take a planning problem, you turn it into an inference problem, and you get a richer object out of it. And I'm curious, Tom, how do they actually make this computationally tractable? Because inference over policies sounds expensive.

Tom: That's exactly what we're going to dig into next, because they use a variational sequential Monte Carlo approach, and they had to make some clever modifications to make it work. Stick around.

Methodology and the Clever Modifications: Tom: So Jane, we've got the big picture, but the paper gets really interesting in the details. They use variational sequential Monte Carlo, or VSMC, to actually approximate this posterior over policies. But they had to adapt it in two specific ways, and those adaptations are the heart of the method.

Jane: Right, and the first one is about consistency. Since they're inferring deterministic policies, if a particle visits the same state twice, it has to take the same action both times. So they memoize the action for each state on first visit and reuse it on revisits. That sounds straightforward, but it's a real departure from standard SMC, where you'd sample a fresh action every time.

Tom: And the second modification is even more subtle. They couple the transition randomness across all particles within a sweep. So if two particles are in the same state and take the same action on the same visit count, they get forced to the same next state. That way, the weights of the particles reflect differences in policy, not differences in luck from the environment's stochasticity.

Jane: That's a really elegant trick. It's like running a controlled experiment. You hold the environment fixed, and then the only thing that differs between particles is the policy they're following. So when you compute the importance weights, you're isolating the effect of the policy choice.

Tom: And they prove in Theorem one that the gradient estimator they use is unbiased. So even though they're doing this coupled sampling and using a score function estimator, they show that optimizing their surrogate objective is a proper stochastic gradient ascent on the expected log evidence.

Jane: And I think the key insight for me is that they're treating the single-episode return as a noisy Monte Carlo estimate of the policy's log probability. So the randomness from the environment is just noise in the objective, and the inference machinery has to average over that noise.

Tom: Right, and that's why the coupling is so important. Without it, the noise would dominate the signal, and the particle weights would be mostly random. With it, the weights actually tell you something about which policies are better.

Jane: So this is a real algorithmic contribution, not just a conceptual one. They're not just saying "let's do Bayesian inference over policies," they're showing exactly how to make that inference work in practice, with a specific algorithm and a proof that it's doing the right thing.

Tom: And I have to say, the ablation studies in the paper really sell it. They show that if you drop the deterministic policy enforcement, you get a higher-entropy, mushier policy distribution. And if you drop the shared dynamics, the agent becomes overly cautious or overly risky in the grid world. So both modifications are load-bearing.

Jane: So the method is sound, but I'm dying to know how it actually performs against the standard baselines. I mean, we've got the algorithm, but does it win?

Tom: That's the next segment. We're going to look at the experiments, and honestly, the results are a mixed bag in the most interesting way. Let's get into it.

Experiments and Comparisons: Tom: So Jane, we've got the algorithm, and now we need to see it in action. The paper runs experiments on grid worlds, Blackjack, Triangle Tireworld, and Academic Advising, comparing against discrete Soft Actor-Critic, or SAC.

Jane: And the grid world results are really illustrative. They show that VSMC and SAC produce different policies, even when the return distributions are similar. In particular, SAC tends to push actions toward grid boundaries, because that increases entropy, but it doesn't actually help reach the goal. VSMC penalizes those actions because a deterministic policy that walks into a wall can only escape due to environment stochasticity.

Tom: That's a really concrete example of the philosophical difference we talked about earlier. SAC is optimizing for entropy, so it likes actions that keep options open. VSMC is optimizing for expected return under a deterministic policy, so it avoids actions that rely on luck.

Jane: And then Blackjack is fascinating because there's a known optimal policy. They compute it by value iteration. And what they find is that VSMC with default settings gets a higher expected reward than SAC with its default entropy weight. To get SAC to match VSMC, they have to drop the entropy weight from one to zero point one. And even then, VSMC has a lower draw probability than both the optimal policy and SAC.

Tom: So VSMC is essentially playing a more aggressive game. It's less likely to draw, which means it's more likely to win or lose outright. And that's a direct consequence of the posterior concentrating on policies that maximize expected return, without the entropy term pushing toward safer, more mixed behavior.

Jane: But then we get to Triangle Tireworld, and this is where the paper gets really honest. With the original rewards, VSMC performs poorly. The return gap between "fast but risky" and "safe but slow" is huge, so the posterior becomes extremely peaked, and the algorithm essentially commits to one behavior with high variance. But when they scale the rewards down by a factor of five, the posterior becomes less concentrated, and VSMC matches SAC.

Tom: That's a real limitation, and they own it. Classical MDP planning is invariant to affine reward scaling, but Bayesian inference is not, because the scale controls how peaked the posterior is. So the method works best when the reward scale meaningfully encodes the strength of preferences, not just the ranking of policies.

Jane: And then Academic Advising, which is a big combinatorial problem with long horizons, shows that both methods struggle on harder instances, but VSMC has heavier-tailed return distributions. So it's finding policies that sometimes do great and sometimes do terribly, while SAC is more consistent but less likely to hit the high end.

Tom: So the empirical picture is nuanced. VSMC isn't uniformly better, but it's different in ways that matter. It's more aggressive in Blackjack, more sensible in grid worlds, and more fragile in Triangle Tireworld.

Jane: And that fragility is really important for anyone who wants to use this in practice. You can't just set the reward scale arbitrarily and expect good results. You have to think about what the scale means for your uncertainty.

Tom: So let's bring in our guests. Lu, Meng, Lalam, what do you make of these results? Lu, you're the researcher, what's the big picture here?

Lu: I think the big picture is that this gives us a principled way to talk about uncertainty in planning. Instead of just saying "here's the optimal policy," you can say "here's a distribution over policies, and the spread tells you how much we don't know." That's a huge deal for safety-critical applications where you need to know when you're uncertain.

Meng: But from an engineering standpoint, I'm worried about the computational cost. VSMC with ten particles for fifty thousand iterations, that's a lot of environment calls. And the memoization and coupling require careful bookkeeping. Is this going to scale to real-world problems with continuous state spaces?

Tom: That's a fair question, and the paper addresses it briefly. They say the semantics don't depend on discreteness, and you can use hashable state abstractions or keyed random streams for continuous domains. But they don't actually show it working, so it's an open question.

Lalam: I think the most impactful vision here is that this could change how we build AI systems that need to explain their decisions. If you have a posterior over policies, you can say "we're seventy percent sure the optimal behavior is this, and thirty percent sure it's that." That kind of uncertainty communication is essential for building trust with humans.

Jane: That's a beautiful point, Lalam. And it connects back to the Thompson sampling interpretation. The agent is essentially saying "I'm not sure which strategy is best, so I'm going to randomize according to my beliefs." That's a very human way to make decisions.

Tom: So we've got a method that's principled, has some real differences from standard approaches, and opens up new questions about uncertainty and scaling. I think that's a great place to wrap up. Let's do a quick summary.

Conclusion: Tom: So, Jane, we've spent the whole show on "MDP Planning as Policy Inference," and I think we've covered a lot of ground. Let's pull it together.

Jane: Absolutely. The paper takes the classic problem of MDP planning and recasts it as Bayesian inference over policies. Each policy gets a probability proportional to its expected return, and the resulting posterior gives you both the optimal behavior and a measure of how uncertain you are about it.

Tom: And the algorithm, variational sequential Monte Carlo with those two key modifications, policy consistency and coupled dynamics, makes this tractable. The experiments show real differences from Soft Actor-Critic, with VSMC being more aggressive in Blackjack, more sensible in grid worlds, and more fragile in Triangle Tireworld.

Jane: The Triangle Tireworld result is a good reminder that this isn't a silver bullet. The reward scale matters, and you have to think about what it means for your uncertainty. But when it works, you get a richer object than just a single policy.

Tom: And the implications are big. This gives us a principled way to talk about uncertainty in planning, which is crucial for safety-critical systems and for building trust with humans. It's not just about finding the answer, it's about knowing how sure you are.

Jane: And with that, we're going to say goodbye to this paper. It's a thought-provoking piece that opens up more questions than it answers, and that's exactly what we want from a good arXiv paper.

Tom: Thanks for listening, everyone. We'll be back soon with the next paper. Until then, keep exploring.

More episodes

← Home