No More Pesky Hyperparameters: Offline Hyperparameter Tuning for RL

Han Wang, Archit Sakhadeo, Adam M White, James M Bell, Vincent Liu, Xutong Zhao, Puer Liu, Tadashi Kozuno, Alona Fyshe, Martha White

Abstract

The performance of reinforcement learning (RL) agents is sensitive to the choice of hyperparameters. In real-world settings like robotics or industrial control systems, however, testing different hyperparameter configurations directly on the environment can be financially prohibitive, dangerous, or time consuming. We focus on hyperparameter tuning from offline logs of data, to fully specify the hyperparameters for an RL agent that learns online in the real world. The approach is conceptually simple: we first learn a model of the environment from the offline data, which we call a calibration model, and then simulate learning in the calibration model to identify promising hyperparameters. Though such a natural idea is (likely) being used in industry, it has yet to be systematically investigated. We identify several criteria to make this strategy effective, and develop an approach that satisfies these criteria. We empirically investigate the method in a variety of settings to identify when it is effective and when it fails.

Introduction

The "hyperparameter bottleneck" remains a significant barrier to deploying reinforcement learning (RL) in real-world applications. While researchers in simulated environments can afford thousands of trials to optimize learning rates or exploration constants, industrial plants or physical robots cannot. Testing a suboptimal hyperparameter configuration in these settings can lead to catastrophic failure, equipment damage, or significant resource waste.

This work addresses the challenge of offline hyperparameter tuning. Instead of learning a fixed policy directly from data (as in standard Offline RL), the authors propose using offline data logs to identify the best settings for an agent that will continue to learn and adapt once deployed online.

Methods: The Data2Online Framework

The proposed Data2Online strategy utilizes a three-step workflow to bridge the gap between offline data and online performance:

  1. Learn a Calibration Model: A simulator is constructed using offline logs, which may come from human operators or legacy controllers.
  2. Hyperparameter Search: The RL agent is trained within this learned simulator across various hyperparameter configurations ($\Lambda$).
  3. Deployment: The configuration that performs best in the calibration model is selected for real-world online deployment.
The Data2Online workflow: from plant data logs to a calibration model for hyperparameter evaluation and final deployment.

To ensure the calibration model is effective, the authors emphasize stability and self-correction. They utilize a non-parametric k-Nearest Neighbor (KNN) model combined with Laplace representations for metric learning. This approach maps states into a space where Euclidean distance reflects reachability. Additionally, a pessimistic default return is implemented: if an agent explores actions outside the observed data distribution, the model terminates the episode with a low reward to prevent "hallucinating" success in unknown regions.

Algorithm 1: Hyperparameter Selection with Calibration Models using Grid Search.

Empirical Evaluation

The framework was evaluated on classic control tasks: Acrobot, Puddle World, and Cartpole. The experiments used data logs of varying quality (random to near-optimal) and size (500 to 5,000 transitions).

Key Results

  • Model Selection: KNN-based calibration models significantly outperformed standard Neural Network models in Acrobot and Puddle World by providing more stable long-term rollouts.
  • Data Efficiency: The method proved robust to small datasets, providing reliable hyperparameter signals with as few as 500 transitions.
  • Search Flexibility: The framework is modular; replacing grid search with Bayesian Optimization (BO) or the Cross-Entropy Method (CEM) yielded settings that outperformed expert-tuned baselines.

Discussion and Insights

A critical finding is the "Success Trap": if offline data only contains successful trajectories (e.g., perfect Cartpole balancing), the calibration model fails to learn failure states. Consequently, it may incorrectly predict that all hyperparameters are equally effective because it never "sees" the pole fall.

Furthermore, while a calibration model doesn't need perfect high-fidelity physics, it must remain stable over long horizons. KNN models, being anchored to real data points, avoid the "drift" often seen in iterated neural network predictions.

Limitations

The primary limitation is data coverage. Without examples of failures or diverse states, the model remains blind to certain risks. Additionally, theoretical error bounds grow quadratically with interaction length ($T^2$), indicating that extremely long-horizon tasks remain a challenge for this approach.

Conclusion

Data2Online provides a systematic way to utilize offline data for the critical task of hyperparameter tuning. By focusing on finding the right learning settings rather than a static policy, it enables safer and more efficient deployment of adaptive RL agents in the real world.

Summary updated

BibTeX
@article{wang2022no,
  author = {Han Wang and Archit Sakhadeo and Adam M White and James M Bell and Vincent Liu and Xutong Zhao and Puer Liu and Tadashi Kozuno and Alona Fyshe and Martha White},
  title = {{No More Pesky Hyperparameters: Offline Hyperparameter Tuning for RL}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=AiOUi3440V},
}
Figure