Tuning Hyperparameters without Grad Students: Scalable and Robust Bayesian Optimisation with Dragonfly

Kirthevasan Kandasamy, Karun Raju Vysyaraju, Willie Neiswanger, Biswajit Paria, Christopher R. Collins, Jeff Schneider, Barnabás Póczos, Eric P. Xing

TL;DR

Dragonfly is an open-source Python library designed to break standard Bayesian Optimisation (BO) out of its low-dimensional, toy-problem cage. By uniting additive Gaussian process models, multi-fidelity approximations, optimal transport for neural network spaces, and an adaptive acquisition/hyperparameter sampling scheme, Dragonfly delivers scalable, robust black-box tuning across high-dimensional and non-Euclidean search spaces.

What Problem Does This Paper Address?

Bayesian Optimisation is the gold standard for tuning expensive black-box functions (e.g., machine learning hyperparameters, scientific simulations). By building a probabilistic surrogate—typically a Gaussian Process (GP)—BO strategically balances exploration and exploitation via an acquisition function.

However, conventional BO breaks down in real-world scenarios:

  • Curse of dimensionality: Standard GPs scale poorly beyond 10–20 dimensions, both statistically (data sparsity) and computationally (optimising the acquisition function over high-dimensional spaces becomes intractable).
  • Brittleness: Performance hinges heavily on choosing the right acquisition function (e.g., GP-UCB vs. Expected Improvement) and GP hyperparameter strategy (Maximum Likelihood vs. Posterior Sampling). A poor pick leads to stalling.
  • Complex, structured spaces: Real systems involve combinations of continuous, discrete, and structural search spaces (such as neural network architectures), often subject to complex constraints.
  • Ignoring cheaper approximations: Standard BO assumes queries are single-fidelity, neglecting cheap proxies (e.g., training a model on a subset of data or for fewer epochs).

Dragonfly addresses these limitations in a unified, open-source framework.

Methods

Dragonfly integrates several methodological advances to ensure scalability and robustness:

  1. Additive GP Models (High Dimensions): Dragonfly models high-dimensional functions as sums of lower-dimensional components: $$f(x) = f^{(1)}(x^{(1)}) + \dots + f^{(M)}(x^{(M)})$$ Through Add-GP-UCB, the acquisition function decomposes additively, reducing acquisition maximisation from exponential complexity $\mathcal{O}(\zeta^{-d})$ to linear in the number of groups $\mathcal{O}(M p \zeta^{-p})$. Group dimensionalities and partitionings are sampled and updated as kernel parameters.

  2. Adaptive Ensemble Strategies for Robustness:

  3. Dynamic Acquisition Selection: Instead of committing to one heuristic, Dragonfly dynamically samples from a pool (GP-UCB, GP-EI, TS, TTEI, and Add-GP-UCB) using a multi-armed bandit-style weighting update that rewards an acquisition whenever it finds a new global optimum.
  4. Hybrid Hyperparameter Tuning: Alternates between Maximum Likelihood (ML) estimation and Posterior Sampling (PS via slice/Metropolis-Hastings sampling) every $n_{cyc}=17$ iterations, adapting to whether the underlying function is smooth (where ML excels) or rugged (where PS avoids getting stuck).
  5. Multi-Fidelity Optimisation (BOCA): Utilises a product kernel $\kappa([z, x], [z', x']) = \kappa_0 \kappa_Z(z, z') \kappa_X(x, x')$, supporting continuous fidelities (e.g., dataset size, iterations). It incorporates specialized kernels like the exponential decay kernel for monotonic performance curves.

  6. Neural Architecture Search (NASBOT): Dragonfly employs the OTMANN (Optimal Transport Metrics for Architectures of Neural Networks) pseudo-distance to compute distances between graph-structured neural networks based on computational mass and layer operations, pairing it with evolutionary acquisition optimization.

  7. Asynchronous Parallelization & Constraints: Uses "hallucinated" observations (predicting mean evaluations at busy points) to shrink local variance and avoid redundant concurrent evaluations (except for Thompson Sampling, where intrinsic posterior sampling provides sufficient diversity without hallucination). Evolutionary algorithms with rejection sampling handle arbitrary user-defined Boolean constraints.

Datasets & Benchmarks

