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

Bayesian Optimization with Gradients

Jian Wu, Matthias Poloczek, Andrew Gordon Wilson, Peter I. Frazier

Bayesian Optimization (BO) is widely considered the gold standard for optimizing "expensive" black-box functions, such as tuning hyperparameters for deep neural networks where a single evaluation can take hours or days. Traditionally, BO is "derivative-free," meaning it only observes the output value of a function at a given point.

However, in modern machine learning workflows—thanks to automatic differentiation in frameworks like PyTorch and TensorFlow—gradient information is often available at little to no extra computational cost. Ignoring these gradients leaves valuable information on the table. This paper introduces the derivative-enabled Knowledge Gradient ($d$-KG), a novel Bayesian optimization algorithm designed to leverage gradient information to find global optima significantly faster.

The Problem: Ignoring Available Gradients

While some previous attempts have been made to incorporate derivatives into Bayesian Optimization, they have historically struggled with noisy data, batch evaluations, or the sheer computational cost of updating a Gaussian Process (GP) with $d$ extra dimensions of information. Standard gradient-based optimizers (like L-BFGS) are fast but notoriously prone to getting trapped in local optima. The challenge is to combine the global search capabilities of BO with the local efficiency of gradient-based methods, without being bottlenecked by computational overhead.

Methodology: The $d$-KG Algorithm

The authors propose $d$-KG to address these challenges through several core innovations:

  • Gaussian Processes with Derivatives: The objective function and its gradient are modeled jointly as a multi-output Gaussian Process. Because the gradient is a linear operator, the derivative of a GP remains a GP, allowing for a mathematically principled Bayesian framework.
  • The $d$-KG Acquisition Function: Unlike the popular "Expected Improvement" (EI) metric, which looks for points that might simply beat the current best observation, $d$-KG calculates the "Value of Information." It selects the next point to sample by estimating how much the expected value of the global optimum will improve after seeing the new data and its gradients.
Comparison of standard and derivative-enabled acquisition functions
  • Discretization-Free Optimization: A major technical hurdle for Knowledge Gradient methods is their reliance on discretizing the search space, which scales poorly in higher dimensions. The authors bypass this using a "discretization-free" technique based on the envelope theorem. This allows them to compute the gradient of the acquisition function itself and use standard gradient ascent to find the optimal next sample point.
  • Relevant Directional Derivatives: To combat the massive $O(n^3 d^3)$ computational complexity typically associated with derivative-enabled GPs, $d$-KG can be configured to retain only the single most "valuable" directional derivative at each step, rather than the full gradient vector.

Key Insights

The inclusion of gradients acts as a massive information multiplier. In a $d$-dimensional problem, a single query that includes a gradient provides $d+1$ pieces of information. This advantage becomes increasingly critical in high-dimensional spaces. Furthermore, $d$-KG is mathematically constructed to be "one-step Bayes-optimal"—meaning it is the provably optimal choice if you only had one function evaluation left. The framework is also highly flexible, capable of handling noisy gradients or scenarios where gradients are only available for a subset of the input variables.

Experimental Results

The authors rigorously evaluated $d$-KG against a battery of synthetic benchmarks (Branin, Rosenbrock, Ackley, Hartmann, Levy, and Cosine mixture) and real-world machine learning tuning tasks, including k-Nearest Neighbors, Spectral Mixture Kernels, and Deep Learning architectures.

Benchmark results across various synthetic functions

Across the board, $d$-KG demonstrated superior efficiency. On complex landscapes like the Hartmann 6d function, $d$-KG found the optimum in significantly fewer evaluations than standard EI or UCB. When compared to L-BFGS-B on the Branin and Ackley benchmarks, $d$-KG consistently found better global solutions, avoiding the local minima that trapped the standard gradient method. In deep learning tasks, $d$-KG outperformed other BO methods, proving that the gradient of the validation loss is a highly powerful signal for optimization. Notably, the algorithm remained robust even when gradient observations were injected with significant noise.

Limitations and Future Directions

Despite its strong performance, $d$-KG is not without limitations. Even with directional derivative selection, the internal cost of GP inference grows cubically with the number of observations. For very high-dimensional problems or optimization runs requiring thousands of iterations, this computational overhead becomes significant.

Future work will likely focus on scaling $d$-KG to larger datasets by combining it with scalable GP approximations (such as KISS-GP). Additionally, while the algorithm performs exceptionally well in continuous spaces in practice, expanding its theoretical consistency guarantees—currently proven primarily for finite feasible sets—remains an open direction for research.

Summary updated

BibTeX
@inproceedings{wu2017bayesian,
  author = {Jian Wu and Matthias Poloczek and Andrew Gordon Wilson and Peter I. Frazier},
  title = {{Bayesian Optimization with Gradients}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
}
Figure