An acquisition function scores candidate parameter values to choose the next experiment in Bayesian optimization. It combines a surrogate’s predicted metric with its uncertainty, automating the exploration–exploitation trade-off instead of leaving experiment selection to an engineer. section 6.0 section 6.1.5
For minimization, the lower confidence bound (LCB) is defined as LCB = expectation − k × uncertainty. Minimizing it favors low predicted CPU time while also favoring uncertain regions where new measurements can improve the surrogate. section 6.3 section 6.3.1
Use the acquisition function inside the Bayesian optimization loop:
- Build or update a Gaussian-process surrogate from measured parameter values and CPU times. section 6.1
- Optimize the acquisition function over candidate parameter values to select the next measurement. section 6.1
- Adjust k to express the exploration priority: larger k emphasizes uncertainty, while smaller k emphasizes predicted CPU time. section 6.3.1
- Stop when measured CPU time and the selected parameter stop changing, indicating convergence. section 6.1.5
Choosing the next compiler parameter
For a JIT compiler parameter ranging from 0 to 1, the acquisition function uses predicted CPU time and model uncertainty. With k = 1, minimizing the LCB over a grid selects approximately 0.1111 for the next measurement; repeated iterations settle near 0.15. section 6.3.1 section 6.1.5
parameters = [0.5, 0.0] measurements = [1.52, 1.21] gpr4 = GPR4(parameters, measurements, sigma=.15) x_hats = np.linspace(0,1,100) y_hats, sigma_y_hats = zip(*[gpr4.estimate(x_hat) for x_hat in x_hats]) k = 1 lcb = np.array(y_hats) - k*np.array(sigma_y_hats)
Inspect the NumPy calculation that estimates the surrogate, constructs LCB, and prepares the acquisition values for minimization. section 6.3.1