The paper evaluates Dragonfly across an extensive battery of benchmarks:

  • Synthetic Benchmarks: Standard test functions (Branin $d=2$, Hartmann3 $d=3$, Park1/2 $d=4$, Hartmann6 $d=6$, Borehole $d=8$) expanded additively up to 108 dimensions (e.g., Hartmann3x6, Borehole-x12, Park1x27), alongside constrained, non-Euclidean, and noisy variants.
  • Astrophysics Maximum Likelihood Inference:
  • Luminous Red Galaxies (LRGs): 9 cosmological parameters inferred from galaxy power spectra.
  • Type Ia Supernova: 3 cosmological parameters with a 2D fidelity space (dataset size $N \in [50, 192]$ and numerical integration grid $G \in [10^2, 10^6]$).
  • Model Selection & Regression Tuning:
  • Random Forest Regression on Online News Popularity (6 parameters; data subset fidelity).
  • Gradient Boosted Regression on Naval Propulsion (7 parameters; data subset fidelity).
  • SALSA Regression on Energy Appliances (30 parameters; cubic cost fidelity).
  • Neural Architecture Search: Blog Feedback, Indoor Localization (UJIIndoorLoc), and CT Slice Localization datasets, constrained up to 60 layers and $10^8$ mass.

Key Insights and Ideas

  • Bandit-Style Adaptation Outperforms Fixed Choices: No single acquisition rule or hyperparameter fitting strategy consistently wins. Adaptively sampling acquisitions and switching between ML and posterior sampling prevents catastrophic stalling at a fraction of the cost of full MCMC marginalization.
  • Thompson Sampling Natively Parallelizes: While acquisition rules like UCB or EI require "fantasies/hallucinations" to ensure parallel workers don't evaluate the same point, Thompson Sampling’s inherent stochasticity naturally provides the diversity required for parallel batching.
  • Low-Fidelity Evaluations Can Beat Full Optimization: On problems like Naval Propulsion GBR, low-fidelity tuning achieved better final performance under fixed wall-clock limits than full-fidelity tuning because it explored the parameter space significantly faster.

Key Results

  • Synthetic Regret Benchmarks: Dragonfly placed 1st in 8 out of 15 Euclidean benchmarks and 5 out of 8 non-Euclidean benchmarks (Table 1), outranking Spearmint, GPyOpt, SMAC, HyperOpt, and PDOO. In dimensions $d \ge 40$, SMAC's initialization failed and Spearmint became computationally prohibitive, whereas Dragonfly scaled cleanly to $d=108$.
  • Astrophysics & Model Selection: Dragonfly+MF (multi-fidelity) reached lower validation errors faster across wall-clock time budgets. In the Naval Propulsion benchmark, Dragonfly+MF achieved a final error of $3.00 \times 10^{-5}$ compared to SMAC's $1.97 \times 10^{-5}$ and standard Dragonfly's $5.82 \times 10^{-5}$, while easily outperforming Hyperband ($1.13 \times 10^{-5}$ vs Dragonfly at lowest fidelity: $1.14 \times 10^{-5}$).
  • NAS Performance: On all three architecture search tasks, Dragonfly systematically reached lower validation errors faster than vanilla NASBOT over an 8-hour budget on 2 GPUs.

Limitations and Future Work

  • Rejection Sampling Bottleneck: Optimising the acquisition function under constraints relies on rejection sampling via evolutionary mutations; if the feasible domain is an extremely small subset of the bounding space, acquisition optimization slows down significantly.
  • Overhead in Modest Regimes: When surrogate modeling is challenging across joint domain-fidelity spaces, multi-fidelity gains can be modest or spend too much capital in low-fidelity phases before discovering the optimum.
  • Future Directions: The authors plan to extend Dragonfly to multi-objective optimization (using random scalarizations) and integrate probabilistic programming frameworks (ProBO) for custom model architectures.

Summary updated

BibTeX
@article{kandasamy2020tuning,
  author = {Kirthevasan Kandasamy and Karun Raju Vysyaraju and Willie Neiswanger and Biswajit Paria and Christopher R. Collins and Jeff Schneider and Barnabás Póczos and Eric P. Xing},
  title = {{Tuning Hyperparameters without Grad Students: Scalable and Robust Bayesian Optimisation with Dragonfly}},
  journal = {J. Mach. Learn. Res.},
  year = {2020},
  url = {https://openreview.net/forum?id=M5PU8XIf5Eu},
}
Figure