Hostname: page-component-76d6cb85b7-s74w7 Total loading time: 0 Render date: 2026-07-12T20:20:44.058Z Has data issue: false hasContentIssue false

Leveraging memory effects and gradient information in consensus-based optimisation: On global convergence in mean-field law

Published online by Cambridge University Press:  20 October 2023

Konstantin Riedl*
Affiliation:
Department of Mathematics, School of Computation, Information and Technology, Technical University of Munich, Munich, Germany Munich Center for Machine Learning, Munich, Germany
Rights & Permissions [Opens in a new window]

Abstract

In this paper, we study consensus-based optimisation (CBO), a versatile, flexible and customisable optimisation method suitable for performing nonconvex and nonsmooth global optimisations in high dimensions. CBO is a multi-particle metaheuristic, which is effective in various applications and at the same time amenable to theoretical analysis thanks to its minimalistic design. The underlying dynamics, however, is flexible enough to incorporate different mechanisms widely used in evolutionary computation and machine learning, as we show by analysing a variant of CBO which makes use of memory effects and gradient information. We rigorously prove that this dynamics converges to a global minimiser of the objective function in mean-field law for a vast class of functions under minimal assumptions on the initialisation of the method. The proof in particular reveals how to leverage further, in some applications advantageous, forces in the dynamics without loosing provable global convergence. To demonstrate the benefit of the herein investigated memory effects and gradient information in certain applications, we present numerical evidence for the superiority of this CBO variant in applications such as machine learning and compressed sensing, which en passant widen the scope of applications of CBO.

Information

Type
Papers
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Figure 1. A visualisation of the CBO dynamics (1.1) with memory effects and gradient information. Particles with positions $X^1,\dots,X^N$ (yellow dots with their trajectories) explore the energy landscape of the objective $\mathcal{E}$ in search of the global minimiser $x^*$ (green star). Each particle stores its local historical best position $Y^i_t$ (yellow circles). The dynamics of the position $X^i_t$ of each particle is governed by three deterministic terms with associated random noise terms (visualised by depicting eight possible realisations with differently shaded green arrows). A global drift term (dark blue arrow) drags the particle towards the consensus point $y_{\alpha} (\widehat{\rho }_{Y,t}^N)$ (orange circle), which is computed as a weighted (visualised through colour opacity) average of the particles’ historical best positions. A local drift term (light blue arrow) imposes movement towards the respective local best position $Y^i_t$. A gradient drift term (purple arrow) exerts a force in the direction $-\nabla{\mathcal{E}}(X^i_t)$.

Figure 1

Figure 2. A demonstration of the benefits of memory effects and gradient information in CBO methods. In both settings (a) and (b) the depicted success probabilities are averaged over $100$ runs of CBO and the implemented scheme is given by a Euler-Maruyama discretisation of equation (1.1) with time horizon $T=20$, discrete time step size $\Delta t=0.01$, $\alpha =100$, $\beta =\infty$, $\theta =0$, $\kappa =1/\Delta t$, $\lambda _1=1$ and $\sigma _1=\sqrt{1.6}$. In (a) we plot the success probability of CBO without (left separate column) and with (right phase diagram) memory effects for different values of the parameter $\lambda _2$, i.e., for different strengths of the memory drift, when optimising the Rastrigin function ${\mathcal{E}}(x) = \sum _{k=1}^d x_k^2 + \frac{5}{2} (1-\cos (2\pi x_k))$ in dimension $d=4$. As remaining parameters we choose $\sigma _2=\lambda _1\sigma _1$ and $\lambda _3=\sigma _3=0$, i.e., no gradient information is involved. We observe that an increasing amount of memory drift improves the success probability significantly, even in the case where, theoretically, there are no convergence guarantees anymore, see Theorem 2.5 and Corollary 2.6. Section 4.2 provides further details. In (b) we depict the success probability of CBO without (left separate column) and with (right phase diagram) gradient information for different values of the parameter $\lambda _3$, i.e., for different strengths of the gradient drift, when solving a compressed sensing problem in dimension $d=200$ with sparsity $s=8$. On the vertical axis we depict the number of measurements $m$, from which we try to recover the sparse signal by solving the associated $\ell _1$-regularised problem (LASSO). As remaining parameters we use merely $N=10$ particles, choose $\sigma _3=0$ and $\lambda _2=\sigma _2=0$, i.e., no memory drift is involved. We observe that gradient information is required to be able to identify the correct sparse solution and standard CBO would fail in such task. Section 4.4 provides more details.

