Should Models Be Accurate?

Esra'a Saleh, John D. Martin, Anna Koop, Arash Pourzarabi, Michael BowlingarXiv 2022 · DOI

TL;DR

This paper challenges the long-held assumption that models in Reinforcement Learning (RL) must accurately simulate environment dynamics. Instead, they propose and demonstrate that models optimized for usefulness to the learning agent can lead to faster adaptation and learning, even outperforming accurate models in non-stationary environments.

What Problem Does This Paper Address?

Model-based Reinforcement Learning (MBRL) aims to improve sample efficiency by using a learned model of the environment to generate synthetic experience for planning. Traditionally, the objective for learning these models has been to achieve high accuracy in simulating environment transitions. However, in complex or changing environments, achieving perfect accuracy is practically impossible, and even if achievable, it might not be the most beneficial approach for the learning agent. This paper questions this accuracy-centric paradigm, asking if models should instead be optimized for their utility in helping the agent learn faster.

Methods

The authors introduce SynthDyna, a meta-learning algorithm for training models in Dyna-style RL. Unlike traditional approaches that train models for accuracy, SynthDyna trains its generative model (a 2-layer fully connected neural network) using a meta-loss function. This meta-loss is tied to the agent's primary objective: minimizing prediction error. Essentially, the model is trained to produce synthetic transitions that, when used for planning, help the agent update its value function more effectively. SynthDyna uses a 2-layer fully connected neural network as its generative model, taking Gaussian noise as input and producing transition tuples (state, reward, next state).

Datasets

The paper introduces a non-stationary windy hallway environment for evaluation. This environment is a 6x3 gridworld with episode-terminating cells. The key non-stationarity comes from reward regimes that switch every 300 episodes, altering where positive and negative rewards are located. This setup is designed to be simple yet challenging for model learning, as a perfect model would need to capture the changing reward structure, which is difficult with a fixed state representation.

Key Insights and Ideas

  • Accuracy is not always necessary or achievable: The paper argues that perfect model accuracy is practically impossible in complex environments due to computational limits and the inherent unpredictability of the real world. Furthermore, the "value equivalence principle" suggests that models don't need to perfectly mimic dynamics if they produce the same value updates.
  • Usefulness over accuracy: The core idea is that a model's utility to the learning agent (i.e., how well it helps the agent learn its value function) is a more important objective than its raw accuracy in simulating transitions.
  • Meta-learning for utility: SynthDyna demonstrates that meta-learning can be effectively used to train models that are optimized for usefulness, directly reducing prediction error rather than aiming for a perfect environmental simulation.
  • Synthetic data can be powerful: Even though SynthDyna's model generates purely synthetic transitions, it can lead to faster learning than using a model that attempts to be accurate or even a stable model informed by domain knowledge.

Key Results

In the non-stationary windy hallway environment, SynthDyna significantly outperformed several baselines:

  • Model-free: A standard RL agent using only veridical experience.
  • AllExperienceDyna: A Dyna agent that replays all past transitions, which can be detrimental in non-stationary settings.
  • StableExperienceDyna: A Dyna agent that uses domain-specific knowledge to only replay stable transitions (those not affected by reward regime changes). This was the strongest baseline.

SynthDyna achieved a statistically significant lower mean squared value error (MSE) compared to StableExperienceDyna, demonstrating that its meta-learned, utility-focused model enabled faster adaptation and learning in the face of environmental changes.

Limitations and Future Work

  • Limited environment complexity: The experiments were conducted in a relatively simple, albeit non-stationary, gridworld. The authors acknowledge that the effectiveness of SynthDyna in more complex, high-dimensional, or continuous state-action spaces remains an open question.
  • Focus on prediction: The current work focuses on a prediction setting, and extending this to full control problems in RL would be a natural next step.
  • Meta-loss design: The specific meta-loss function used is crucial. Exploring alternative meta-learning objectives that further enhance model utility could be beneficial.
  • Generalizability of SynthDyna: Further research is needed to understand how generalizable SynthDyna's approach is across a wider range of RL tasks and environments.

Summary updated

Abstract

Model-based Reinforcement Learning (MBRL) holds promise for data-efficiency by planning with model-generated experience in addition to learning with experience from the environment. However, in complex or changing environments, models in MBRL will inevitably be imperfect, and their detrimental effects on learning can be difficult to mitigate. In this work, we question whether the objective of these models should be the accurate simulation of environment dynamics at all. We focus our investigations on Dyna-style planning in a prediction setting. First, we highlight and support three motivating points: a perfectly accurate model of environment dynamics is not practically achievable, is not necessary, and is not always the most useful anyways. Second, we introduce a meta-learning algorithm for training models with a focus on their usefulness to the learner instead of their accuracy in modelling the environment. Our experiments show that in a simple non-stationary environment, our algorithm enables faster learning than even using an accurate model built with domain-specific knowledge of the non-stationarity.
BibTeX
@misc{saleh2022should,
  author = {Esra'a Saleh and John D. Martin and Anna Koop and Arash Pourzarabi and Michael Bowling},
  title = {{Should Models Be Accurate?}},
  year = {2022},
  eprint = {2205.10736},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.10736},
}
Figure