Dyna Planning using a Feature Based Generative Model

Ryan Faulkner, Doina PrecuparXiv 2018

Introduction

Reinforcement learning (RL) agents often face significant challenges in environments where real-world data collection is expensive or scarce. The Dyna architecture addresses this by using real experiences to build a model of the environment, which then generates simulated experiences to refine the agent's policy without requiring additional real-world actions. While effective in discrete, low-dimensional spaces, traditional Dyna models struggle with high-dimensional inputs like raw images. Previous linear "expectation models" fail to capture the complex, non-linear dynamics of such visual environments. This paper proposes a solution by integrating Deep Belief Networks (DBNs) into the Dyna framework to learn a robust generative model of high-dimensional states.

Methodology: Deep Generative Models for Dyna

The core contribution of this work is the replacement of traditional tabular or linear models with a DBN-based architecture. This architecture consists of two primary components designed to handle visual data efficiently:

  1. Autoencoder Network: Composed of stacked Restricted Boltzmann Machines (RBMs), this component compresses high-dimensional image data into a compact, lower-dimensional latent representation.
  2. Temporal Layer (Top-Level RBM): This layer acts as an associative memory, learning the conditional probability of the next latent state given the current one.
The DBN architecture for high-dimensional state representation and transition modeling.

For environments with discrete action spaces, a separate DBN is trained for each possible action. During the "fantasizing" phase, the agent encodes a real image into its latent form, performs Gibbs sampling in the temporal layer to predict the subsequent latent state, and decodes this prediction back into a raw image to simulate a trajectory.

Experimental Setup

The approach was evaluated on two custom grid-world tasks designed to test visual modeling:

  • MNIST Environment: A 10-state Markov chain where states are represented by randomly sampled MNIST digits. This served as a proof-of-concept for model stability.
  • NORB Environment: A 90-state 2D navigation task using $32 \times 32$ images of 3D toy objects. The agent navigates using four cardinal actions with a 90% success rate.

Results and Key Insights

The DBN-based model demonstrated significant advantages over traditional methods in terms of both accuracy and sample efficiency:

  • Long-term Stability: Unlike linear models that quickly degrade into unrecognizable noise, the DBN model maintained stability over 20-step "fantasized" trajectories, closely tracking the true environment distribution.
  • Efficiency in Latent Space: Modeling dynamics in a compressed space allows for the rapid inference necessary for Dyna's planning phase, where thousands of simulated steps may be required between real actions.
  • Improved Convergence: In the NORB task, simulating 50 steps for every real interaction led to significantly faster policy convergence compared to standard SARSA/TD(0) baselines.
Performance metrics including value error and total variation against training time and steps.

As shown in the performance plots, the DBN approach (Function Approximation) maintains lower error rates and higher fidelity over extended walks compared to tabular or linear alternatives, highlighting the necessity of non-linear generative models for visual RL.

Conclusion and Future Work

This work demonstrates that deep generative models can successfully scale the Dyna architecture to high-dimensional visual domains, bridging the gap between model-based RL and complex sensory inputs. However, limitations remain, such as the need for separate networks per action and the current offline nature of model training. Future research will focus on online model updates, handling partial observability, and scaling to more complex, cluttered environments.

Summary updated

BibTeX
@misc{faulkner2018dyna,
  author = {Ryan Faulkner and Doina Precup},
  title = {{Dyna Planning using a Feature Based Generative Model}},
  year = {2018},
  eprint = {1805.10129},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.10129},
}
Figure