NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Cost-aware Bayesian Optimization

Eric Hans Lee, Valerio Perrone, Cédric Archambeau, Matthias W. SeegerarXiv 2020

Abstract

Bayesian optimization (BO) is a class of global optimization algorithms, suitable for minimizing an expensive objective function in as few function evaluations as possible. While BO budgets are typically given in iterations, this implicitly measures convergence in terms of iteration count and assumes each evaluation has identical cost. In practice, evaluation costs may vary in different regions of the search space. For example, the cost of neural network training increases quadratically with layer size, which is a typical hyperparameter. Cost-aware BO measures convergence with alternative cost metrics such as time, energy, or money, for which vanilla BO methods are unsuited. We introduce Cost Apportioned BO (CArBO), which attempts to minimize an objective function in as little cost as possible. CArBO combines a cost-effective initial design with a cost-cooled optimization phase which depreciates a learned cost model as iterations proceed. On a set of 20 black-box function optimization problems we show that, given the same cost budget, CArBO finds significantly better hyperparameter configurations than competing methods.

Introduction

Standard Bayesian Optimization (BO) frameworks typically measure progress by the number of iterations, implicitly assuming that every function evaluation carries the same cost. However, in real-world applications such as hyperparameter optimization (HPO), this assumption rarely holds. Training a complex model with many layers or large datasets is significantly more expensive than training a simpler one.

Evaluation time distribution for a Decision Tree model on the w2a dataset, illustrating the non-uniform nature of costs in hyperparameter optimization.

Existing cost-aware methods often utilize Expected Improvement per unit cost (EIpu), which normalizes improvement by predicted cost. While intuitive, this greedy approach can lead to the "EIpu Trap": if the global optimum resides in an expensive region of the search space, EIpu will actively avoid it, remaining stuck in "cheap" but suboptimal areas. The challenge lies in creating an optimizer that is frugal early on but willing to invest its budget in high-quality candidates as the search progresses.

Methods: Cost Apportioned BO (CArBO)

CArBO addresses the limitations of static cost-awareness through two primary pillars:

  1. Cost-effective Initial Design: Rather than using standard space-filling designs like Latin Hypercube Sampling, CArBO solves a sub-optimization problem to select an initial set of points that are well-distributed yet minimize cost. This builds an informative surrogate model without prematurely exhausting the budget.
  2. Cost-cooling Acquisition Function: CArBO introduces a dynamic acquisition function: $$\text{EI-cool}(x) := \frac{EI(x)}{c(x)^\alpha}$$ where $c(x)$ is the predicted cost and $\alpha$ is a "cooling" parameter that decays from 1 to 0 as the budget is consumed. Early in the optimization ($\alpha \approx 1$), the algorithm prioritizes cheap evaluations similar to EIpu. As the budget depletes ($\alpha \approx 0$), it transitions to standard EI, focusing purely on finding the global optimum regardless of cost.

Experimental Evaluation

The researchers evaluated CArBO on 20 real-world HPO benchmarks involving five popular scikit-learn models: K-nearest neighbors (KNN), Multi-layer Perceptron (MLP), Support Vector Machine (SVM), Decision Tree (DT), and Random Forest (RF). These models were trained on four classification datasets from the UCI repository (splice, a1a, a3a, and w2a). Additionally, testing was extended to a Convolutional Neural Network (CNN) on the MNIST dataset to evaluate more complex cost surrogates.

Results and Discussion

Across the 20 benchmarks, CArBO achieved a net cost saving of approximately 40% compared to the next best optimizer. It consistently converged to better hyperparameter configurations faster than Random Search, standard EI, and EIpu.

Comparison of EI and EIpu. The histogram shows EIpu (green) evaluating significantly more cheap points, while the performance plot demonstrates that this greedy strategy results in higher classification error over wall-clock time compared to standard EI (red).

Key insights from the study include:

  • The Necessity of Scheduling: CArBO succeeds by scheduling evaluations rather than just normalizing for cost. Front-loading cheap evaluations builds a surrogate model that makes subsequent expensive evaluations more likely to succeed.
  • Flop-counting as a Prior: Standard Gaussian Processes often struggle to predict costs in unexplored regions. Using a simple linear model based on floating-point operations (flops) as a cost surrogate significantly improved performance over standard black-box models.
  • Scalability: CArBO maintains its cost-efficiency in batch settings, scaling linearly up to a batch size of 16.

Conclusion and Future Work

CArBO provides a robust framework for cost-aware optimization, significantly reducing the resources required for HPO. Future research directions include adapting the algorithm for variable batch sizes in elastic cloud environments and developing more principled methods for determining the initial design budget. Additionally, creating low-variance cost models for more exotic black-box functions remains an open challenge.

Summary updated

BibTeX
@misc{lee2020cost,
  author = {Eric Hans Lee and Valerio Perrone and Cédric Archambeau and Matthias W. Seeger},
  title = {{Cost-aware Bayesian Optimization}},
  year = {2020},
  eprint = {2003.10870},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.10870},
}
Figure