Abstract
Dynamic Algorithm Configuration (DAC) has garnered significant attention in recent years, particularly in the prevalence of machine learning and deep learning algorithms. Numerous studies have leveraged the robustness of decision-making in Reinforcement Learning (RL) to address the optimization challenges associated with algorithm configuration. However, making an RL agent work properly is a non-trivial task, especially in reward design, which necessitates a substantial amount of handcrafted knowledge based on domain expertise. In this work, we study the importance of reward design in the context of DAC via a case study on controlling the population size of the $(1+(\lambda,\lambda))$-GA optimizing OneMax. We observed that a poorly designed reward can hinder the RL agent's ability to learn an optimal policy because of a lack of exploration, leading to both scalability and learning divergence issues. To address those challenges, we propose the application of a reward shaping mechanism to facilitate enhanced exploration of the environment by the RL agent. Our work not only demonstrates the ability of RL in dynamically configuring the $(1+(\lambda,\lambda))$-GA, but also confirms the advantages of reward shaping in the scalability of RL agents across various sizes of OneMax problems.
Introduction
In the world of optimization, Dynamic Algorithm Configuration (DAC) is often considered the "holy grail": rather than selecting a fixed parameter at the outset, parameters are adjusted dynamically as the algorithm progresses. Reinforcement Learning (RL) is a natural fit for this task, yet it remains notoriously difficult to implement effectively.
This study focuses on a specific challenge: controlling the population size ($\lambda$) of the $(1+(\lambda, \lambda))$-GA while solving the OneMax problem. Previous attempts to use RL for this task encountered a significant barrier: as problem sizes increased, agents either failed to learn or their performance diverged. The researchers identified an "under-exploration trap" where agents become "lazy," preferring small, inexpensive population sizes and failing to discover that larger populations can solve the problem faster in the long run.
Methods
The researchers employed Double Deep Q-Networks (DDQN) but focused their innovation on the Reward Function. A standard reward for this task is typically $r = \Delta f - E$, where $\Delta f$ is fitness improvement and $E$ is the evaluation cost. To overcome exploration bottlenecks, the authors introduced:
- Reward Scaling: Dividing the reward by the problem size ($n$) to stabilize signals across different complexities.
- Adaptive Reward Shifting: Adding a negative bias term to the reward. This "pessimistic initialization" discourages the agent from settling into mediocre policies and forces exploration of more aggressive, high-payoff actions.
- Automation: An adaptive mechanism calculates this bias based on a short "warm-up" phase at the start of training.
As shown in Figure 4, naive reward functions ($r = \Delta f - E$) and simple scaled rewards ($r = (\Delta f - E)/n$) suffer from a rapidly declining "hitting rate"—the probability of finding a policy better than the baseline—as the problem size increases, effectively failing for $n \ge 200$.
Key Results
The study utilized the OneMax-DAC benchmark, comparing RL against theory-derived policies, an optimal policy ($\pi_{opt}$), and irace, a popular black-box configuration tool.
- Outperforming Theory: RL agents trained with adaptive reward shifting consistently outperformed the best-known discretized theory-derived policies across all problem sizes.
- Massive Sample Efficiency: While
iracerequired between 18 million and 308 million time steps to find a competitive policy, the DDQN with reward shifting achieved the same result in just 12,000 steps—a 3 to 4 order of magnitude improvement. - Robust Scalability: While naive RL failed above $n=200$, the reward-shaped agent scaled successfully up to $n=2000$.
Figure 3 illustrates that the learned RL policies (left) closely approximate the structure of the optimal policy. Consequently, the Expected Running Time (ERT) of the RL agents (right) remains highly competitive with the theoretical optimum and superior to fixed-parameter baselines across all tested dimensions.
Conclusion
This research demonstrates that reward design is the critical factor in making RL-based DAC both effective and scalable. By implementing reward scaling and adaptive shifting, RL agents can overcome the "divergence-stagnation" trap and achieve state-of-the-art performance with unprecedented sample efficiency. Future work will extend these reward-shaping strategies to black-box optimization problems where ground-truth dynamics are unknown.
Summary updated