Instabilities of Offline RL with Pre-Trained Neural Representation

Ruosong Wang, Yifan Wu, Ruslan Salakhutdinov, Sham M. Kakade

TL;DR

This paper investigates the stability of offline Reinforcement Learning (RL) methods when using pre-trained neural network representations. They find that even with powerful pre-trained features, offline RL remains highly sensitive to distribution shifts in the data, leading to significant error amplification. This suggests that successful offline RL requires stronger conditions than typically assumed for supervised learning.

What Problem Does This Paper Address?

Offline Reinforcement Learning (RL) aims to learn or evaluate policies using pre-collected datasets, without further interaction with the environment. This is crucial in domains where real-world interaction is expensive or dangerous. A key challenge in offline RL is the "distribution shift" problem: the data distribution from which the dataset was collected might differ significantly from the distribution induced by the target policy we want to evaluate or learn. Theoretical work has shown that this shift can lead to exponential error amplification unless certain strong representational conditions are met.

This paper tackles the question of how stable current offline RL methods are in practice, especially when using modern, powerful representations like those from pre-trained neural networks. The authors want to empirically understand if these advanced representations can overcome the theoretical pitfalls of distribution shift, or if offline RL remains inherently unstable in realistic scenarios.

Methods

The core of this work is an empirical investigation into the sensitivity of offline RL methods to distribution shift. They focus on the policy evaluation problem, where the goal is to accurately estimate the value of a fixed target policy.

Key methodological aspects include:

  • Fitted Q-Iteration (FQI): This is a standard offline RL algorithm used as the primary method for evaluation. It's a foundational algorithm that iteratively estimates Q-values.
  • Pre-trained Neural Network Features: Instead of learning features from scratch, the authors leverage features extracted from neural networks pre-trained on the same tasks. This is motivated by the success of pre-trained features in supervised learning and the hope that they might provide robust representations for offline RL.
  • Random Fourier Features: Used as a baseline to compare against pre-trained features.
  • Controlled Distribution Shifts: The authors systematically create datasets with varying degrees of distribution shift. This is achieved by mixing trajectories from the target policy with trajectories from:
  • Random policies: Introducing noisy, less structured behavior.
  • Lower-performing policies: Introducing data from policies that are suboptimal but still related to the task.
  • Hyperparameter Sensitivity Analysis: They investigate how sensitive the performance is to regularization parameters, a critical aspect for practical offline RL.

Datasets

The experiments are conducted on a range of standard tasks from the OpenAI Gym benchmark suite. This includes:

  • Discrete action spaces: MountainCar-v0, CartPole-v0
  • Continuous action spaces: Ant-v2, HalfCheetah-v2, Hopper-v2, Walker2d-v2

The datasets used are constructed by:

  1. Collecting trajectories from a target policy (trained using standard online RL methods like DQN or TD3).
  2. Mixing these with trajectories from either random policies or four different lower-performing policies.
  3. The amount of data from the target policy is kept constant, while the proportion of data from shifted distributions is varied.

Key Insights and Ideas

  • Pre-trained features are not a silver bullet: Despite the power of pre-trained neural networks in supervised learning, they do not inherently solve the instability issues in offline RL caused by distribution shift. Error amplification still occurs.
  • Offline RL is brittle to distribution shift: Even with "mild" distribution shifts (i.e., adding data from random or suboptimal policies), offline RL methods can exhibit substantial performance degradation and error amplification.
  • Stronger representation conditions needed: The findings suggest that the representational conditions required for successful offline RL are significantly stronger than those for supervised learning, even when using powerful pre-trained features.
  • Hyperparameter tuning is a major hurdle: The sensitivity of offline RL methods to hyperparameters (like regularization) is highlighted, making practical application challenging without access to online interaction.
  • Empirical practices need scrutiny: The paper raises concerns about common practices in offline RL benchmarks, such as creating datasets heavily biased towards the target policy, which might not reflect real-world scenarios and could mask underlying instability issues.

Key Results

  • Error Amplification is Pervasive: Across multiple environments and with both pre-trained and random Fourier features, adding data from shifted distributions consistently degraded performance and led to increased estimation error. In some cases, this error increased exponentially with the number of FQI rounds.
  • Degradation with More Data: Surprisingly, in many experiments, adding more data from shifted distributions (e.g., 2x random trajectories compared to 0.5x) led to worse performance, indicating that the quality and relevance of the data are paramount.
  • Policy Comparison Challenges: Table 3 shows that FQI often struggles to distinguish between the target policy and lower-performing policies when the dataset is shifted, suggesting that accurate value estimation is compromised.
  • Sensitivity to Regularization: Figure 6 demonstrates that the choice of regularization parameter (λ) significantly impacts FQI's performance, especially when distribution shift is present.

Limitations and Future Work

  • Focus on Policy Evaluation: The paper primarily focuses on policy evaluation, not policy improvement. While this simplifies the problem, future work could explore how these findings extend to policy optimization.
  • Controlled Environments: The experiments are conducted in simulated environments. Extending these findings to more complex, real-world domains would be valuable.
  • Stronger Representation Conditions: The authors suggest that future research should focus on developing representation learning methods specifically tailored for offline RL, going beyond standard supervised learning approaches to satisfy the stronger conditions required for stability.
  • Coupling Representation Learning and Offline RL: An open question is how to effectively couple representation learning with offline RL methods to achieve better performance.
  • Realistic Data Collection: The paper advocates for more realistic data collection strategies that better reflect diverse distribution shifts, moving beyond curated datasets that might mask instability.

Summary updated

BibTeX
@inproceedings{wang2021instabilities,
  author = {Ruosong Wang and Yifan Wu and Ruslan Salakhutdinov and Sham M. Kakade},
  title = {{Instabilities of Offline RL with Pre-Trained Neural Representation}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
}
Figure