SlowGuess/NeurIPS_2023_OCR huggingface dataset:
1: Inputs: Best input up to iteration  $t$  since the last restart:  $v_{t}^{*}$ , subgraph size  $Q$ .
2: Output: local subgraph  $G_{t}$  with  $Q$  nodes.
3: Initialise:  $\tilde{\mathcal{V}}_t\gets \{v_t^*\} ,h\gets 1$
4: while  $|\tilde{\nu}_t| < Q$  do
5: Find  $\mathcal{N}_h$ , the  $h$ -hop neighbours of  $v_t^*$ .
6: if  $|\dot{\mathcal{V}}_t| + |\mathcal{N}_h|\leq Q$  then
7: Add all  $h$ -hop neighbours to  $\tilde{\mathcal{V}}_t$ :  $\tilde{\mathcal{V}}_t \gets \tilde{\mathcal{V}}_t \cup \mathcal{N}_h$ .
8: Increment  $h$ :  $h \gets h + 1$
9: else
10: Randomly sample  $Q - |\tilde{\mathcal{V}}|_t$  nodes from  $\mathcal{N}_h$  and add to  $\tilde{\mathcal{V}}_t$
11: end if
12: end while
13: return the subgraph  $\tilde{G}_t$  induced by  $\tilde{\mathcal{V}}_t$  (i.e. the ego-network).
Determining the local subgraph size. The local subgraph size at iteration  $t$  ( $Q_{t}$ ) is a hyperparameter of the algorithm. We adapt the idea of trust regions from trust region-based optimisation algorithms [7, 13, 43] to adaptively set the size of  $Q_{t}$  as the optimisation progresses: specifically, we initialise  $Q_{0}$  (initial neighbourhood size), succ_tol (success tolerance), fail_tol (failure tolerance) and  $\gamma > 1$  (multiplier) as hyperparameters<sup>3</sup>, and count "successes" as occasions where BayesOptG succeeds in improving the function values (i.e., at iteration  $t$ ,  $f(v_{t}^{*}) < f(v_{t - 1}^{*})$ ) and "failures" otherwise. Upon consecutive succ_tol successes, we expand the neighbourhood size  $Q_{t} \gets \min(\text{round}(\gamma Q_{t - 1}), n)$  to increase exploration, and upon consecutive fail_tol failures, we shrink  $Q_{T} \gets \max(\text{round}(\mathrm{Q}_{t - 1} / \gamma, Q_{\min}))$  to increase exploitation. The notation round(\cdot) denotes rounding to the nearest integer, and  $Q_{\min}$  denotes some minimum value of neighbourhood size (typically set to 1 to include a single node  $v_{t}^{*}$  for simplicity, although alternative values may be used). When  $Q_{t} \leq Q_{\min}$ , we restart the BO by fitting the surrogate with randomly initialised nodes whose objective function values have not been evaluated.
Remarks on the relation to trust-region BO methods.
It is worth noting that while conceptually influenced by previous trust region-BO methods, the local graph construction we use differs from these methods in several crucial aspects. First, we use a bespoke distance metric in the graph space. Second, whereas the purpose of trust regions in previous works is to alleviate over-exploration in high-dimensional spaces, local subgraphs in our case also uniquely serve the crucial purpose of allowing BayesOptG to handle imperfect knowledge about the graphs, as we only need to reveal the topology of the subgraph (as opposed to the entire graph) at any given iteration. Lastly, we discussed, that using trust regions also improves scalability – this can be concretely exemplified by the massive speed-up shown in Fig. 3.
Optimisation of the acquisition function.
With the local subgraph obtained, we then fit a GP surrogate with the covariance function defined in §3.1 and optimise log-marginal likelihood. Given that the local search space in our case is finite (of size  $Q$ ), we simply enumerate all nodes within  $\tilde{G}_t$  to compute their acquisition function  $\mathrm{acq}(\cdot)$  values (which is computed from the predictive mean and variance of the GP surrogate) and pick the maximiser as the recommended location to query the objective function  $f(\cdot)$  for iteration  $t + 1$  as
Figure 3: Trust regions enable efficient optimisation on large graphs: Wall-clock time with and without trust regions in BayesOptG with different kernels over graphs of different sizes.
$v_{t + 1} = \arg \max_{v\in \tilde{\nu}_t}\mathrm{acq}(v)$ . Any off-the-shelf acquisition function may be used, and we adopt expected improvement (EI) [16] in our experiments. It is worth noting that BayesOptG is also fully compatible with existing approaches such as Kriging believer fantasisation [17] for batch BO.
The setup we consider is by itself novel and largely under-explored. One of the few existing methods that can be used for optimisation over a graph search space is COMBO [27], where the search space is modelled as a graph that captures the relationship between different values for a group of
<sup>3</sup>We provide an ablation study in App. D to show the robustness of BayesOptG to hyperparameters.
Figure 4: Validation of predictive powers of kernels considered on a BA graph of size  $n = 200$  nodes and parameter  $m = 1$ , with (a) function values on the nodes corresponding to elements of the eigenvector corresponding to the second smallest eigenvalue and (b) same as above, but corrupted with noise standard deviation  $\sigma = 0.05$ . The leftmost column shows the visualisation of the ground truth, and the right columns show the GP posterior mean and standard deviation (error bars) learned by the different kernels against ground truth with Spearman correlation  $\rho$  and learned  $r^{-1}(\lambda)$  (Eq. 1).
categorical variables. It is, therefore, designed explicitly for combinatorial optimisation. Several studies modified COMBO in various ways but followed essentially the same framework for similar tasks, e.g., optimisation over categorical variables [12, 19, 24]. Similarly, Ramachandram et al. [30] propose a specific graph construction to optimise multimodal fusion architectures. Our work differs from these studies in that: 1) we focus on optimisation over generic, large-scale and potentially unknown graphs; 2) the nodes of the graph are not limited to combinations of values for categorical variables and can represent any entities; 3) the kernel we propose is not limited to diffusion-based ones and can adapt to the behaviour of the function to be optimised. Finally, the graph bandit setting ([5, 39, 38]) can be seen to be similar to ours in the sense that it also aims at finding extreme values associated with nodes in a graph. However, the bandit problem considers a stochastic setting where nodes are influenced in a probabilistic fashion, and the objective function is actively shaped by this process; in comparison, in our case, we consider an underlying deterministic and black-box function, which is more aligned with the classical BO setting. Moreover, both Valko et al. [39] and Thaker et al. [38] require full graph access and require prohibitive operation on the full graph Laplacian (decomposition/inversion), whereas BayesOptG may work on-the-fly with initially unknown graphs and is much more scalable thanks to the designs in §3.2. Several works also leverage kernels on graphs to build Gaussian processes for graph-structured data [26, 41, 40, 46, 28, 4, 29]. While the kernels proposed in these approaches can, in theory, be used in a BO framework, these studies do not address the optimisation problem we consider.
Another line of work focuses on optimisation over graph inputs (in contrast to a graph search space) where each input configuration itself is a graph. In contrast, in our case, each input configuration is a node. Examples of the former include Ru et al. [34] who model neural architectures as graphs and use Weisfeiler-Lehman kernels [36] to perform BO, and Wan et al. [42], who devise a BO agent for adversarial attack on graph classification models. Other representative examples include Kandasamy et al. [20], Korovina et al. [23] and Cui et al. [8, 9]. We emphasise that, while related, these works deal with a different setup and thus require a different method compared to the present work. For example, the kernels over graphs used in these methods typically aim to find vector embedding of graphs that account for their topologies. However, once the embedding is computed, standard Euclidean covariance functions (e.g., the dot product or squared-exponential kernel) are applied. On the other hand, in the present work, we aim to compute similarities over nodes, where topological information is crucial during the covariance computation itself.
We first validate the predictive power of the GPs with the adopted kernels on graphs and then demonstrate the optimisation performance of BayesOptG in both synthetic and real-world tasks. We compare BayesOptG against baselines, including random and local search optimisation algorithms as
(d) Eigenvector;  $m = 2$
(e) Eigenvector;  $m = 3$
(f) Eigenvector;  $m = 4$
Figure 5: Maximising centrality scores with the BA random graph model and  $n = 1000$  nodes. Different graphs show different values of the BA hyperparameter  $m \in \{2,3,4\}$  and centrality metrics {betweenness/eigenvector centrality}.
(a) Betweenness
(d) Eigenvector
Figure 6: Maximising centrality scores with the WS random graph model and  $n = 2000$  nodes. Refer to Fig. 5 for legend and additional explanations.
(b) Betweenness
(e) Eigenvector
(c) Betweenness
(f) Eigenvector
(d) Betweenness
$(k,p) = (30,0.2)$
(g) Eigenvector
well as BFS and DFS. The description of these baselines is given in the App. B.2. In all figures, lines, and shades denote mean and standard error, respectively, across ten trials.
5.1 Validating Predictive Power of Kernels
We first validate the predictive power of the adopted kernels in controlled regression experiments. To do so, we generate functions that are simply the eigenvectors of the graph Laplacian and compare the predictive performance of the kernels using three graph types: 2D grid, Barabási-Albert (BA) [1] and Watts-Strogatz (WS) [45]. We compare the performance in terms of validation error and show the results in Fig. 4 (results for other graph types are shown in App. C.1). We find that in the noiseless case, all kernels learn the underlying function effectively (except that the diffusion with ARD kernel learns a non-smooth transform on the spectrum due to its over-parameterisation, resulting in underestimations of the uncertainty in the noisy case). Still, the better-regularised kernels (described in §3.1) are considerably more robust to noise corruption.
Figure 7: Synthetic test functions task with Ackley/Rosenbrock functions with noise standard deviation  $\sigma \in \{0.5,1\}$ . Regrets shown in log-scale for Rosenbrock; refer to Fig. 5 for legend.
Figure 8: Identifying the patient zero task with different SIR model hyperparameters  $\beta \in \{0.1, 0.2\}$  and  $\gamma \in \{0.015, 0.15\}$  and probability of recovery  $\epsilon$  of 0. Refer to Fig. 20-23 for experiments with other hyperparameter combinations.
Figure 9: Identifying influential users in a social network task on different real-life social networks (Enron/Facebook page/Twitch). Refer to Fig. 8 for legend.
Figure 10: Team optimisation task with  $s$  (number of skills)  $\in \{2,4\}$  and  $\alpha \in \{1,10\}$  with Jaccard index threshold of 0.3 (refer to App. B.4.3 for explanations). Refer to Fig. 8 for legend and Fig. 24 - 26 for experiments with other hyperparameter combinations.
5.2 Optimisation Tasks
We conduct experiments on a number of synthetic and real-life tasks that involve or imitate expensive optimisation, and we show all results in terms of simple regret (i.e., the difference between the objective function value and the ground-truth optimum). We consider the following synthetic tasks:
- Maximising centrality scores (Fig. 5 and 6; Fig. 18 in App. C.2): we aim to find the node with maximum centrality measure, from a graph sampled from a random graph model. We consider both eigenvector centrality and betweenness centrality as the centrality metrics, and use BA and WS with different hyperparameters as the random graph-generating models. We consider graphs with sizes in the range of  $10^{3}$  in Fig. 5 and 6. In Fig. 18, we further scale the size of graphs considered to  $10^{6}$  nodes to demonstrate the scalability of our method in a large-scale setup.
- Synthetic test functions (Fig. 7): we optimise a suite of discretised versions of commonly used synthetic test functions (Ackley and Rosenbrock) on graphs defined as a 2D-grid in both noiseless and noisy setups. The readers are referred to App. B.3.2 for additional implementation details.
We consider the following real-life tasks:
- Identifying the patient zero (Fig. 8; Fig. 20 to 23 in App. C.3): we aim to find the "patient zero" of an epidemic in a contact network, who is to the person identified as the first carrier of a communicable disease in an epidemic outbreak. We use a real-world contact network based on Bluetooth proximity [2], and on top of simulating the epidemic process using the SIR model, the canonical compartmental model in epidemiology [22]. The function values are the time instants when an individual is infected; the readers are referred to App. B.4.1 for more details of this task.
- Identifying influential users in a social network (Fig. 9): we aim to find the most influential user in a social network. There are multiple ways of defining the influence power of a user, and for simplicity, we follow the common practice of taking node degree as a proxy of influence [21]. We
use three real-world networks, namely the Enron email network [25], Facebook page network [33], and Twitch social network [32]. The readers are referred to App. B.4.2 for more details.
- Team optimisation (Fig. 10; Fig. 24 to 26 in App. C.4): we design a task of optimising team structure, where the objective is to find a team that contains members who are experts in different skills, and their collective expertise represents a diverse skill set. In this case, the teams are modelled as nodes, and edges represent the a priori similarity between teams. While there are various possible ways to model these similarities, in our experiment, we consider that an edge exists between two nodes if the Jaccard index between the two sets of team members is greater than a certain threshold. We include additional details and a formal description of the objective function in the App. B.4.3.
We designed these tasks to imitate expensive but realistic black-box optimisation problems on which the use of Bayesian optimisation is ideal. For example, the identifying patient zero task imitates real-life contact tracing. If executed in real life, each function evaluation requires expensive and potentially disruptive procedures like interviews about the individuals' travel history and the people they were in contact with. On the other hand, the centrality maximisation & identifying influential social network users problems mirror common online advertising tasks to identify the influential users without access to the full social network information (which would be near-impossible to obtain given the number of users). Real-life social media often limits how much one may interact with their platform through pay-per-use APIs or hard limits (e.g. upper limit of views). In either case, there is a strong reason to identify the influential users in the most query-efficient manner.
Discussions. In addition to the task-specific results, we further aggregate the performance of the different methods over all tasks in terms of relative ranking in Fig. 11. We find that within individual tasks and aggregated across the different tasks, BayesOptG with any kernel choice generally outperforms all baselines in terms of efficiency, final converged values, or both. Specifically, Random is simple but typically weak for larger graphs, except for very rough/noisy functions (like Ackley), or the variation in function values is generally small; DFS and BFS are relatively weak as they consider graph topology information only but not the node information (on which the objective function is defined) and can be sensitive to initialisation; Local search is, on balance, the strongest baseline, and it does particularly well on smoother functions with fewer local minima.
Figure 11: Aggregated ranks of the methods (lower is better) vs. the number of evaluations averaged across all experiments.
As is the case for any GP-based method, the kernel choice impacts the performance, and the performance is stronger when the underlying assumptions of the kernel match the actual objective function. For example, diffusion kernels work well for patient zero identification (Fig. 8) and team optimisation (Fig. 10), as the underlying generative functions for both problems, are indeed smooth (in fact, the SIR model in disease propagation is heavily connected to diffusion processes). Diffusion without ARD further enforces isotropy, assuming the diffusion coefficient in all directions is the same, and thus typically underperforms except for team optimisation, where the generated graph is well structured and Ackley, which is indeed isotropic and symmetric. We recommend only if we know that the underlying function satisfies its rather stringent assumptions. Finally, the SumInverse and DiffARD kernels are generally better, as they offer more flexibility in learning from the data; we recommend using one of these as default without prior knowledge suggesting otherwise.
We address the problem of optimising over functions on graphs, a hitherto under-investigated problem. We demonstrate that BO, combined with learned kernels on graphs and efficient local modelling, provides an effective solution. The proposed framework works with generic, large-scale and potentially unknown graphs, a setting that existing BO methods cannot handle. Results on a diverse range of tasks support the effectiveness of the proposed method. The current work, however, only considers the case where the optimisation is over nodes; possible future works include extensions to related settings, such as optimising over functions defined on edges and/or on hypergraphs.
The authors would like to acknowledge the following sources of funding in direct support of this work: X.W. is supported by the Clarendon Scholarship at University of Oxford; P.O. is supported by the EPSRC Centre for Doctoral Training in Autonomous Intelligent Machines and Systems EP/L015897/1; X.D. acknowledges support from the Oxford-Man Institute of Quantitative Finance and the EPSRC (EP/T023333/1). The authors declare no conflict of interest.
[1] Barabási, A.-L. and Albert, R. Emergence of scaling in random networks. science, 286(5439): 509-512, 1999.
[2] Barrat, A., Cattuto, C., Kivelä, M., Lehmann, S., and Saramäki, J. Effect of manual and digital contact tracing on Covid-19 outbreaks: a study on empirical contact data. Journal of the Royal Society Interface, 18(178):20201000, 2021.
[3] Borovitskiy, V., Azangulov, I., Terenin, A., Mostowsky, P., Deisenroth, M., and Durrande, N. Matérn gaussian processes on graphs. In International Conference on Artificial Intelligence and Statistics, pp. 2593-2601. PMLR, 2021.
[4] Borovitskiy, V., Azangulov, I., Terenin, A., Mostowsky, P., Deisenroth, M. P., and Durrande, N. Matern Gaussian processes on graphs. In International Conference on Artificial Intelligence and Statistics, 2021.
[5] Carpentier, A. and Valko, M. Revealing graph bandits for maximizing local influence. In International Conference on Artificial Intelligence and Statistics, 2016.
[6] Carvalho, C. M., Polson, N. G., and Scott, J. G. Handling sparsity via the horseshoe. In Artificial Intelligence and Statistics, pp. 73-80. PMLR, 2009.
[7] Conn, A. R., Gould, N. I., and Toint, P. L. Trust region methods. SIAM, 2000.
[8] Cui, J., Yang, B., and Hu, X. Deep bayesian optimization on attributed graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, 2019.
[9] Cui, J., Tan, Q., Zhang, C., and Yang, B. A novel framework of graph bayesian optimization and its applications to real-world network analysis. Expert Systems with Applications, 170 (114524), 2021.
[10] Daulton, S., Eriksson, D., Balandat, M., and Bakshy, E. Multi-objective bayesian optimization over high-dimensional search spaces. In Uncertainty in Artificial Intelligence, pp. 507-517. PMLR, 2022.
[11] Defferrard, M., Bresson, X., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. Advances in neural information processing systems, 29, 2016.
[12] Deshwal, A., Belakaria, S., and Doppa, J. R. Mercer Features for Efficient Combinatorial Bayesian Optimization. In AAAI Conference on Artificial Intelligence, 2021.
[13] Eriksson, D., Pearce, M., Gardner, J., Turner, R. D., and Poloczek, M. Scalable global optimization via local bayesian optimization. Advances in neural information processing systems, 32, 2019.
[14] Even, S. Graph algorithms. Cambridge University Press, 2011.
[15] Frazier, P. I. A tutorial on bayesian optimization. arXiv preprint arXiv:1807.02811, 2018.
[16] Garnett, R. Bayesian Optimization. Cambridge University Press, 2023.
[17] Ginsbourger, D., Le Riche, R., and Carraro, L. Kriging is well-suited to parallelize optimization. Computational intelligence in expensive optimization problems, pp. 131-162, 2010.
[36] Shervashidze, N., Schweitzer, P., Van Leeuwen, E. J., Mehlhorn, K., and Borgwardt, K. M. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(9), 2011.
[37] Smola, A. J. and Kondor, R. Kernels and regularization on graphs. In Learning theory and kernel machines, pp. 144-158. Springer, 2003.
[38] Thaker, P., Malu, M., Rao, N., and Dasarathy, G. Maximizing and satisficing in multi-armed bandits with graph information. Advances in Neural Information Processing Systems, 35: 2019–2032, 2022.
[39] Valko, M., Munos, R., Kveton, B., and Kocák, T. Spectral bandits for smooth graph functions. In International Conference on Machine Learning, pp. 46-54. PMLR, 2014.
[40] Venkitaraman, A., Chatterjee, S., and Handel, P. Gaussian processes over graphs. In IEEE International Conference on Acoustics, Speech and Signal Processing, 2020.
[41] Walker, I. and Glocker, B. Graph convolutional Gaussian processes. In International Conference on Machine Learning, 2019.
[42] Wan, X., Kenlay, H., Ru, B., Blaas, A., Osborne, M. A., and Dong, X. Adversarial attacks on graph classifiers via bayesian optimisation. Conference on Neural Information Processing Systems, 2021.
[43] Wan, X., Nguyen, V., Ha, H., Ru, B., Lu, C., and Osborne, M. A. Think global and act local: Bayesian optimisation over high-dimensional categorical and mixed search spaces. International Conference on Machine Learning (ICML), 2021.
[44] Wan, X., Lu, C., Parker-Holder, J., Ball, P. J., Nguyen, V., Ru, B., and Osborne, M. Bayesian generational population-based training. In First Conference on Automated Machine Learning (Main Track), 2022.
[45] Watts, D. J. and Strogatz, S. H. Collective dynamics of 'small-world' networks. Nature, 393 (6684):440-442, 1998.
[46] Zhi, Y.-C., Ng, Y. C., and Dong, X. Gaussian processes on graphs via spectral kernel learning. IEEE Transactions on Signal and Information Processing over Networks, 2023.
A Proof of Semi-Definiteness
In this section, we show that all kernels considered in this paper are positive semi-definite (p.s.d). Specifically, we note that using the terminology defined in Eq. 1, any map  $r \to \mathbb{R} \to [0, +\infty]$  defines a valid covariance kernel. Indeed,
$$
\forall \mathbf {X} \subset \mathcal {V}, k (\mathbf {X}, \mathbf {X}) = \sum_ {i = 1} ^ {\tilde {n}} r ^ {- 1} \left(\lambda_ {i}\right) \mathbf {u} _ {i} [ \mathbf {X} ] \mathbf {u} _ {i} [ \mathbf {X} ] ^ {\top}, \tag {2}
$$
where  $\mathbf{u}_i[\mathbf{X}] = \left[u_i[x_1], u_i[x_2], \ldots, u_i[x_l]\right]^\top$  with  $l = |\mathbf{X}|$ . The matrix  $u_i[\mathbf{X}]u_i[\mathbf{X}]^\top$  is symmetric p.s.d as the outer product of one non-zero vector:  $\forall \mathbf{x} \in \mathbb{R}^l$ ,  $\mathbf{x}^\top u_i[\mathbf{X}]u_i[\mathbf{X}]^\top \mathbf{x} = \|u_i[\mathbf{X}]^\top x\|_2^2 \geq 0$ . As a result, our covariance matrix is symmetric p.s.d as the weighted sum of symmetric positive semidefinite matrices with positive coefficients. The kernels we presented in this paper correspond to a positive  $r$ ; hence, they are all p.s.d.
B.1 Random Graph Models
Barabási-Albert model (BA). The network begins with an initial connected network of  $m_0$  nodes. New nodes are added to the network one at a time. Each new node is connected to  $m \leq m_0$  existing nodes with a probability that is proportional to the number of links that the existing nodes already have. The probability  $p_i$  that the new node is connected to node  $i$  is: