Improving Model-Based Reinforcement Learning by Converging to Flatter Minima

Shrinivas Ramasubramanian, Benjamin Freed, Alexandre Capone, Jeff SchneiderNeurIPS 2025

Model-Based Reinforcement Learning (MBRL) is powerful because it allows an agent to "dream" or simulate trajectories using a learned world model, saving millions of real-world interactions. However, these world models are notoriously fragile. By integrating Sharpness-Aware Minimization (SAM) into the training of world models, researchers have found a simple way to make MBRL significantly more robust.

This "drop-in" optimization tweak encourages the model to converge to flatter minima in the loss landscape, reducing compounding errors during imagined rollouts and leading to massive performance gains—up to +89% on complex humanoid tasks—without any architectural changes.

The Challenge: Compounding Errors and Sharp Minima

The core challenge in MBRL is compounding error: a tiny mistake in predicting the next state becomes a huge "hallucination" ten steps down the line. This problem is exacerbated by distribution shift—as the agent’s policy improves, it visits new states the world model hasn't seen before.

Standard optimizers like Adam often find "sharp" minima. These are solutions that look great on training data but fail catastrophically when the parameters or inputs shift slightly. This paper asks a fundamental question: Can we make MBRL more reliable by forcing the world model to find "flatter," more stable solutions?

The Solution: Sharpness-Aware Minimization (SAM)

The authors propose a deceptively simple solution: replace standard optimization with SAM when training the world model's dynamics.

Instead of just minimizing the loss at a single point, SAM looks for a neighborhood where the loss is consistently low. It performs a two-step "lookahead": first, it finds a nearby point with the worst-case loss (the "sharpest" direction), and then it updates the model parameters to minimize the loss at that adversarial point.

The beauty of this approach is its drop-in compatibility. It requires zero changes to the agent's architecture, the planner, or the policy; it only changes how the world model learns. Theoretically, the paper derives new PAC-Bayesian bounds proving that "first-order sharpness" is directly linked to the gap between the agent's estimated value and the true environment value. In short: flatter minima guarantee tighter error bounds.

Key Insights and the "Hallucination" Fix

A world model in a flat minimum is less sensitive to small errors in its own parameters, making it much more resilient when the agent starts exploring new parts of the state space. Interestingly, the authors found that SAM is most effective when applied specifically to the dynamics model. Applying it to reward or value prediction heads was actually detrimental in some cases, likely because it "corrupted" the scalar targets the agent relies on for immediate feedback.

By measuring the gap between "imagined" returns and real Monte-Carlo returns, the authors showed that SAM-trained models produce much more accurate long-term rollouts. They literally "hallucinate" less.

SAM improves value estimation accuracy, reducing the "hallucination" effect compared to standard SGD.

Experimental Results

The authors evaluated their approach across three diverse and challenging benchmarks: HumanoidBench (11 high-dimensional locomotion tasks), the DeepMind Control (DMC) Suite, and Atari-100k. The quantitative improvements are substantial:

  • HumanoidBench: A staggering +89.1% increase in mean return compared to the baseline.
  • Atari-100k: A +27.6% improvement in human-normalized scores, with massive wins in games like Frostbite (+314%).
  • High-DoF DMC: An average relative gain of +20.6% across complex animal and humanoid models.
Performance gains across HumanoidBench tasks, showing TD-MPC2 + SAM (red) significantly outperforming the baseline (blue).

Using Hessian analysis to measure the curvature of the loss landscape, the authors confirmed that SAM indeed produced significantly flatter minima than standard Adam. Furthermore, these benefits were observed across different architectures, including the MLP-based TD-MPC2 and the transformer-based TWISTER.

Limitations and Future Work

While highly effective, this approach does come with trade-offs:

  • Compute Overhead: SAM requires two forward-backward passes per update, resulting in roughly a 1.7x increase in training wall-clock time.
  • Hyperparameter Sensitivity: Performance is sensitive to the "neighborhood size" ($\rho$). While stable defaults exist, it remains a knob that requires tuning.
  • Sim-to-Real: The study was entirely conducted in simulation. Validating these results on physical robots—where dynamics naturally shift due to wear-and-tear or battery levels—is a critical next step.

Finally, the experiments used relatively short planning horizons. Exploring whether flat minima allow for even deeper "imagination" remains an exciting open question for the future of MBRL.

Summary updated

BibTeX
@inproceedings{ramasubramanian2025improving,
  author = {Shrinivas Ramasubramanian and Benjamin Freed and Alexandre Capone and Jeff Schneider},
  title = {{Improving Model-Based Reinforcement Learning by Converging to Flatter Minima}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=vcB1OwtWUZ},
}
Figure