A Bayesian Approach to Learning Bandit Structure in Markov Decision Processes

Kelly W. Zhang, Omer Gottesman, Finale Doshi-VelezarXiv 2022 · DOI

Introduction

In reinforcement learning (RL), a critical design choice is determining the complexity of the environment model. Practitioners often face a dilemma: should the problem be treated as a Contextual Bandit (CB) or a full Markov Decision Process (MDP)?

The CB framework assumes that actions only influence immediate rewards, which allows for highly sample-efficient learning. However, if actions actually affect future states—the core assumption of an MDP—a CB algorithm will fail to account for long-term consequences and likely converge to a suboptimal policy. Conversely, applying a full MDP model to a "bandit-like" environment can be excessively sample-efficient, as the agent spends too much effort trying to learn non-existent or negligible state transitions.

This research introduces BHT-RL (Bayesian Hypothesis Testing Reinforcement Learning), an online algorithm designed to navigate this trade-off by learning the underlying structure of the environment dynamically.

The BHT-RL Framework

BHT-RL treats the choice between CB and MDP as a Bayesian model selection problem. The algorithm maintains a posterior probability over two competing hypotheses:

  1. Null Hypothesis ($H_0$): The environment is a Contextual Bandit where actions do not affect state transitions.
  2. Alternative Hypothesis ($H_1$): The environment is an MDP where actions influence future states.

Bayesian Model Selection

At the start of each episode, BHT-RL calculates a Bayes factor, which represents the ratio of the marginal likelihoods of the observed transition data under each hypothesis. This factor is used to update the posterior probability that the environment is a bandit. To select a policy for the current episode, the algorithm samples an indicator variable from this posterior, deciding whether to follow a CB-optimized or an MDP-optimized strategy.

Scaling via State Decomposition

To improve scalability, the authors propose decomposing the state space into exogenous features (e.g., weather, which actions cannot change) and endogenous features (e.g., user engagement, which actions might influence). By focusing the hypothesis test only on endogenous features, BHT-RL significantly reduces the computational overhead and speeds up convergence.

Experimental Evaluation

The researchers evaluated BHT-RL against several baselines, including pure CB and MDP posterior sampling, as well as frequentist methods like UBEV-S and EULER.

Benchmark Environments

Two primary simulation environments were used:

  • River Swim: A classic RL benchmark (visualized in Figure 1) where an agent must decide whether to swim upstream against a current to reach a high-reward state. The researchers created variants ranging from pure bandit to full MDP.
  • Physical Activity Suggestions: A mobile health simulation inspired by the "HeartSteps" study. It models a system deciding whether to send activity notifications based on features like time of day, weather, and user engagement.
The River Swim MDP structure, showing transition probabilities and rewards.

Key Results

The experimental results demonstrate that BHT-RL provides a robust middle ground between specialized algorithms.

Cumulative regret across River Swim and Physical Activity environments with varying degrees of action-state influence.

As shown in Figure 2, BHT-RL consistently achieves low regret across different scenarios:

  • In Bandit Settings: It matches the high sample efficiency of CB-specific algorithms, quickly identifying that actions have no long-term effects.
  • In MDP Settings: It successfully learns the optimal long-term policy, whereas CB-only algorithms suffer from high linear regret.
  • Comparison to SOTA: BHT-RL outperforms frequentist methods like UBEV-S and EULER, which often rely on loose confidence bounds that lead to over-exploration and higher regret in practice.

Conclusion

BHT-RL acts as a form of structural regularization. By favoring the simpler CB model when evidence for MDP structure is weak, it prevents the agent from overfitting to noise in transition data. This approach not only improves performance but also provides interpretability, as the posterior probability offers a direct measure of how "bandit-like" or "MDP-like" the environment appears to be. Future work aims to extend this framework to non-stationary environments and continuous state spaces.

Summary updated

BibTeX
@misc{zhang2022bayesian,
  author = {Kelly W. Zhang and Omer Gottesman and Finale Doshi-Velez},
  title = {{A Bayesian Approach to Learning Bandit Structure in Markov Decision Processes}},
  year = {2022},
  eprint = {2208.00250},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.00250},
}
Figure