Bayesian Optimization for Categorical and Category-Specific Continuous Inputs

Dang Nguyen, Sunil Gupta, Santu Rana, Alistair Shilton, Svetha Venkatesh

Abstract

Traditional Bayesian Optimization (BO) often struggles with categorical variables, particularly when continuous hyperparameters are specific to each category. This paper presents Bandit-BO, a novel framework that treats categorical variables as "arms" in a multi-armed bandit problem while utilizing Gaussian Processes (GPs) to optimize category-specific continuous parameters. By employing Thompson Sampling as a unified selection mechanism, Bandit-BO provides a theoretically grounded approach to disjoint search spaces. Empirical evaluations on synthetic functions and large-scale AutoML benchmarks demonstrate that Bandit-BO consistently outperforms state-of-the-art methods, achieving higher accuracy and faster convergence.

Introduction

Bayesian Optimization is a standard technique for optimizing expensive black-box functions. However, its application to categorical inputs remains a challenge. Common practices like one-hot encoding often introduce artificial correlations and increase dimensionality, which can degrade performance. A more complex scenario arises in Automated Machine Learning (AutoML), where the choice of a model (e.g., SVM vs. Random Forest) dictates a unique, non-overlapping set of continuous hyperparameters. Existing GP-based methods are typically ill-equipped to handle these disjoint search spaces effectively.

Methodology: The Bandit-BO Framework

The proposed Bandit-BO framework addresses these challenges by merging Multi-Armed Bandits (MAB) with BO. The core idea is to treat each category as an independent arm.

Categorical Selection and Continuous Optimization

For each category $c$, an independent Gaussian Process $f_c(x)$ is fitted to model the objective function within its specific continuous domain. The "reward" for selecting a particular arm is defined as the maximum value achievable within that category's continuous space.

Unified Thompson Sampling

The algorithm utilizes Thompson Sampling (TS) to bridge the gap between categorical selection and continuous optimization. At each iteration, a random function is drawn from the posterior distribution of every category's GP. The algorithm then identifies the global maximum across all samples, which simultaneously determines the optimal category to explore and the specific continuous point to evaluate.

Evolution of Gaussian Process models and the distribution of the maximum value $f^*$ for two categories at iterations $t=4$ and $t=15$.

As shown in the figure above, the algorithm refines its predictive mean and confidence intervals over time. By iteration $t=15$, the distributions of the estimated maximums ($f_0^*$ and $f_1^*$) become significantly more peaked around the true values, facilitating more efficient exploitation.

Experimental Evaluation

The authors evaluated Bandit-BO across three primary scenarios:

  1. Synthetic Functions: A 5D Ackley function modified to include categorical shifts.
  2. Hyperparameter Tuning: Optimizing a feed-forward neural network on the UCI Protein Structure dataset.
  3. AutoML Benchmarks: A comprehensive evaluation across 30 OpenML datasets, involving the selection and tuning of 14 different classifiers.

Key Results and Insights

Bandit-BO demonstrated significant improvements over baselines such as SMAC, TPE, and standard one-hot encoded BO.

  • AutoML Performance: In the 30-dataset challenge, Bandit-BO achieved an average accuracy of 92.25%, surpassing established tools like Auto-sklearn (91.82%) and TPOT (91.77%).
  • Small Dataset Advantage: The most notable gains (4% to 9% accuracy increases) were observed on smaller datasets, where efficient exploration is critical.
  • Theoretical Convergence: The authors proved that Bandit-BO achieves sub-linear regret, ensuring global convergence. The complexity scales sub-linearly with the number of categories ($\sqrt{C}$), making it suitable for high-dimensional discrete spaces.

Conclusion and Future Work

Bandit-BO provides a robust, principled solution for optimization problems involving hybrid categorical and continuous inputs. By avoiding "fake" correlations between categories and leveraging the exploration-exploitation balance of Thompson Sampling, it sets a new benchmark for AutoML tasks. Future research directions include incorporating Multi-Task Gaussian Processes (MTGP) to share information between similar categories and extending the framework to handle nested hierarchical search spaces.

Summary updated

BibTeX
@inproceedings{nguyen2020bayesian,
  author = {Dang Nguyen and Sunil Gupta and Santu Rana and Alistair Shilton and Svetha Venkatesh},
  title = {{Bayesian Optimization for Categorical and Category-Specific Continuous Inputs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5971},
}
Figure