Reflect-then-Plan: Offline Model-Based Planning through a Doubly Bayesian Lens

Jihwan Jeong, Xiaoyu Wang, Jingmin Wang, Scott Sanner, Pascal Poupart

Introduction

Offline reinforcement learning (RL) aims to derive optimal policies from fixed datasets without the luxury of real-time exploration. While this paradigm is essential for safety-critical domains like healthcare and robotics, it is fundamentally limited by epistemic uncertainty. Because the agent only sees a subset of possible interactions, it cannot know the "true" dynamics of the environment in regions not covered by the training data.

Standard approaches typically address this through conservatism—penalizing the agent for visiting unfamiliar states. However, this often results in brittle policies that fail to generalize to new starting conditions or adapt to slight shifts in environment dynamics. Reflect-then-Plan (RefPlan) introduces a "doubly Bayesian" framework that moves beyond simple conservatism, treating both environment identification and action selection as probabilistic inference problems.

Addressing Epistemic Uncertainty

The core philosophy of RefPlan is that uncertainty should be modeled and leveraged rather than merely avoided. In offline settings, multiple environment models might be consistent with the limited data provided. A conservative agent might ignore these possibilities, but a Bayesian agent can use its history of observations to narrow down which model is most likely.

RefPlan argues that even in Markovian environments, historical data is vital for resolving epistemic uncertainty. By "reflecting" on past transitions, the agent can infer latent properties of the current environment, allowing for more robust decision-making during deployment.

The RefPlan Framework

RefPlan operates in two distinct stages: Inference (Reflect) and Planning (Plan).

1. Reflect: Latent Dynamics Inference

The agent utilizes a Variational Autoencoder (VAE) to process its recent history of states, actions, and rewards. An encoder maps this history to a latent variable ($m_t$), representing the agent's current belief about the environment's dynamics. This allows the model to distinguish between different potential versions of the world that are consistent with the offline dataset.

2. Plan: Probabilistic Action Selection

Rather than treating planning as a standard optimization problem, RefPlan recasts it as Bayesian posterior estimation.

  • The Prior: A previously learned offline policy serves as a prior, providing a "warm start" that keeps the search within high-reward regions supported by the data.
  • The Likelihood: The agent samples multiple trajectories across its distribution of inferred environment models ($m_t$).
  • The Posterior: By weighting these trajectories by their predicted returns and marginalizing (averaging) over the belief distribution, the agent selects actions that are robust across the most likely scenarios.

This approach allows the agent to adapt in real-time. As more observations are gathered during deployment, the "Reflect" stage updates the belief $m_t$, and the "Plan" stage refines the strategy accordingly.

Experimental Evaluation

The authors evaluated RefPlan using the D4RL benchmark, focusing on locomotion tasks (Hopper, HalfCheetah, and Walker2d) across various data distributions (Random, Medium, Expert, etc.). To test the limits of the framework, they introduced two specific challenges:

  1. Out-of-Distribution (OOD) Initial States: Training on expert data but starting the agent in random, unseen states.
  2. Changing Dynamics: Modifying the environment at test time, such as disabling a joint or changing the terrain gradient.

Key Results

RefPlan demonstrated significant improvements over existing offline RL and planning baselines:

  • Broad Compatibility: RefPlan consistently enhanced the performance of five major base algorithms, including CQL, EDAC, MOPO, COMBO, and MAPLE.
  • Superior Adaptability: On average, RefPlan improved the performance of the base prior policy by 11.6%, more than doubling the 5.3% improvement seen by the previous state-of-the-art planning method, LOOP.
  • Resilience to OOD States: In the Walker2d environment, RefPlan increased the base policy score from 62.5 to 72.8 in random starting states, while other planning methods often caused performance to degrade.
  • Data Efficiency: The framework maintained high performance even when trained on significantly smaller datasets (e.g., 50k samples), where standard baselines typically collapsed.

Conclusion and Future Work

Reflect-then-Plan offers a robust alternative to purely conservative offline RL by embracing a doubly Bayesian perspective. By explicitly modeling environment uncertainty and using offline policies as priors for planning, it achieves superior generalization and adaptability.

Despite its success, challenges remain. The computational cost of planning at test time (~53 steps per second) may be prohibitive for high-frequency robotics. Additionally, future research is needed to scale this approach to high-dimensional manipulation tasks and to explore more sophisticated sampling techniques for complex, multi-modal action distributions.

Summary updated

BibTeX
@inproceedings{jeong2025reflect,
  author = {Jihwan Jeong and Xiaoyu Wang and Jingmin Wang and Scott Sanner and Pascal Poupart},
  title = {{Reflect-then-Plan: Offline Model-Based Planning through a Doubly Bayesian Lens}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=pQYEMwHd6c},
}
Figure