Task-aware world model learning with meta weighting via bi-level optimization

Huining Yuan, Hongkun Dou, Xingyu Jiang, Yue Deng

Introduction

In Model-Based Reinforcement Learning (MBRL), an agent learns a "world model"—a simulator of its environment—and then practices its policy inside that simulator. Most modern world models are trained using Maximum Likelihood Estimation (MLE), which attempts to reconstruct every detail of the environment, from pixel-level background noise to critical reward signals.

However, MLE is inherently "task-agnostic." It treats a flickering background light with the same importance as the position of a goal-post. If the model makes a small error in a task-critical area, the agent’s policy can fail catastrophically. While "value-equivalent" models exist to focus only on task-relevant features, they often discard too much semantic information (general knowledge about the world) and are notoriously difficult to implement and stabilize.

To address this, researchers introduce TEMPO (Task-aware Environment Modeling Pipeline with bi-level Optimization). TEMPO is a new framework that makes world models "smarter" by teaching them which data points actually matter for the task at hand. By using a bi-level optimization strategy, it weights training samples to prioritize those that impact the agent's value estimation, achieving state-of-the-art performance and faster convergence than standard generative world models.

The TEMPO Framework

TEMPO layers a meta-learning objective on top of a standard world model (specifically, the Recurrent State-Space Model or RSSM used in architectures like DreamerV2). The core of TEMPO is a bi-level optimization loop:

TEMPO Architecture Diagram
  1. The Lower Level (World Model): This acts as the standard generative model. However, instead of treating every transition in the replay buffer equally, it uses weights provided by the upper level to calculate its loss.
  2. The Upper Level (Meta Weighter): A separate neural network ($N_\alpha$) observes the current state and value estimates to output a weight for each training sample. Its goal is to minimize a new objective called V-VAML (Variational Value-Aware Model Learning).

V-VAML calculates the "value disparity"—the difference between the value of a state the model predicted would happen (the prior) and the value of the state that actually happened (the posterior). If the model’s prediction error leads to a significant change in expected reward or value, the Meta Weighter assigns that sample a higher weight, forcing the world model to prioritize it during future updates. To keep computation feasible, TEMPO uses a first-order gradient approximation to update the meta-weighter, avoiding expensive second-order derivatives.

Key Insights and Performance

Rather than changing the architecture of the world model, TEMPO changes the importance of the data. This selective attention allows it to keep the benefits of MLE (rich representations) while gaining the focus of value-aware models. Ablation studies reveal that the Meta Weighter performs significantly better when it has access to the deterministic part of the latent state ($h_t$), suggesting temporal context is vital for determining task relevance. Furthermore, to maintain stability, TEMPO uses a moving mean and variance to normalize value errors, preventing the optimization from exploding as the agent improves.

The researchers evaluated TEMPO across two major benchmarks: 9 continuous control tasks from the DeepMind Control Suite (DMC) and 6 discrete control tasks from Atari Video Games.

Performance on DeepMind Control Suite

TEMPO demonstrated superior performance, outperforming the original DreamerV2 across almost all tested environments in terms of final score and training stability. Notably, it exhibited remarkable sample efficiency. In the DeepMind Control Suite, TEMPO reached the performance levels of top-tier model-free agents (like D4PG) in just 1 million steps, whereas those baseline agents typically require up to 100 million steps. The framework also proved highly adaptable to different hyperparameters, indicating robust tuning stability.

Limitations and Future Work

The primary drawback of TEMPO is its computational cost. Because it involves two nested optimization loops, TEMPO trains roughly 40% slower and requires 80% more RAM than the standard DreamerV2.

Future work aims to test TEMPO on more complex, long-horizon tasks and explore how this task-aware weighting could be adapted for multi-task learning, where a single world model might need to support several different agents with distinct goals simultaneously.

Summary updated

BibTeX
@inproceedings{yuan2023task,
  author = {Huining Yuan and Hongkun Dou and Xingyu Jiang and Yue Deng},
  title = {{Task-aware world model learning with meta weighting via bi-level optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=IN3hQx1BrC},
}
Figure