Multi-Step Dyna Planning for Policy Evaluation and Control

hengshuai yao, Richard S. Sutton, Shalabh Bhatnagar, Diao Dongcui, Csaba SzepesváriNeurIPS 2009

Introduction

In Reinforcement Learning (RL), the Dyna architecture is a classic framework that combines learning from real experience with planning from a learned model of the world. However, most existing Dyna algorithms are "single-step"—they only simulate what happens one step into the future.

This single-step limitation represents a missed opportunity. If an agent has a model, projecting many steps ahead could theoretically accelerate learning. While this sounds simple, executing it with linear function approximation (which is necessary for large-scale problems) is computationally tricky. Iterating a linear model multiple times is expensive, and looking too far into the future can actually hurt performance if the model has small errors that compound over time.

This paper introduces a multi-step linear Dyna-style planning framework that allows RL agents to efficiently "look ahead" multiple steps during the planning phase, demonstrating faster learning and better performance in both policy evaluation and control tasks.

Methods: Building a Multi-Step Model

The authors propose two primary ways to build a multi-step linear model:

  1. The Iterated Model: This approach simply multiplies the one-step transition matrix $k$ times. While mathematically sound, it is computationally heavy (with $O(n^3)$ complexity) for problems with many features, making it impractical for large-scale online learning.
  2. The $\lambda$-model: This is the paper's primary contribution. It uses a decay factor $\lambda \in (0, 1]$ to interpolate between a one-step model and an infinite-step model. Interestingly, the infinite-step version of this model turns out to be mathematically equivalent to the LSTD (Least-Squares Temporal Difference) solution. Crucially, the $\lambda$-model is much more efficient to compute online than the iterated model.

For Control tasks—where the agent is actively trying to find the best policy rather than just evaluating an existing one—the authors introduce a "greedy-tracking" model. Instead of building a separate model for every possible action, they build a single dynamic model that tracks the transitions of the current greedy policy. This enables a highly efficient "Linear Dyna-Q" architecture.

Key Insights and Results

The algorithms were evaluated on two classic reinforcement learning benchmarks: the Boyan Chain (for policy evaluation) and the Mountain-car task (for control, utilizing tile coding to create a high-dimensional feature space of up to 30,000 features).

Policy Evaluation: Faster Convergence

One of the most elegant insights in the paper is the realization that LSTD is essentially a Dyna planner that looks infinitely far into the future. In stationary environments like the Boyan Chain, looking further ahead generally helps.

RMSE on Boyan Chain showing faster convergence of multi-step Dyna

As shown in the evaluation results, multi-step Dyna (such as Dyna(10)-lambda) learns significantly faster than both standard TD learning and single-step linear Dyna(1). The $\lambda$-model successfully provides the benefits of multi-step lookahead without the prohibitive cost of matrix exponentiation.

Control Tasks: The "Sweet Spot" of Planning

While looking infinitely far ahead works well for policy evaluation, control tasks involve non-stationary environments because the agent's policy is constantly changing. In these scenarios, looking too far ahead can be disastrous due to error magnification. Previous attempts to use LSTD for online control often failed because infinite-step planning magnifies small model errors.

Online return on Mountain-car showing superiority of intermediate multi-step planning

In the Mountain-car task, the authors discovered a clear "sweet spot" for planning horizons. Intermediate multi-step models like Dyna-Q(5) and Dyna-Q(10) achieved much higher returns significantly faster than standard Q-learning or single-step Dyna. Conversely, the infinite-step Dyna-Q($\infty$) and LSTD-based control were often unstable and failed to solve the task reliably, confirming that a finite planning horizon is much safer in practice.

Limitations and Future Work

While multi-step Dyna shows massive improvements over single-step methods, the authors note a few limitations:

  • Parameter Sensitivity: The performance of the $\lambda$-model is sensitive to the initialization of the $A$ matrix (a core component of the LSTD solution). Choosing the right perturbation for this initialization is crucial for stability.
  • The Choice of $k$: The paper empirically demonstrates that intermediate values of $k$ (e.g., 5 or 10) are best for control, but it does not provide a formal method for automatically selecting the optimal number of planning steps for a novel environment.
  • Exploration: The current work does not deeply explore how multi-step planning interacts with different exploration strategies.

Future work may involve developing more robust ways to handle the non-stationarity of control environments, perhaps by incorporating "forgetting" strategies to keep the learned model fresh as the agent's policy evolves.

Summary updated

BibTeX
@inproceedings{yao2009multi,
  author = {hengshuai yao and Richard S. Sutton and Shalabh Bhatnagar and Diao Dongcui and Csaba Szepesvári},
  title = {{Multi-Step Dyna Planning for Policy Evaluation and Control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2009},
  url = {https://openreview.net/forum?id=Sk-8cubOWB},
}
Figure