Bayesian Optimization for Categorical and Category-Specific Continuous Inputs

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

Abstract

Traditional Bayesian Optimization (BO) methods are primarily designed for continuous search spaces, often struggling with the discrete and conditional structures common in Automated Machine Learning (AutoML). We introduce Bandit-BO, a framework that models categorical variables as arms in a multi-armed bandit problem while utilizing independent Gaussian Processes (GPs) to optimize category-specific continuous parameters. By leveraging Thompson Sampling to unify these components, Bandit-BO provides a theoretically grounded approach with guaranteed sub-linear regret. Empirical evaluations across synthetic functions and 30 OpenML datasets demonstrate that Bandit-BO consistently outperforms industry-standard tools like Auto-sklearn and TPOT, achieving superior accuracy in over 92% of tested scenarios.

1. Introduction

Many high-impact optimization problems, particularly in AutoML, involve a complex interplay between categorical choices (e.g., selecting a model type like SVM or Random Forest) and continuous hyperparameters that are specific to those choices. This "conditional" parameter problem poses two main challenges: the lack of natural ordering in categorical inputs and the fact that hyperparameters for one category (e.g., SVM kernel width) are meaningless for another (e.g., Random Forest tree depth).

Existing approaches often rely on heuristics, such as one-hot encoding or tree-based Parzen windows, which can introduce artificial correlations or lack the sample efficiency and convergence guarantees of GP-based BO. Bandit-BO addresses these limitations by treating the categorical selection as a Multi-Armed Bandit (MAB) problem.

2. Methodology: The Bandit-BO Framework

Bandit-BO formulates the optimization task as a MAB where each category represents an "arm." The reward for pulling an arm is defined as the maximum value of the objective function within that category's unique continuous search space.

2.1 Independent Gaussian Processes

To handle category-specific variables effectively, Bandit-BO maintains a separate GP for each category. This independence ensures that the model for one algorithm (e.g., SVM) is not biased by data from a fundamentally different one (e.g., Neural Networks), avoiding the dimensionality and correlation issues inherent in one-hot encoding.

2.2 Unified Thompson Sampling

The framework uses Thompson Sampling (TS) to bridge the discrete "arm selection" and continuous "parameter optimization" steps. In each iteration, the algorithm draws a random function sample from the posterior GP of every category, identifies the maximum value of each sampled function, and selects the category and specific continuous point that yielded the highest sampled maximum.

Evolution of Gaussian Process posteriors and maximum value distributions for two categories at iterations $t=4$ and $t=15$.

As shown in the figure above, the GPs for different categories ($f_0$ and $f_1$) evolve as more observations are collected. By iteration $t=15$, the predictive mean closely tracks the true function, and the distribution of the estimated maximum ($f^*$) becomes significantly more peaked around the true value, demonstrating the model's convergence.

2.3 Theoretical Guarantees and Batching

A key contribution of this work is the rigorous proof that Bandit-BO achieves sub-linear regret, ensuring convergence to the global optimum over time. Additionally, the method is extended to batch settings, allowing for parallel evaluations by drawing multiple independent Thompson samples in a single round.

3. Experimental Evaluation

The authors evaluated Bandit-BO against several baselines, including SMAC, TPE, and standard one-hot encoding methods, across three distinct scenarios:

  • Synthetic Benchmarks: A 5-dimensional Ackley function modified to test scalability up to 100 categories.
  • Neural Network Tuning: Optimizing 8 hyperparameters (4 categorical, 4 continuous) for regression on the UCI Protein Structure dataset.
  • AutoML Benchmarking: A comprehensive study involving 30 datasets from OpenML, comparing Bandit-BO against industry-standard tools like Hyperopt-sklearn, Auto-sklearn, and TPOT.

4. Results and Discussion

Bandit-BO demonstrated significant performance gains over state-of-the-art frameworks:

  • AutoML Performance: Bandit-BO achieved the highest classification accuracy on 92.25% of the 30 benchmark datasets. On specific datasets like electricity and phoneme, it outperformed Auto-sklearn and TPOT by 4-9%.
  • Efficiency: In neural network tuning, Bandit-BO reached lower Mean Squared Error (MSE) faster than competitors in both sequential and batch configurations.
  • Scalability: Unlike some existing methods that degrade as the number of categories increases, Bandit-BO remained robust even with 100 distinct categories, highlighting the strength of the independent GP approach.

5. Conclusion and Future Work

Bandit-BO provides a robust, theoretically sound solution for optimization in hybrid search spaces. By treating categories as bandit arms and using independent GPs, it avoids the pitfalls of traditional encoding methods.

Future research directions include addressing the $O(n^3)$ computational scaling of Gaussian Processes as evaluation counts grow. Furthermore, while independence is currently a strength, incorporating Multi-Task Gaussian Processes (MTGP) could allow the model to exploit correlations between related categories to further improve sample efficiency.

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