arXiv:2610.41537math.OCOct 2026

Manuscript Offprint

arXiv:2610.41537

Distributed Grid Search for Hyperparameter Tuning

Constança De Herdeiro Cachim, Andrea Martin, Nicola Bastianello

Constança De Herdeiro Cachim¹, Andrea Martin¹, Nicola Bastianello²

Abstract— The performance of many distributed optimization algorithms over peer-to-peer networks strongly depends on the choice of their hyperparameters. However, existing selection rules often require global quantities, yield conservative choices, or are tied to specific algorithms and hyperparameters. We propose Distributed Grid Search (D-GS), a consensus-based search method that evaluates and selects hyperparameter configurations across the network, requiring only the ability to run the tuned algorithm and evaluate local gradients. We also propose a zoom-in variant, Distributed Zoom Grid Search (D-ZGS), which improves empirical performance at a reduced cost. We prove that both methods terminate in finite time with all agents holding the same hyperparameter configuration, and quantify the (sub)optimality of this configuration. Numerical experiments on linear and logistic regression show that D-GS closely matches a centralized reference and that tuning and deployment cost a fraction of deploying algorithms with hyperparameters tuned using theoretical results.

I. INTRODUCTION

Learning and optimization tasks are increasingly performed over networks of agents, driven by applications in areas such as smart grids, multi-robot systems, and signal processing [1], [2], [3]. In these systems, data is generated in multiple places at once, and collecting it all centrally is often impractical as it can entail significant communication costs, raise privacy concerns and create a single point of failure [4]. Instead, decentralized approaches avoid these limitations by processing data where it is collected and collaborating over networks [5]. These architectures include federated settings, where a central server coordinates [6], and distributed settings, where agents communicate directly with each other [7].

Decentralized algorithms rely on hyperparameters, such as the stepsize, that are not learned by the algorithm itself. Their selection has a decisive impact on convergence speed and solution quality, with poor choices causing algorithms to converge slowly or even diverge [8], [9], [10]. In practice, these values are commonly tuned by hand, through costly trial and error, often assuming access to global information (e.g. knowledge of the network topology and agents' data). This motivates the design of automated, decentralized hyperparameter tuning methods, which only rely on local computation and communications. In particular, in this paper we focus on the distributed setting.

The literature on decentralized hyperparameter tuning is relatively scarce compared to centralized set-ups; examples include the tuning of stepsizes via decentralized version

of the Barzilai–Borwein and Polyak rules [11], [12], and line searches coordinated through consensus protocols [13], [14], [9]. Coordination is important in this set-up, as tuning methods yielding heterogeneous stepsizes across agents might lead to degraded performance or even divergence; indeed, most algorithms are designed to use coordinated hyperparameters.

While these works focus exclusively on stepsize tuning, many decentralized algorithms are characterized by several hyperparameters. This motivates the development of more general tuning algorithms based on hyperparameters optimization. Hyperparameter optimization casts the selection of a hyperparameter configuration as an optimization problem [15]. It has been studied most extensively in centralized settings, with decentralized adaptations emerging only more recently, mostly in federated settings [16], [17]. In peer-to-peer networks, existing approaches based on decentralized bilevel optimization require the performance metric to be differentiable in the hyperparameters and reach agreement only asymptotically [18], [19]. A method that guarantees finite-time, network-wide agreement, and that is applicable to tune any algorithm, is thus still missing.

Contributions: The contributions of this paper are as follows.

  • We propose Distributed Grid Search (D-GS), a method that scores candidate hyperparameters by average consensus and reaches agreement by minimum consensus, requiring only the ability to run the tuned algorithm and evaluate local gradients. We also propose a zoom-in variant, Distributed Zoom Grid Search (D-ZGS), which improves empirical performance while reducing computational cost.
  • We prove that both methods terminate in finite time with all agents holding the same configuration. We also quantify the (sub)optimality of the selected configuration, and its dependence on the accuracy of the averaging protocol, detailing three such protocols with different trade-offs.
  • We validate D-GS and D-ZGS on linear and logistic regression problems, comparing the selected configurations against a centralized reference, studying the cost of tuning against a theoretical stepsize, and examining the effect of averaging errors on the selection.

Outline: Section II formulates the hyperparameter selection problem and its challenges in a distributed setting. Section III reviews the consensus protocols that the proposed algorithms build on. Section IV presents D-GS and D-ZGS and establishes their guarantees. Section V reports our

¹KTH Royal Institute of Technology, Stockholm, Sweden ccachim@kth.se, andrmar@kth.se ²University College London, United Kingdom n.bastianello@ucl.ac.uk numerical results, and Section VI concludes the paper.

Notation: ∥⋅∥\|\cdot\| denotes the Euclidean norm of a vector, 1 the vector of all ones and ∣⋅∣|\cdot| the cardinality of a set. For a graph G=(V,E)\mathcal{G} = (\mathcal{V}, \mathcal{E}), V={1,…,N}\mathcal{V} = \{1, \ldots, N\}, Ni={j∈V∣{i,j}∈E}\mathcal{N}_i = \{j \in \mathcal{V} \mid \{i, j\} \in \mathcal{E}\} denotes the neighbors of agent ii and DD the diameter of G\mathcal{G}.

References (28)