Figure 2

Figure 3. Success probability of CBO without (left separate column) and with memory effects for different values of the parameter $\lambda _2\in [0,4]$ (right phase diagram) when optimising the Rastrigin function in dimension $d=4$ in the setting of Figure 2a with the exception of setting $\sigma _2=0$. In this way we validate that the presence of memory effects is responsible for the improved performance and not just a higher noise level.

Figure 3

Figure 4. NN architectures used in the experiments of Section 4.3. Images are represented as $28\times 28$ matrices with entries in $[0,1]$. For the shallow NN in (a) the input is reshaped into a vector $x\in \mathbb{R}^{728}$ which is then passed through a dense layer of the form $\textrm{ReLU}(Wx+b)$ with trainable weights $W\in \mathbb{R}^{10\times 728}$ and bias $b\in \mathbb{R}^{10}$. The learnable parameters of the CNN in (b) are the kernels and the final dense layer. Both networks include a batch normalisation step after each $\textrm{ReLU}$ activation function and a softmax activation in the last layer in order to be able to interpret the output as a probability distribution over the digits. We denote the trainable parameters of the NN by $\theta$. The shallow NN has $7850$ and the CNN $2112$. (Reprinted by permission from Springer Nature Customer Service Centre GmbH: Springer Nature, Applications of Evolutionary Computation, Convergence of Anisotropic Consensus-Based Optimization in Mean-Field Law, M. Fornasier, T. Klock, K. Riedl, © 2022.)

Figure 4

Figure 5. Comparison of the performances (testing accuracy and training loss) of a shallow NN (dashed lines) and a CNN (solid lines) with architectures as described in Figure 4, when trained with CBO without memory effects (lightest lines), with memory effects but without memory drift (line with intermediate opacity) and with memory effects and memory drift (darkest lines). Depicted are the accuracies on a test dataset (orange lines) and the values of the objective function $\mathcal{E}$ evaluated on a random sample of the training set of size 10,000 (blue lines). We observe that memory effects slightly improve the final accuracies while slowing down the training process initially.

Figure 5

Figure 6. Comparison between the success probabilities of CBO without (left separate columns) and with gradient information for different values of the parameter $\lambda _3\in [0,4]$ (right phase diagrams) with $N=10$ ((a) and (c)) or $N=100$ particles ((b) and (d)) when solving the convex or nonconvex $\ell _p$-regularised least squares problem (4.4) with $p=1$ and $\mu =$ ((a) and (b)) or $p=0.5$ and $\mu =$ ((c) and (d)), respectively. On the vertical axis we depict the number of measurements $m$, from which we try to recover the $2$-sparse and $50$-dimensional sparse signal. As further parameters we choose the time horizon $T=20$, discrete time step size $\Delta t=0.01$, $\alpha =100$, $\beta =\infty$, $\theta =0$, $\kappa =1/\Delta t$, $\lambda _1=1$, $\lambda _2=0$ and $\sigma _1=\sigma _2=\sigma _3=0$. We discover that in both the convex and nonconvex setting reconstruction is feasible from already very few measurements. While increasing the number of optimising particles has almost no effect for the convex optimisation problem, in the nonconvex setting recovery benefits from more particles. Note that the separate columns and the left most column of the phase diagrams coincide, and are only depicted in this way to highlight that we compare also CBO.