Adaptive Stochastic Natural Gradient Method for Safe Optimization on Binary Space

Kento Uchida, Ryoki Hamano, Masahiro Nomura, Shinichi Shirakawa

TL;DR

This paper introduces safe ASNG, a novel black-box optimization method designed specifically for binary search spaces where evaluating unsafe solutions carries high real-world risks. By combining the Adaptive Stochastic Natural Gradient (ASNG) method with discrete Walsh function surrogate models, the algorithm accurately estimates safety boundaries and projects candidate solutions into a guaranteed "safe region," achieving efficient optimization with virtually zero safety violations.

What Problem Does This Paper Address?

In many real-world optimization problems—such as tuning drug combinations to maximize efficacy without causing patient toxicity, or scheduling metal milling processes without exceeding motor output limits—evaluating a bad candidate solution can be catastrophic. This has led to the field of safe optimization, where the goal is to find the global optimum of an objective function while strictly ensuring that a safety constraint function never drops below zero.

While several effective safe optimization algorithms exist for continuous domains (like SafeOpt or safe CMA-ES), discrete and binary search spaces have been largely neglected. Directly applying continuous methods to binary spaces fails because discrete spaces lack smooth gradient information and present unique geometric challenges, such as having multiple equidistant "nearest neighbors" when trying to project an unsafe solution back into a safe zone.

Methods

The authors build their method on top of the Adaptive Stochastic Natural Gradient (ASNG) framework using a family of Bernoulli distributions. To make it "safe," they introduce three key mechanisms tailored for binary spaces:

  1. Discrete Walsh Function Surrogates: Instead of using Gaussian Process (GP) regression—the standard in continuous safe optimization—the authors use discrete Walsh functions to model the safety constraints. GPs scale poorly ($O(N^3)$ computational complexity) when trained on the entire evaluation history. Walsh surrogates provide highly accurate approximations for pseudo-Boolean functions at a fraction of the computational cost.
  2. Lipschitz Constant Estimation via Hamming Distance: The algorithm estimates the local Lipschitz constant of the safety function with respect to the Hamming distance. This constant dictates how fast the safety function can change, allowing the algorithm to mathematically define a "safe region" around previously evaluated safe points (called "safe seeds").
  3. Likelihood-Based Projection: When ASNG samples a solution that falls outside the safe region, it projects it to the nearest safe neighbor. Because binary geometry often yields multiple equidistant safe neighbors, safe ASNG breaks ties by choosing the solution that maximizes the likelihood under the current Bernoulli search distribution.
The Walsh-based surrogate reduces update computation time to around one-hundredth of the time required by Gaussian Process regression.

Datasets

The algorithm was evaluated using standard synthetic benchmark functions for binary optimization:

  • OneMax: Counts the number of ones in a binary string.
  • LeadingOnes: Counts the number of consecutive ones from the start of the string.
  • BinVal / Reversed BinVal: Interprets the binary string as a base-2 integer value.

The authors tested these on dimensions $d \in \{10, 25, 50\}$ under two distinct safety function configurations: Compatible (where maximizing the objective naturally moves the search toward safer regions) and Conflicting (where the global optimum lies dangerously close to the safety constraint boundary).

Key Insights and Ideas

  • GPs are a Bottleneck in Discrete Spaces: In continuous safe optimization, algorithms often discard older data to keep GPs computationally tractable. In binary spaces, however, the search distribution widely covers the space, making historical data crucial. Switching to Walsh function decompositions allows the algorithm to utilize all historical data while running up to 100x faster than GP-based alternatives (see Figure 1).
  • The Geometry of Tie-Breaking: In continuous spaces, projecting a point to a convex set yields a unique closest point. In binary spaces (hypercubes), a point can easily be equidistant to multiple safe points. Resolving this by selecting the point with the highest probabilistic likelihood under the current search distribution prevents the algorithm from stalling.
  • Safe Region Degeneration: If the estimated Lipschitz constant is too conservative (too large), the calculated safe region shrinks and cannot expand. The authors introduced a "degeneration handle" that caps the estimated Lipschitz constant based on the maximum safety value observed in a local archive, ensuring the safe region can safely expand.

Key Results

The proposed safe ASNG was compared against standard ASNG equipped with Violation Avoidance (ASNG w. VA) and standard ASNG with Constraint Handling (ASNG w. CH).

  • Safety Violation Suppression: In both compatible and conflicting experiments, the comparative methods routinely failed, quickly exhausting the maximum budget of 100 unsafe evaluations and terminating early. In contrast, safe ASNG consistently maintained zero or near-zero unsafe evaluations across almost all benchmarks.
  • Optimization Efficiency: Despite the strict safety constraints, safe ASNG successfully minimized the "best evaluation gap," successfully finding the global safe optimum in almost all 10- and 25-dimensional settings.
Experimental results under conflicting settings demonstrate that only Safe ASNG successfully suppresses unsafe evaluations while continuing to optimize the objective function.

Limitations and Future Work

While safe ASNG performed exceptionally well on OneMax and BinVal, its optimization rate slowed down on the LeadingOnes benchmark in higher dimensions ($d=50$), occasionally hitting the maximum iteration budget before finding the true optimum. The authors attribute this to conservative overestimations of the Lipschitz constants early in the search.

Future work will focus on:

  • Developing a secondary surrogate model for the objective function (not just the safety function) to accelerate convergence.
  • Extending the framework from pure binary spaces to broader discrete domains, such as integer and categorical variables.

Summary updated

BibTeX
@inproceedings{uchida2026adaptive,
  author = {Kento Uchida and Ryoki Hamano and Masahiro Nomura and Shinichi Shirakawa},
  title = {{Adaptive Stochastic Natural Gradient Method for Safe Optimization on Binary Space}},
  booktitle = {GECCO},
  year = {2026},
  doi = {10.1145/3795095.3805125},
}
Figure