Preemptive Solving of Future Problems: Multitask Preplay in Humans and Machines

Wilka Carvalho, Sam Hall-McMaster, Honglak Lee, Samuel J. GershmanarXiv 2025 · DOI

Abstract

Reinforcement learning agents often face a trade-off between the flexibility of model-based planning and the efficiency of model-free execution. This paper introduces Multitask Preplay (MTP), an algorithm that bridges this gap by simulating counterfactual "what-if" scenarios during offline periods. By caching solutions for potential future tasks into a predictive representation, MTP enables rapid generalization and provides a computational account for human-like biases in path selection.

Introduction: The Flexibility-Efficiency Trade-off

In reinforcement learning (RL), agents typically navigate a classic trade-off. Model-based approaches (like tree search) are highly flexible and can find paths to any goal, but they are computationally expensive and slow at decision time. Model-free approaches are lightning-fast because they "cache" solutions into neural network weights, but they are rigid; if the goal changes, the agent often must relearn from scratch.

Existing background planning methods, such as Dyna, attempt to bridge this gap by using a world model to simulate extra experience during offline periods. However, they typically suffer from an experience bottleneck by only simulating the task the agent is currently pursuing. Multitask Preplay (MTP) addresses this by allowing agents to prepare for a near-infinite variety of tasks they might encounter in the future.

Methods: The MTP Framework

The core idea of MTP is that during offline periods—analogous to sleep or quiet thought in humans—an agent doesn't just replay what it did; it "preplays" what it could have done.

Overview of the Multitask Preplay (MTP) framework, illustrating the transition from experience to background preplay and eventual zero-shot execution.

The process follows three distinct stages:

  1. Counterfactual Simulation: While replaying a trajectory from a completed task (e.g., going to a coffee shop), the agent samples "accessible" alternative goals (e.g., a grocery store passed along the way).
  2. Preplay Policy: The agent uses its world model to simulate the pursuit of these alternative goals. It employs a "preplay policy" that biases actions toward the new goal while leveraging knowledge from the original trajectory.
  3. Caching via TD Learning: The results of these simulations update a goal-conditioned neural network using Temporal Difference (TD) learning. This effectively "caches" the solution to the new task into the agent's predictive representation before it is ever attempted in the real world.

Experimental Evaluation

The researchers evaluated MTP using two primary environments:

  • JaxMaze: A custom grid-world used for human behavioral experiments. It features complex layouts where "shortcuts" can be introduced to test if humans prefer cached, suboptimal paths over planning new ones.
  • Craftax: A complex, partially observable 2D Minecraft-like environment requiring hierarchical task completion (e.g., crafting a pickaxe before mining diamonds). This was used to test AI generalization across 10,000 unique, procedurally generated testing environments.

Key Insights and Results

The "Suboptimal" Human Bias

One of the most striking findings is that humans often choose a longer, familiar path over a new, shorter shortcut. MTP explains this not as laziness, but as a rational use of cached "preplayed" knowledge that avoids the high mental cost of planning a new route from scratch. Response time (RT) measurements served as a "smoking gun": people were significantly faster when reusing parts of old paths, suggesting they were retrieving a pre-computed solution rather than planning in the moment.

A learned predictive map for the 'Groceries' task, representing a cached solution generated during offline preplay.

AI Performance and Zero-Shot Generalization

In the Craftax environment, MTP agents significantly outperformed standard Dyna and model-free baselines. By exploiting task co-occurrence—such as "preplaying" how to get a pickaxe while originally looking for food—MTP enabled agents to solve tasks in new environments even when they didn't know they would be evaluated on those specific tasks during training.

Limitations and Future Work

Currently, MTP assumes an "oracle" world model, whereas real-world agents must learn models from noisy data. Future work may explore more sophisticated "curiosity-driven" goal selection to make preplay even more efficient. Additionally, balancing the significant offline computational cost of preplay against the time saved at decision-making remains an open question for scaling these methods to larger domains.

Summary updated

BibTeX
@misc{carvalho2025preemptive,
  author = {Wilka Carvalho and Sam Hall-McMaster and Honglak Lee and Samuel J. Gershman},
  title = {{Preemptive Solving of Future Problems: Multitask Preplay in Humans and Machines}},
  year = {2025},
  eprint = {2507.05561},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05561},
}
Figure