Optimization by Directional Attacks: Solving Problems with Neural Network Surrogates
Pierre-Yves Bouchet, Thibaut Vidal
TL;DR
This work tackles optimization where the objective and constraints are defined through a trained neural network surrogate $\Phi$, possibly nonwhite-box, by introducing directional NN attacks to identify ascent directions along $\nabla f(\Phi(x))$. It then blends these attack-based steps with a derivative-free optimization method, cdsm, to achieve fast local improvement while ensuring convergence to a local solution under mild assumptions. The paper formalizes the attack operator, discusses practical construction when constraints exist, and proves convergence for the hybrid algorithm. Empirical results across three problems, including simulation-based optimization, counterfactual explanations, and bio-diesel production, show the hybrid method consistently outperforms standard DFO baselines, with the attack component providing strong early progress and cdsm delivering robust refinement.
Abstract
This paper tackles optimization problems whose objective and constraints involve a trained Neural Network (NN), where the goal is to maximize $f(Φ(x))$ subject to $c(Φ(x)) \leq 0$, with $f$ smooth, $c$ general and non-stringent, and $Φ$ an already trained and possibly nonwhite-box NN. We address two challenges regarding this problem: identifying ascent directions for local search, and ensuring reliable convergence towards relevant local solutions. To this end, we re-purpose the notion of directional NN attacks as efficient optimization subroutines, since directional NN attacks use the neural structure of $Φ$ to compute perturbations of $x$ that steer $Φ(x)$ in prescribed directions. Precisely, we develop an attack operator that computes attacks of $Φ$ at any $x$ along the direction $\nabla f(Φ(x))$. Then, we propose a hybrid algorithm combining the attack operator with derivative-free optimization (DFO) techniques, designed for numerical reliability by remaining oblivious to the structure of the problem. We consider the cDSM algorithm, which offers asymptotic guarantees to converge to a local solution under mild assumptions on the problem. The resulting method alternates between attack-based steps for heuristic yet fast local intensification and cDSM steps for certified convergence and numerical reliability. Experiments on three problems show that this hybrid approach consistently outperforms standard DFO baselines.
