arXiv(opens in a new tab)cs.NESep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.01811

Reinforcement learning to choose optimizers

Martin van der Schelling, Deepesh Toshniwal, Miguel A. Bessa

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

A PREPRINT

Martin van der Schelling

Department of Mechanical Engineering Delft University of Technology, Delft, the Netherlands M.P.vanderSchelling@tudelft.nl

Deepesh Toshniwal

Institute of Applied Mathematics Delft University of Technology, Delft, the Netherlands D.Toshniwal@tudelft.nl

Miguel A. Bessa

School of Engineering Brown University, Providence, RI, USA miguel_bessa@brown.edu

September 3, 2026

ABSTRACT

No single optimization method is uniformly best for all problems, and the most suitable optimizer choice can change during a run. Existing approaches that change optimizer during execution typically predetermine part of the strategy: the portfolio is restricted to one algorithm class, the switch occurs once at a fixed time, or the frequency of decisions is treated as a hyperparameter rather than a learned one. We introduce “Reinforcement Learning to Choose Optimizers”, which formulates the optimization algorithm choice as a sequential decision-making problem. At each decision, a recurrent policy reads the current run state and decides both which optimizer should be used next and for how long. The portfolio includes both gradient-based and derivative-free optimizers, and each switch passes on the current best solution and a representative step size. A context proxy conditions a gating network over expert heads, and training employs a decoupled actor-critic whose return is expressed in the same empirical runtime distribution metric used at evaluation. Training tasks and portfolio are designed jointly so that no optimizer dominates. On unseen problems, the learned policy outperforms every portfolio optimizer at all but the smallest budgets, and it remains robust under distribution shift.

Keywords Algorithm portfolios · Dynamic algorithm configuration · Reinforcement learning

1 Introduction

Optimization is central to data-driven design [1]. Evaluating the objective typically requires a simulation, so the number of loss function evaluations is constrained. The “No Free Lunch” theorem states that no single optimization algorithm outperforms all others on every problem [2], making optimizer selection and hyperparameter tuning a design problem in itself. Meta-optimization answers it from several directions: automatic algorithm selection [3], hyper-heuristics [4, 5] and learning to optimize [6, 7]. Each of these approaches trains a model to conduct this selection, and that model is static once training has finished, fixing in advance how far a run can adapt. The most effective optimizer is specific to the loss landscape and changes as the search progresses, and a well-placed switch between two algorithms can outperform either of them alone [8, 9].

Existing methods that switch optimizers mid-run always predefine some portion of the strategy and learn only the remaining part. One line of work uses a single offline-computed switch from a global to a local method, applied once per problem [10]. Another learns repeated switches but restricts the portfolio to one algorithmic family, keeping the optimizer portfolio narrow [11–13]. A third line switches at every iteration [14]. In all these cases, the interval between decisions is a framework hyperparameter, not controlled by the policy.

Each element of this problem has been solved in isolation. Portfolios combining gradient-based and derivative-free methods have existed for decades, full optimizers have been selected and transferred to new problems, and the refinement effort has been adapted since the earliest memetic algorithms [8, 11, 15–17]. Repeatedly deciding which optimizer takes control, and for how long, must

A PREPRINT

be done over a portfolio whose members do not share internal-state representations. Any policy for this must be deployed over a distribution of problems, precisely where learned meta-optimizers are weakest [18].

Contributions: We introduce “Reinforcement Learning to Choose Optimizers” (RL2CO), which formulates the schedule of an optimization run as a sequential control problem. At each decision point, a recurrent policy observes the run state and selects (i) an optimizer from a fixed portfolio and (ii) how many iterations it may run before revisiting the choice. The portfolio contains both gradient-based and derivative-free methods. A switch passes the new optimizer the best solution obtained so far along with a representative step size, allowing it to continue at the scale the search has already achieved rather than reverting to a global scale. Because the same observation can require different actions on different landscapes, the policy is conditioned on a proxy for the problem context. This proxy feeds a gating network over expert heads. We train with a decoupled actor-critic model. The return it maximizes is denominated in the same empirical runtime distribution metric the evaluation reports. Since a portfolio in which one member dominates would leave no benefit for a learned optimizer selector, the training problems and the portfolio are designed jointly, maximizing the margin an informed per-problem choice holds over the portfolio average. This work extends our earlier study [19], where a single optimizer was chosen from the problem features and switched only once.

To assess the framework we train a policy across 100 tasks drawn from three Black-Box Optimization Benchmarking (BBOB) suites, over a portfolio and task set selected jointly. It is evaluated on 100 held-out problems, against every member of that portfolio and against a random schedule over the same optimizers. The same policy is tested on problem families absent from training, showing robustness to distribution shift. Our code, dataset, and documentation are available according to FAIR principles (Findable, Accessible, Interoperable, and Reusable)¹.

References (75)