Tuning hyperparameters (like learning rate, dropout, or layer depth) is fundamentally a non-convex, derivative-free optimization problem. Evaluating the "loss function" requires training the entire model, which is computationally expensive. Bayesian Optimization solves this by building a probabilistic surrogate model of the objective function.
Bayesian optimization treats hyperparameter tuning as a sequence of decisions driven by Bayesian Inference.
Instead of evaluating the true objective function f(x) blindly, the algorithm builds a surrogate model (a probabilistic approximation). The most common surrogate is a Gaussian Process (GP), which provides not just a prediction for the loss at point x, but a confidence interval (uncertainty).
The algorithm uses an Acquisition Function (like Expected Improvement (EI) or Upper Confidence Bound (UCB)) to decide where to sample next. This function explicitly balances:
While Gaussian Processes work well for continuous variables, they struggle with categorical or conditional hyperparameters (e.g., "If optimizer=Adam, then tune beta1; else..."). Modern frameworks like Optuna and Hyperopt use TPE. Instead of modeling P(y|x) (probability of loss given parameters), TPE models P(x|y) and P(y). It divides past trials into "good" and "bad" groups and builds two separate distributions, sampling new points from the "good" distribution.
See Also: