In the idealized world of Bayesian Optimization (BO), every set of hyperparameters you test returns a score. You suggest a learning rate or a batch size, the system runs, and it returns a validation loss or a throughput number. The optimizer then uses this "black box" feedback to suggest the next, hopefully better, configuration.
In the real world, the black box often explodes.
When tuning Large Language Model (LLM) inference engines or training massive neural networks, many configurations don't return a score at all—they return an Out-of-Memory (OOM) error, a system timeout, or a catastrophic divergence. Traditional optimization algorithms treat these failures as missing data, effectively throwing away the most expensive lesson the system can teach: where the boundaries of stability lie.
A growing body of research suggests that we should treat system failures not as wasted compute, but as informative constraints. By explicitly modeling the "probability of failure," we can navigate the search space more safely and efficiently.
The Problem of Hidden Constraints
Most optimization tasks assume the search space is a smooth landscape. However, systems like LLM inference engines (e.g., vLLM or TensorRT-LLM) are governed by "hidden constraints"—complex interactions between hardware memory, scheduling factors, and request patterns.
As Ke Cheng and Zhi Wang point out in SCOOT: SLO-Oriented Performance Tuning for LLM Inference Engines, these constraints are often non-linear and invisible to the user until the system crashes. If an optimizer ignores these crashes, it will repeatedly "stub its toe" on the same unstable regions, wasting precious GPU hours on configurations that were never going to finish.
Mechanism 1: The Feasibility Classifier
The most direct way to handle this is to turn the optimization into a two-part problem. Instead of just predicting performance, the system also predicts feasibility.
In the SCOOT framework, Ke Cheng and colleagues combine Bayesian Optimization with a Random Forest-based constraint learner. While the BO surrogate model tries to find the highest throughput, the Random Forest acts as a gatekeeper. It learns the probability that a specific parameter configuration will lead to a crash or a timeout. Before the system evaluates a new point, it checks with the classifier; if the predicted probability of failure is too high, the optimizer skips that point entirely.
Similarly, in Tune As You Scale: Hyperparameter Optimization For Compute Efficient Training, Abraham J. Fetterman and Joshua Albrecht use a dedicated surrogate model to predict OOM errors. By navigating around these "failure zones," the optimizer can focus its compute on the "sweet spot" where the model is both stable and high-performing.
Mechanism 2: Virtual Observations and Floor Padding
Sometimes, you don't want a separate classifier; you want the failure to inform the main optimization model directly. This is particularly useful in physical systems, like robotics or materials science, where a "crash" is a literal event.
In Local Bayesian optimization for controller tuning with crash constraints, Alexander von Rohr and Sebastian Trimpe treat system failures as "informative virtual observations." Instead of leaving a hole in the data, they tell the optimizer that the crashed configuration resulted in the worst possible outcome.
This is echoed in the work of Yuki K. Wakabayashi in Bayesian optimization with experimental failure for high-throughput materials growth. They use a "floor padding" trick: when an experiment fails to produce a material sample, they adaptively replace that failure with the worst observed result. This forces the surrogate model to "bend" its predictions downward in that region, effectively mapping out "forbidden zones" in the parameter space.
Why It Works: Mapping the Boundaries
The intuition behind these approaches is that the boundary of failure is often where the highest performance lives.
In LLM inference, the highest throughput usually occurs just before the GPU runs out of memory. In stochastic gradient descent, the fastest convergence often happens just before the learning rate becomes high enough to cause divergence, a problem addressed by Vincent Dutordoir and Victor Picheny in Automatic Tuning of Stochastic Gradient Descent with Bayesian Optimisation.
By explicitly modeling failures, these systems can "skirt the edge" of the cliff without falling off. Instead of treating a crash as a total loss, the optimizer uses it to define the shape of the feasible world. As René Sass and Marius Lindauer demonstrate with DeepCAVE, visualizing these failed trials in real-time allows researchers to prune problematic hyperparameter ranges manually or automatically, turning what used to be "wasted" time into a map for future success.