Offline vs. Online Learning in Model-based RL: Lessons for Data Collection Strategies

Jiaqi Chen, Ji Shi, Cansu Sancaktar, Jonas Frey, Georg Martius · DOI

Offline vs. Online Learning in Model-based RL: Lessons for Data Collection Strategies

Introduction

Model-based reinforcement learning (MBRL) offers a promising path toward sample-efficient agents by learning a "world model"—a predictive simulator of environment dynamics. In theory, a well-learned world model should allow an agent to plan and learn policies entirely through "imagination," reducing the need for costly real-world interactions. However, a persistent performance gap remains between agents trained online (learning while interacting) and those trained offline (learning from fixed datasets).

This research investigates the root causes of this gap, identifying a "catastrophic cycle" where offline agents, lacking a self-correction mechanism, inevitably drift into out-of-distribution (OOD) states. By analyzing over 2,000 experiments across 31 diverse tasks, the authors demonstrate that the key to closing this gap lies not just in the quantity of data, but in its exploratory quality and the agent's ability to trigger surgical online interactions when uncertainty peaks.

The Performance Gap: Active vs. Passive Learning

To isolate why offline MBRL fails, the researchers compared three distinct training regimes:

  1. Active Agent: A standard online agent (DreamerV3) that interacts with the environment and updates its model and policy continuously.
  2. Passive Agent: An offline agent trained on the final, complete dataset generated by a successful Active agent.
  3. Tandem Agent: An offline agent that "shadows" an Active agent, receiving data in the exact same sequence but never influencing the environment itself.
Overview of the experimental setup, performance degradation, and proposed remedies.

The results were striking: even when provided with the exact same data as a high-performing online agent, Passive and Tandem agents consistently failed to match its performance. This suggests that the "online" advantage isn't just about having more data, but about the closed-loop nature of the interaction.

The Catastrophic Cycle of Offline MBRL

The failure of offline agents stems from a lack of "self-correction." In online learning, if an agent's policy leads it to an unfamiliar state, the resulting prediction error in the world model is immediately corrected by the next environment interaction.

In contrast, an offline agent is "blind." During training, it might exploit minute inaccuracies in its world model to find a "shortcut" to high rewards in imagination. However, because these shortcuts rely on OOD transitions the model hasn't actually mastered, the agent's "imagined" trajectory diverges from reality. When deployed, the agent follows this flawed policy into states the world model doesn't understand, leading to total task failure.

Visualization of visitation frequency and world model loss in a Point Mass Maze. Passive and Tandem agents suffer from high model loss in regions where they lack sufficient data, leading to lower episode scores.

As shown in the Point Mass Maze experiments (Figure 4), Active agents maintain low world model loss across their trajectories. Passive and Tandem agents, however, show spikes in model loss in specific regions. These "blind spots" act as traps; once the agent enters them, its policy becomes effectively random or counter-productive.

Remedies: Exploration and Adaptive Interaction

The authors propose two primary strategies to mitigate these failures:

1. Exploration-Augmented Data

Counter-intuitively, training exclusively on "expert" demonstrations is often detrimental for MBRL. Expert data is narrow; if an agent deviates even slightly from the optimal path, it hits an OOD region. By including exploratory data—collected using intrinsic motivation like Plan2Explore—the dataset provides "guardrails." This broader data coverage ensures the world model is robust enough to handle the minor deviations that inevitably occur during policy execution.

2. Adaptive Interaction (Passive+Auto interact)

Perhaps the most significant finding is the efficiency of "surgical" online interaction. The researchers developed an agent that remains primarily offline but monitors its world model loss during evaluation. When the loss exceeds a threshold—indicating the agent has entered an OOD region—it triggers a brief period of online interaction (averaging only ~2,000 steps). This "Passive+Auto interact" strategy recovered the full performance of an online agent while using only 6% of the total environment interactions.

Conclusion and Future Outlook

This study clarifies that the "offline-to-online" gap in MBRL is fundamentally a problem of distribution shift and lack of feedback. The findings suggest that building robust "robotics foundation models" will require moving beyond static expert datasets toward diverse, exploratory data collections.

While the current adaptive strategy requires online evaluation to trigger interactions, it points toward a future where agents can autonomously identify their own "knowledge gaps." Future research into purely offline metrics for model uncertainty will be crucial for deploying these systems in safety-critical real-world applications where every interaction counts.

Summary updated

BibTeX
@misc{chen2025offline,
  author = {Jiaqi Chen and Ji Shi and Cansu Sancaktar and Jonas Frey and Georg Martius},
  title = {{Offline vs. Online Learning in Model-based RL: Lessons for Data Collection Strategies}},
  year = {2025},
  eprint = {2509.05735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.05735},
}
Figure