Predictive Entropy Search for Efficient Global Optimization of Black-box Functions
José Miguel Hernández-Lobato, Matthew W. Hoffman, Zoubin Ghahramani
Introduction
Bayesian optimization techniques form a successful approach for optimizing black-box functions . The goal of these methods is to find the global maximizer of a nonlinear and generally non-convex function whose derivatives are unavailable. Furthermore, the evaluations of are usually corrupted by noise and the process that queries can be computationally or economically very expensive. To address these challenges, Bayesian optimization devotes additional effort to modeling the unknown function and its behavior. These additional computations aim to minimize the number of evaluations that are needed to find the global optima.
Optimization problems are widespread in science and engineering and as a result so are Bayesian approaches to this problem. Bayesian optimization has successfully been used in robotics to adjust the parameters of a robot’s controller to maximize gait speed and smoothness as well as parameter tuning for computer graphics . Another example application in drug discovery is to find the chemical derivative of a particular molecule that best treats a given disease . Finally, Bayesian optimization can also be used to find optimal hyper-parameter values for statistical and machine learning techniques .
We take a Bayesian approach to the problem described above and use a probabilistic model for the latent function to guide the search and to select . In this work we use a zero-mean Gaussian process (GP) prior for . This prior is specified by a positive-definite kernel function . Given any finite collection of points , the values of at these points are jointly zero-mean Gaussian with covariance matrix , where . For the Gaussian likelihood described above, the vector of concatenated observations is also jointly Gaussian with zero-mean. Therefore, at any location , the latent function conditioned on past observations is then Gaussian with marginal mean and variance given by
where is a vector of cross-covariance terms between and .
Bayesian optimization techniques use the above predictive distribution to guide the search for the global maximizer . In particular, is used during the computation of an acquisition function that is optimized at each iteration to determine the next evaluation location . This process is shown in Algorithm 1. Intuitively, the acquisition function should be high in areas where the maxima is most likely to lie given the current data. However, should also encourage exploration of the search space to guarantee that the recommendation is a global optimum of , not just a global optimum of the posterior mean. Several acquisition functions have been proposed in the literature. Some examples are the probability of improvement , the expected improvement or upper confidence bounds . Alternatively, one can combine several of these acquisition functions .
The acquisition functions described above are based on optimistic estimates of the latent function which implicitly trade off between exploiting the posterior mean and exploring based on the uncertainty. We instead follow the approach described in and aim to maximize the expected gain of information on the posterior distribution of the global maximizer . In Section 2 we derive a rearrangement of this acquisition function and a corresponding approximation that we call Predictive Entropy Search (PES). PES is more accurate than the approximation used in . In Section 3 we empirically evaluate this claim on both synthetic and real-world problems and show that this leads to real gains in performance.
Predictive entropy search
We propose to follow the information-theoretic method for active data collection described in . We are interested in maximizing information about the location of the global maximum, whose posterior distribution is . Our current information about can be measured in terms of the negative differential entropy of . Therefore, our strategy is to select which maximizes the expected reduction in this quantity. The corresponding acquisition function is
where is the posterior predictive distribution for given the observed data and the location of the global maximizer of . Intuitively, conditioning on the location pushes the posterior predictions up in locations around and down in regions away from . Note that, unlike the previous formulation, this objective is based on the entropies of predictive distributions, which are analytic or can be easily approximated, rather than on the entropies of distributions on whose approximation is more challenging.
In this section we show how to approximately sample from the conditional distribution of the global maximizer given the observed data , that is,
Given a shift-invariant kernel , Bochner’s theorem asserts the existence of its Fourier dual , which is equal to the spectral density of . Letting be the associated normalized density, we can write the kernel as the expectation
where . Let denote an -dimensional feature mapping where and consist of stacked samples from . The kernel can then be approximated by the inner product of these features, . This approach was used by as an approximation method in the context of kernel methods. The feature mapping allows us to approximate the Gaussian process prior for with a linear model where is a standard Gaussian. By conditioning on , the posterior for is also multivariate Gaussian, where and .
Let and be a random set of features and the corresponding posterior weights sampled both according to the generative process given above. They can then be used to construct the function , which is an approximate posterior sample of —albeit one with a finite parameterization. We can then maximize this function to obtain , which is approximately distributed according to . Note that for early iterations when , we can efficiently sample with cost using the method described in Appendix B.2 of . This allows us to use a large number of features in .
2 Approximating the predictive entropy
is smaller than . This simplified constraint only conditions on the given rather than requiring for all .
We incorporate these simplified constraints into to approximate . This is achieved by multiplying with specific factors that encode the above constraints. In what follows we briefly show how to construct these factors; more detail is given in Appendix B.
Implicitly we are assuming above that depends on our observations and constraint C1.1, but is independent of C1.2 and C2 given . The computations necessary to obtain and are similar to those used above and in (1). The required quantities are similar to the ones used by EP to make predictions in the Gaussian process binary classifier . We can then incorporate C3 by multiplying with a factor that guarantees . The predictive distribution for given and all the constraints can be approximated as
where is a normalization constant. The variance of the right hand size of (8) is given by
3 Hyperparameter learning and the PES acquisition function
We now show how the previous approximations are integrated to compute the acquisition function used by predictive entropy search (PES). This acquisition function performs a formal treatment of the hyperparameters. Let denote a vector of hyperparameters which includes any kernel parameters as well as the noise variance . Let denote the posterior distribution over these parameters where is a hyperprior and is the GP marginal likelihood. For a fully Bayesian treatment of we must marginalize the acquisition function (3) with respect to this posterior. The corresponding integral has no analytic expression and must be approximated using Monte Carlo. This approach is also taken in .
We draw samples from using slice sampling . Let denote a sampled global maximizer drawn from as described in Section 2.1. Furthermore, let and denote the predictive variances computed as described in Section 2.2 when the model hyperparameters are fixed to . We then write the marginalized acquisition function as
Note that PES is effectively marginalizing the original acquisition function (2) over . This is a significant advantage with respect to other methods that optimize the same information-theoretic acquisition function but do not marginalize over the hyper-parameters. For example, the approach of approximates (2) only for fixed . The resulting approximation is computationally very expensive and recomputing it to average over multiple samples from is infeasible in practice.
Experiments
Figure 1 shows the objective functions produced by RS, ES and PES for a particular with 10 measurements whose locations are selected uniformly at random in . The locations of the collected measurements are displayed with an “x” in the plots. The particular objective function used to generate the measurements in is displayed in the left part of Figure 2. The plots in Figure 1 show that the PES approximation to (2) is more similar to the ground truth given by RS than the approximation produced by ES. In this figure we also see a discrepancy between RS and PES at locations near . This difference is an artifact of the discretization used in RS. By zooming in and drawing many more samples we would see the same behavior in both plots.
In these experiments we compared the performance of PES with that of ES and expected improvement (EI) , a widely used acquisition function in the Bayesian optimization literature. We again assume that the optimal hyper-parameter values are known to all methods. Predictive performance is then measured in terms of the immediate regret (IR) , where is the known location of the global maximum and is the recommendation of each algorithm had we stopped at step —for all methods this is given by the maximizer of the posterior mean. The right plot in Figure 2 shows the decimal logarithm of the median of the IR obtained by each method across the 1000 different objective functions. Confidence bands equal to one standard deviation are obtained using the bootstrap method. Note that while averaging these results is also interesting, corresponding to the expected performance averaged over the prior, here we report the median IR because the empirical distribution of IR values is very heavy-tailed. In this case, the median is more representative of the exact location of the bulk of the data. These results indicate that the best method in this setting is PES, which significantly outperforms ES and EI. The plot also shows that in this case ES is significantly better than EI.
We perform another series of experiments in which we optimize well-known synthetic benchmark functions including a mixture of cosines and Branin-Hoo (both functions defined in ) as well as the Hartmann-6 (defined in ) . In all instances, we fix the measurement noise to . For both PES and EI we marginalize the hyperparameters using the approach described in Section 2.3. ES, by contrast, cannot average its approximation of (2) over the posterior on . Instead, ES works by fixing to an estimate of its posterior mean (obtained using slice sampling) . To evaluate the gains produced by the fully Bayesian treatment of in PES, we also compare with a version of PES (PES-NB) which performs the same non-Bayesian (NB) treatment of as ES. In PES-NB we use a single fixed hyperparameter as in previous sections with value given by the posterior mean of . All the methods are initialized with three random measurements collected using latin hypercube sampling .
The plots in Figure 3 show the median IR obtained by each method on each function across 250 random initializations. Overall, PES is better than PES-NB and ES. Furthermore, PES-NB is also significantly better than ES in most of the cases. These results show that the fully Bayesian treatment of in PES is advantageous and that PES can produce better approximations than ES. Note that PES performs better than EI in the Branin and cosines functions, while EI is significantly better on the Hartmann problem. This appears to be due to the fact that entropy-based strategies explore more aggressively which in higher-dimensional spaces takes more iterations. The Hartmann problem, however, is a relatively simple problem and as a result the comparatively more greedy behavior of EI does not result in significant adverse consequences. Note that the synthetic functions optimized in the previous experiment were much more multimodal that the ones considered here.
We finally optimize different real-world cost functions. The first one (NNet) returns the predictive accuracy of a neural network on a random train/test partition of the Boston Housing dataset . The variables to optimize are the weight-decay parameter and the number of training iterations for the neural network. The second function (Hydrogen) returns the amount of hydrogen production of a particular bacteria in terms of the PH and Nitrogen levels of the growth medium . The third one (Portfolio) returns the ratio of the mean and the standard deviation (the Sharpe ratio) of the 1-year ahead returns generated by simulations from a multivariate time-series model that is adjusted to the daily returns of stocks AXP, BA and HD. The time-series model is formed by univariate GARCH models connected with a Student’s copula . These three functions (NNet, Hydrogen and Portfolio) have as domain . Furthermore, in these examples, the ground truth function that we want to optimize is unknown and is only available through noisy measurements. To obtain a ground truth, we approximate each cost function as the predictive distribution of a GP that is adjusted to data sampled from the original function (1000 uniform samples for NNet and Portfolio and all the available data for Hydrogen ). Finally, we also consider another real-world function that returns the walking speed of a bipedal robot . This function is defined in and its inputs are the parameters of the robot’s controller. In this case the ground truth function is noiseless and can be exactly evaluated through expensive numerical simulation. We consider two versions of this problem (Walker A) with zero-mean, additive noise of and (Walker B) with .
Figure 4 shows the median IR values obtained by each method on each function across 250 random initializations, except in Hydrogen where we used 500 due to its higher level of noise. Overall, PES, ES and PES-NB perform similarly in NNet, Hydrogen and Portfolio. EI performs rather poorly in these first three functions. This method seems to make excessively greedy decisions and fails to explore the search space enough. This strategy seems to be advantageous in Walker A, where EI obtains the best results. By contrast, PES, ES and PES-NB tend to explore more in this latter dataset. This leads to worse results than those of EI. Nevertheless, PES is significantly better than PES-NB and ES in both Walker datasets and better than EI in the noisier Walker B. In this case, the fully Bayesian treatment of hyper-parameters performed by PES produces improvements in performance.
Conclusions
We have proposed a novel information-theoretic approach for Bayesian optimization. Our method, predictive entropy search (PES), greedily maximizes the amount of one-step information on the location of the global maximum using its posterior differential entropy. Since this objective function is intractable, PES approximates the original objective using a reparameterization that measures entropy in the posterior predictive distribution of the function evaluations. PES produces more accurate approximations than Entropy Search (ES), a method based on the original, non-transformed acquisition function. Furthermore, PES can easily marginalize its approximation with respect to the posterior distribution of its hyper-parameters, while ES cannot. Experiments with synthetic and real-world functions show that PES often outperforms ES in terms of immediate regret. In these experiments, we also observe that PES often produces better results than expected improvement (EI), a popular heuristic for Bayesian optimization. EI often seems to make excessively greedy decisions, while PES tends to explore more. As a result, EI seems to perform better for simple objective functions while often getting stuck with noisier objectives or for functions with many modes.
References
Appendix A Details on approximating GP sample paths
In this section we give further details about the approach used in Section 2.1 to approximate a GP using random features. These random features can be used to approximate sample paths from the GP posterior. By optimizing these sample paths we obtain posterior samples over the global maxima . We derive in more detail the kernel approximation from (5). Formally, the theorem of states
A continuous, shift-invariant kernel is positive definite if and only if it is the Fourier transform of a non-negative, finite measure.
As a result given some kernel there must exist an associated density , known as its spectral density, which is the Fourier dual of . This can be written as
Further, we can treat this measure as a probability density where is the normalizing constant. Consequently, the kernel can be written as
We now briefly show the equivalence between a Bayesian linear model using random features and a GP with kernel . Consider now a linear model where has a standard Gaussian distribution and observations of the form . The posterior of given is also be normal where
and where and consist of the stacked features and observations respectively. We can also easily write the predictive distribution over evaluated at a test point , which is Gaussian distributed with mean and variance given by
By a simple application of the matrix-inversion lemma these quantities can be rewritten in terms which only make use of the inner products between features,
the expectations of which are equivalent to the kernel and we obtain the same expressions as that in (1).
Appendix B Details on approximating the predictive variance
We now provide further details on approximating the predictive variance of inputs given the position of the global optimizer . In particular we include all steps omitted in the presentation of Section 2.2.
Here contains the random variables that we will condition on in order to enforce constraint C1.1. Given the input locations and we can construct a kernel matrix containing the covariance evaluated on the stacked vector . We again refer to in constructing this matrix which includes derivative observations, the computations of which are tedious but not overly complicated. Note also that the portions of which correspond to will have an additional due to the observation noise. Next let , , and denote the corresponding diagonal and off-diagonal blocks of the kernel matrix. We can now condition on the observed values of to write
where and .
B.2 Incorporating the non-analytic latent constraints (C1.2 and C2)
The additional constraints C1.2 and C2 can be introduced explicitly as in (6), which takes the form of a single Gaussian factor and non-Gaussian factors
We approximate this distribution using a single multivariate Gaussian where each non-Gaussian factor is replaced by a Gaussian approximation such that
where this approximation is parameterized by and . The parameters of the approximate factors are combined to form the vector and the diagonal matrix .
To compute the approximate factors we use expectation propagation (EP). EP is a procedure that starts from some initial values for the approximate factors and iteratively refines these quantities; here we initialize and which corresponds to and . At each iteration, for every factor , we remove the contribution of the th approximate factor to form the cavity distribution . Given the independent factors we consider here we can focus on each individual component separately with mean and variance
For both sets of constraints used in this work the moments can easily be obtained by computing the normalizing constant and using the following identities:
B.3 Incorporating the prediction constraint (C3)
Given some test input we now turn to the problem of making predictions about . We again note that both the “prior” terms , and the EP factors, and , are independent of and can be precomputed once for later use at prediction time.
Let be a vector given by the concatenation of the latent function at and . The distribution for given the first two constraints can be written as
By writing above we are assuming that is independent of C1.2 and C2 given and as a result the above is simply an integral over the product of two Gaussians. Let be the cross-covariance matrix evaluated between and and the covariance matrix associated with . The posterior above will then be Gaussian with mean and variance
where is a block-diagonal matrix where the first block is zero and the second is (note this matrix is also diagonal since is diagonal). Finally, these values can be plugged into (8–9) in order to arrive at .