Combining Automated Optimisation of Hyperparameters and Reward Shape

Julian Dierkes, Emma Cramer, Holger Hoos, Sebastian Trimpe

Abstract

Deep reinforcement learning (RL) performance is heavily dependent on hyperparameter configurations and reward functions, both of which are challenging to tune. We empirically demonstrate that these two components are mutually dependent, meaning neither can be fully optimized without the other. We propose a methodology for the combined optimization of hyperparameters and reward functions using a black-box optimizer. Our approach also includes a variance penalty to improve policy stability. Experiments on four diverse environments show that joint optimization significantly improves performance in complex tasks and achieves competitive results in simpler ones with minimal computational overhead.

Introduction

The success of Deep RL agents often hinges on expert-driven design choices, specifically hyperparameter optimization (HPO) and reward shaping. While prior research has addressed these independently, we identify a "circular dependency": the effectiveness of a reward signal depends on the algorithm's tuning, and vice versa. This is particularly problematic for novel tasks lacking established baselines, where researchers must derive both from scratch.

Methods

We propose a joint optimization framework that treats hyperparameters ($\theta$) and reward weights ($w$) as a unified search space. The framework employs Differential Evolution HyperBand (DEHB) as the outer-loop optimizer. DEHB combines evolutionary strategies with multi-fidelity evaluation, allowing for efficient exploration of the joint search space by quickly discarding poor configurations. To address the inherent brittleness of RL, we optimize for both high mean performance and low variance (multi-objective optimization).

Key Insights: Circular Dependency

A core finding of this work is the mutual dependence between hyperparameters and reward functions. Landscape analysis demonstrates that the optimal value for a reward weight (e.g., $w_{dist}$) varies drastically depending on hyperparameters like the discount factor $\gamma$ or learning rate $\eta$.

Landscape analysis showing the dependency between reward weights and hyperparameters. The optimal reward weight (blue line) shifts significantly across different hyperparameter values.

This "circular dependency" implies that tuning one set of parameters while keeping the other fixed likely leads to sub-optimal performance. Joint optimization is therefore necessary to reach global performance optima.

Results and Discussion

Our results indicate that joint optimization is particularly beneficial for high-dimensional, complex tasks. We evaluated the method on four environments: Gymnasium LunarLander, Google Brax Ant, Google Brax Humanoid, and Robosuite Wipe.

Comparative performance and stability results across four environments. The joint optimization approach (DEHB ours) consistently achieves top-tier performance and improved stability (lower CV).

In the Humanoid and Wipe environments, the joint approach significantly outperformed baselines. For example, in Humanoid, joint optimization with PPO reached a score of 5433 compared to the 4196 baseline. In simpler tasks like Ant, the automated approach matched expert-tuned performance, demonstrating its utility in replacing manual effort. Crucially, the multi-objective formulation consistently reduced the Coefficient of Variation (CV), indicating more robust and reproducible policies.

Conclusion

This work demonstrates that hyperparameters and reward functions should be optimized jointly. The proposed framework achieves superior performance and stability with negligible additional computational cost compared to individual tuning. This suggests that automated joint optimization should become a standard practice in RL research and application.

Summary updated

BibTeX
@inproceedings{dierkes2024combining,
  author = {Julian Dierkes and Emma Cramer and Holger Hoos and Sebastian Trimpe},
  title = {{Combining Automated Optimisation of Hyperparameters and Reward Shape}},
  booktitle = {RLC},
  year = {2024},
  url = {https://openreview.net/forum?id=SHbM8p3Wgb},
}
Figure