The Effective Horizon Explains Deep RL Performance in Stochastic Environments

Cassidy Laidlaw, Banghua Zhu, Stuart Russell, Anca Dragan

TL;DR

This paper bridges the notorious gap between reinforcement learning (RL) theory and practice by showing that many stochastic environments possess a short "effective horizon." The authors introduce SQIRL, a novel algorithm demonstrating that random exploration combined with standard in-distribution regression (like neural networks) is sufficient to solve these environments, explaining why deep RL succeeds despite theoretical worst-case pessimism.

What Problem Does This Paper Address?

Standard RL theory paints a bleak picture: in the worst-case scenario, random exploration strategies (like $\epsilon$-greedy) require a number of samples that scales exponentially with the environment's horizon. To provide guarantees, theory often mandates complex "strategic exploration" algorithms (like upper confidence bound bonuses) paired with highly restricted function classes.

In practice, however, deep RL algorithms like PPO and DQN routinely defy these grim theoretical bounds. They achieve remarkable success using simple random exploration and highly expressive, unstructured neural networks. This paper tackles the fundamental question: Why does deep RL work so well in practice when theory says it shouldn't?

Methods

The authors extend the concept of the "effective horizon" to stochastic environments. They introduce the property of $k$-QVI-solvability: an environment is $k$-QVI-solvable if an optimal policy can be found by taking the random policy's Q-function, performing just $k$ steps of Q-value iteration, and then acting greedily.

To exploit this, they propose SQIRL (Shallow Q-iteration via Reinforcement Learning), a generalization of the deterministic GORP algorithm to stochastic settings. SQIRL elegantly separates exploration from learning:

  1. Exploration: It collects rollouts using purely random exploration.
  2. Learning: It uses a standard regression oracle to estimate the random policy's Q-function, followed by $k-1$ steps of fitted Q-iteration (FQI).

Unlike strategic exploration algorithms that require complex propagation of exploration bonuses through function approximators, SQIRL only relies on the function approximator's ability to generalize in-distribution—a property neural networks are empirically famous for.

Figure 1: We introduce the shallow Q-iteration via reinforcement learning (SQIRL) algorithm, which uses random exploration and function approximation to efficiently solve environments with a low stochastic effective horizon. SQIRL is a generalization of the GORP algorithm (Laidlaw et al., 2023) to stochastic environments. In the figure, both algorithms are shown solving the first timestep of a 2-QVI-solvable MDP. The GORP algorithm (left) uses random rollouts to estimate the random policy’s Q-values at the leaf nodes of a “search tree” and then backs up these values to the root node. It is challenging to generalize this algorithm to stochastic environments because both the initial state and transition dynamics are random. This makes it impossible to perform the steps of GORP where it averages over random rollouts and backs up values along deterministic transitions. SQIRL replaces these steps with regression of the random policy’s Q-values at leaf nodes and fitted Q-iteration (FQI) for backing up values, allowing it to efficiently learn in stochastic environments.

Datasets

The authors evaluated their insights and algorithms on two main benchmarks:

  • Sticky-action BRIDGE Dataset: A modified version of the 155 deterministic environments from Laidlaw et al. (2023). By adding a 25% chance that an action repeats from the previous timestep, they transformed these benchmarks into challenging stochastic environments with high-dimensional states.
  • Full-length Atari Games: Standard benchmarks (Beam Rider, Breakout, Pong, Qbert, Seaquest, Space Invaders) implemented via Stable-Baselines3, modified to disable episode restarts upon loss of life to fit the episodic RL formalism.

Key Insights and Ideas

  • The Power of Low Lookahead: A shocking number of empirical RL environments can be solved with very little lookahead. More than half of the sticky-action BRIDGE environments are approximately 1-QVI-solvable, meaning you can find a near-optimal policy simply by acting greedily relative to a random policy's Q-function.
  • Decoupling Exploration and Learning: When the effective horizon is low, strategic exploration is unnecessary. Random exploration covers enough ground to let powerful function approximators (like deep neural networks) do what they do best: generalize from in-distribution data.
  • SQIRL as an Explanatory Proxy: SQIRL's performance closely mirrors that of PPO and DQN. This strong correlation suggests that popular deep RL algorithms succeed not because they are doing sophisticated strategic exploration, but because they are exploiting the low effective horizon of the environments.
Figure 2: Among sticky-action versions of the MDPs in the BRIDGE dataset, more than half can be approximately solved by acting greedily with respect to the random policy’s Q-function (k = 1); many more can be by applying just a few steps of Q-value iteration before acting greedily (2 ≤k ≤5). When k is low, we observe that deep RL algorithms like PPO are much more likely to solve the environment.

Key Results

  • Benchmark Performance: In the sticky-action BRIDGE environments, SQIRL solved 69 out of 155 environments, approaching DQN (76) and PPO (96). Crucially, the deterministic baseline GORP failed, solving only 26, validating SQIRL's stochastic design.
  • Sample Complexity Correlation: SQIRL’s empirical sample complexity highly correlates with PPO (Spearman correlation of 0.83) and DQN (0.56), performing on a similar absolute scale.
Empirical sample complexity of SQIRL compared directly against PPO and DQN, showing tight correlation.
  • Atari Success: In full-length Atari games, SQIRL achieved comparable or superior rewards to PPO and DQN in 4 out of 6 games, proving the effective horizon theory scales to standard complex benchmarks.
Learning curves on full-length Atari games showing SQIRL performing comparably to deep RL baselines.

Limitations and Future Work

While SQIRL serves as an excellent theoretical and explanatory tool, it is not yet a practical replacement for general deep RL algorithms. It requires extensive hyperparameter tuning—specifically a binary search to find the optimal lookahead steps ($k$) and sample size ($m$) for each environment. Additionally, PPO and DQN still outperform SQIRL in a minority of environments, indicating that current effective horizon metrics do not capture 100% of the mechanisms driving deep RL's success. Future work includes refining these bounds and developing algorithms that can automatically adapt to an environment's effective horizon without manual tuning.

Summary updated

BibTeX
@inproceedings{laidlaw2024effective,
  author = {Cassidy Laidlaw and Banghua Zhu and Stuart Russell and Anca Dragan},
  title = {{The Effective Horizon Explains Deep RL Performance in Stochastic Environments}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=5ES5Hdlbxw},
}
Figure