Mismatched No More: Joint Model-Policy Optimization for Model-Based RL

Benjamin Eysenbach, Alexander Khazatsky, Sergey Levine, Ruslan Salakhutdinov

TL;DR

Model-based reinforcement learning (RL) often suffers from an "objective mismatch" where models are trained for accuracy but used for control. This paper introduces MnM (Mismatched No More), a framework providing a single, unified objective for jointly training both the model and the policy. It establishes the first global lower bound on expected return that is computationally efficient for continuous environments.

The "Objective Mismatch" Problem

In model-based RL, agents typically follow a two-step process: first, learn a transition model of the environment (how action $A$ in state $S$ leads to state $S'$), and second, use that model to train a policy.

The "Objective Mismatch" problem arises because these two steps have fundamentally different goals. The model is usually trained to minimize prediction error (like Mean Squared Error). However, a model can be highly accurate on average but fail catastrophically in a few "critical" states that the policy desperately needs to navigate. Conversely, a model might be very inaccurate in parts of the state space the policy never visits, making that inaccuracy irrelevant.

Existing theoretical bounds to fix this were either limited to simple "tabular" (grid-like) worlds or only worked when the model and policy were already very close to the ground truth. This paper seeks a "global" objective that ensures improving the model always helps the policy.

Methods: A Unified Objective

The authors reframe model-based RL as a latent-variable problem. By treating the trajectory as a hidden variable and the reward as the probability that a trajectory "solves" the task, they utilize an Evidence Lower Bound (ELBO)—a staple of variational inference—to derive a joint objective.

Key Components

  1. The Unified Objective: Instead of two separate loss functions, the model and policy both work to maximize a single lower bound on the log-expected return.
  2. Augmented Reward: The policy doesn't just maximize the environment's reward. It maximizes an "augmented" reward that includes a penalty term. This term uses a classifier (similar to a GAN's discriminator) to distinguish between real transitions and those generated by the learned model.
  3. Optimistic Dynamics: Mathematically, the "optimal" model in this framework isn't actually the most accurate one. Instead, it is an optimistic model biased toward transitions that lead to higher rewards, effectively helping the agent explore promising areas.
MnM Architecture
  1. The MnM Algorithm: The practical algorithm alternates between three steps:
  2. Updating the classifier to spot "fake" model transitions.
  3. Updating the policy to maximize reward while staying within "realistic" states (as judged by the classifier).
  4. Updating the model to produce transitions that are both high-reward and realistic enough to "fool" the classifier.

Key Insights: Cooperation and Optimism

While MnM looks structurally similar to a GAN, it isn't a zero-sum game. In a GAN, the generator tries to defeat the discriminator. In MnM, the model and policy cooperate to maximize the same objective. Because the model is trained with the policy's performance in mind, it focuses its "representational budget" on transitions that actually matter for achieving high rewards.

Gridworld Results

A major "aha" moment in the research was discovering that the dynamics model naturally learns to be "optimistic." As seen in the stochastic gridworld experiments, the model might "hallucinate" moving toward the goal slightly faster or bypassing obstacles. While physically "wrong," this hallucination safely guides the policy toward the right behavior during training.

Results and Performance

The authors evaluated MnM across several benchmarks, including OpenAI Gym locomotion tasks, the ROBEL Manipulation Benchmark, and Meta-World.

  • State-of-the-Art Performance: On standard locomotion tasks, MnM performs on par with leading model-based methods like MBPO.
  • Superiority in Complex Dynamics: On ROBEL manipulation tasks—where complex contact dynamics are notoriously hard to model with standard MSE—MnM significantly outperformed MBPO and model-free methods like SAC.
  • Robustness to Exploitation: Standard model-based methods often "exploit" model errors to achieve fake high scores (leading to massive Q-value spikes). MnM's classifier-based penalty effectively prevents this "model exploitation."

Limitations and Future Work

The theory relies heavily on the classifier being "Bayes-optimal" (perfect). In practice, if the classifier is poorly trained, the lower bound might not hold, potentially leading to sub-optimal policies. Furthermore, in some continuous online tasks, the classifier penalty can be too strong, making the agent overly conservative and scared to explore new transitions because they look "unrealistic."

Future directions include exploring how to incorporate the data collection process itself into the unified objective, which could lead to even better automated exploration strategies.

Summary updated

BibTeX
@inproceedings{eysenbach2022mismatched,
  author = {Benjamin Eysenbach and Alexander Khazatsky and Sergey Levine and Ruslan Salakhutdinov},
  title = {{Mismatched No More: Joint Model-Policy Optimization for Model-Based RL}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=DN2GlpfPDoO},
}
Figure