A discrete version of CMA-ES
Eric Benhamou, Jamal Atif, Rida Laraki

TL;DR
This paper introduces a discrete version of CMA-ES, extending the algorithm to handle multivariate binomial distributions for optimizing discrete variables, which was previously limited to continuous variables.
Contribution
The authors develop a novel discrete CMA-ES variant using multivariate binomial distributions, capable of modeling higher-order interactions for discrete optimization tasks.
Findings
The discrete CMA-ES models correlations efficiently through variable interactions.
The distribution can estimate pairwise and higher-order interactions.
The paper provides a complete algorithm for the discrete CMA-ES.
Abstract
Modern machine learning uses more and more advanced optimization techniques to find optimal hyper parameters. Whenever the objective function is non-convex, non continuous and with potentially multiple local minima, standard gradient descent optimization methods fail. A last resource and very different method is to assume that the optimum(s), not necessarily unique, is/are distributed according to a distribution and iteratively to adapt the distribution according to tested points. These strategies originated in the early 1960s, named Evolution Strategy (ES) have culminated with the CMA-ES (Covariance Matrix Adaptation) ES. It relies on a multi variate normal distribution and is supposed to be state of the art for general optimization program. However, it is far from being optimal for discrete variables. In this paper, we extend the method to multivariate binomial correlated…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
A discrete version of CMA-ES
Eric Benhamou†, ‡, Jamal Atif*‡, Rida Laraki‡***
[email protected] or [email protected],
[email protected], [email protected]
A.I. Square Connect*†* Lamsade, Universite Paris Dauphine, PSL*‡*
Abstract
Modern machine learning uses more and more advanced optimization techniques to find optimal hyper parameters. Whenever the objective function is non-convex, non continuous and with potentially multiple local minima, standard gradient descent optimization methods fail. A last resource and very different method is to assume that the optimum(s), not necessarily unique, is/are distributed according to a distribution and iteratively to adapt the distribution according to tested points. These strategies originated in the early 1960s, named Evolution Strategy (ES) have culminated with the CMA-ES (Covariance Matrix Adaptation) ES. It relies on a multi variate normal distribution and is supposed to be state of the art for general optimization program. However, it is far from being optimal for discrete variables. In this paper, we extend the method to multivariate binomial correlated distributions. For such a distribution, we show that it shares similar features to the multi variate normal: independence and correlation is equivalent and correlation is efficiently modeled by interaction between different variables. We discuss this distribution in the framework of the exponential family. We prove that the model can estimate not only pairwise interactions among the two variables but also is capable of modeling higher order interactions. This allows creating a version of CMA ES that can accomodate efficiently discrete variables. We provide the corresponding algorithm and conclude.
1 Introduction
When facing an optimization problem where there is no access to the objective function’s gradient or the objective function’s gradient is not very smooth, the state of the art techniques rely on stochastic and derivative free algorithm that change radically the point of view of the optimization program. Instead of a deterministic gradient descent, we take a Bayesian point of view and assumes that the optimum is distributed according to a prior statistical distribution and uses particles or random draws to gradually update our statistical distribution. Among these method, the covariance matrix adaptation evolution strategy (CMA-ES; e.g., [11, 10]) has emerged as the leading stochastic and derivative-free algorithm for solving continuous optimization problems, i.e., for finding the optimum denoted by of a real-valued objective function , defined on a subset of a multi dimensional space of dimension : .This method generates candidate points , , from a multivariate Gaussian distribution. It evaluates their objective function (also called fitness) values . As the distribution is characterized by its two first moments, it updates the mean vector and covariance matrix by using the sampled points and their fitness values, . The algorithm keeps repeating the sampling-evaluation-update procedure (which can be seen like an exploration exploitation method until the distribution contracts to a single point or reaches the maximum of iterations. Convergence is measured either by a very small covariance matrix. The different variations around the original method to improve the convergence investigate various heuristic method to update the distribution parameters. This strongly determines the behavior and efficiency of the whole algorithm. The theoretical foundation of the CMA-ES are that for continuous variables with given first two moments, the maximum entropy distribution is the normal distribution and that the update is based on a maximum-likelihood estimation, making this method based on a statistical principle.
A natural question is to adapt this method for discrete variables. Surprisingly, this has not been done before as the Gaussian distribution is a continuous time distribution inappropriate to discrete variables. One needs to change the underlying distirbution and also find the way to correlate the marginal distribution which can be tricky. However, we show in this paper that multivariate binomials are the natural discrete counterpart of Gaussian distributions. Hence we are able to change CMA Es to accommodate for discrete variables. This is the subject of this paper. In the section 2, we introduce the multivariate binomial distribution. Presenting this distribution in the general setting of exponential family, we can easily derive various properties and connect this distribution to maximum entropy. We also proved that for the assumed correlation structure, independence and correlation are equivalent, which is a also a feature of Gaussian distributions. In section 3, we present the algorithm.
2 Primer on Multivariate Binomials
2.1 Intuition
To start building some intuition on multivariate binomials, we start by the simplest case, that is a two dimensional Bernoulli. It is the extension to two dimensions of the univariate Bernoulli distribution. A Bernoulli random variable , is a discrete variable that takes the value with probability and [math] otherwise. The usual notation for the probability mass function is
[TABLE]
A natural extension is to consider the random vector . It takes values in the Cartesian product space . If we denote the joint probabilities for , then the probability for the bivariate Bernoulli writes:
[TABLE]
with the side conditions that the joint probabilities are between [math] and : for , and they sum to one
It is however better to write the joint distribution in terms of canonical parameters of the related exponential family. Hence, if we define
[TABLE]
and the vector of sufficient statistics denoted by
[TABLE]
we can rewrite the distribution as an exponential family distribution as follows:
[TABLE]
where the log partition function is defined such as the probability normalizes to one. It is very easy to check that . We can also relate the initial moment parameters for for , to the canonical parameters as follows
Proposition 1**.**
The moment parameters can be expressed in terms of the canonical parameters as follows;
[TABLE]
Proof.
See A.1 ∎
The expression of the distribution in terms of the canonical parameters is particularly useful as it indicates immediately that independence and correlation are equivalent as in a Gaussian distribution. We will see that this result generalizes to multivariate binomial in the next subsection 2.3.
Proposition 2**.**
The components of the bivariate Bernoulli random vector are independent if and only if is zero. Like for a normal distribution, independence and correlation are equivalent.
Proof.
See A.2 ∎
The equivalence between correlation and independence was already presented in [20] where it was referred to as Proposition 2.4.1. The importance of referred to as the cross term or u-terms) is discussed and called cross-product ratio between and . In [16] and [15], this cross product ratio is also identified but called the log odds.
Intuitively, there are similarities between Bernoulli (their sum version that is the Binomial) and the Gaussian. And like for the multivariate Gaussian, we can prove that the marginal and the conditional Bernoulli are still binomial as shown by the proposition 3, making the analogy between Bernoulli (and soon their independent sum version which is the Binomial) and Gaussian even more striking!
Proposition 3**.**
In the bivariate Bernoulli vector whose probability mass function is given by 1
- •
the marginal distribution of is also a univariate Bernoulli whose probability mass function is
[TABLE]
- •
the conditional distribution of given is also a univariate Bernoulli whose probability mass function is
[TABLE]
Proof.
See A.3 ∎
Before we move on to the generalization, we need to mention a few important facts. First, recall that the sum of independent Bernoulli trials with parameter is a Binomial with parameter and . And when we talk about independent sum, it should ring a bell! Independent sum should make you immediately think about the Central Limit Theorem. This intuition is absolutely correct and shows the connection between the binomial and Gaussian distribution. This is the Moivre Laplace theorem stated below
Theorem 1**.**
If the variable follows a binomial distribution with parameters and in , then the variable converges in law to a standard normal law . Another presentation of this result is to say that, for , as grows large, for in the neighborhood of we can approximate the binomial distribution by a normal as follows:
[TABLE]
The proof of this theorem is traditionally done with doing a Taylor expansion of the characteristic function. An alternative proof is to use the Sterling formula as well as a Taylor expansion to relate the binomial distribution to the normal one. Historically, de Moivre was the first to establish this theorem in 1733 in the particular case: . Laplace generalized it in 1812 for any value of between 0 and 1 and started creating the ground for the central limit theorem that extended this result far beyond. Later on, many more mathematicians generalized and extended this result like Cauchy, Bessel, Poisson but also von Mises, Pólya, Lindeberg, Lévy, Cramér as well as Chebyshev, Markov and Lyapunov.
Second, if we take an infinite sum of Bernoulli, this is a discrete distribution that is the asymptotic limit of the binomial distribution. This is also a distribution that is part of the exponential family and is given by the Poisson distribution.
Proposition 4**.**
For a large number of independent Bernoulli trials with probability such that , then the corresponding binomial distribution with parameter and converges in distribution to the Poisson distribution
Proof.
See A.4 ∎
The two previous results show that binomials, Poisson and Gaussian distributions that are part of the exponential family are closely connected and represent the discrete and continuous version of very similar concepts, namely independent and identically distributed increments.
2.2 Maximum entropy
It is also interesting to relate these distributions to maximum Shannon entropy. Let a function : , where is the space of the random variable and a vector . It is well known that the maximum entropy distribution whose constraint is given by is a distribution of the exponential family given by the following theorem
Theorem 2**.**
The distribution that maximizes the Shannon entropy : subject to the constraint and the obvious probability constraints , , is the unique distribution that is part of the exponential family and given by
[TABLE]
with
[TABLE]
Proof.
See A.5 ∎
Remark 2.1*.*
The theorem 2 works also for discrete distributions. It says that the discrete distribution that maximizes the Shannon entropy subject to the constraint and the obvious probability constraints , , is the unique distribution that is part of the exponential family and given by
[TABLE]
with
[TABLE]
The theorem 2 implies in particular that the continuous distribution that maximizes entropy with given mean and variance (or equivalently first and second moments) is an exponential family of the form
[TABLE]
where the log partition function is defined to ensure the probability distribution sums to one. This distribution is indeed a normal distribution as it is the exponential of a quadratic form. This is precisely the continuous distribution used in the CMA ES algorithm. Taking a distribution that maximizes the entropy means that we take a distribution that has the less information prior. Or said differently, this is the distribution with the minimal prior structural constraint. If nothing is known, it should therefore be preferred.
Ideally, for our CMA ES discrete adaptation, we would like to find the discrete distribution equivalent of the normal. if we want the discrete distribution with independent increment, we should turn to binomial distributions. Binomials have the other advantage to converge to the normal distribution whenever the discrete parameter converges to a continuous one. Binomials are also distributions that are part of the exponential family. But we are facing various problems. To keep the discussion simple, let us first look at a single parameter that can take as values all the integer between [math] to
First of all, we face the issue of controlling the first two moments of our distribution or equivalent to be able to control the mean denoted by and the variance denoted by . Binomial distributions do not have two parameters like normals to be able to adapt to first and second moments constraints as easily as normals. Indeed for our given parameter that is the number of discrete state of our parameter to optimize in the discrete CMA ES, we are only left with a single parameter for our binomial distribution to accommodate for the constraints. The expectation is given by while the variance is given by . If we would like to have a discrete distribution that progressively peaks to the minimum, we would like to be able to force the variance to converge to [math]. This will fix the variance to . We can easily solve this quadratic equation and use the minimal solution given by
[TABLE]
provided that . As will tend to zero, the parameter will tend to zero. In order to accommodate for the mean constraint, we need a work-around. We see that the discrete parameter is we do not do anything will converge to [math] as will converge to [math]. A solution that is simple is to assume that our discrete parameter is distributed according to
[TABLE]
where is a modulo . It is the remainder of the Euclidean division of a by . This method will ensure that we sample all possible [math] to possible value with a mean that is equal to and a variance controlled by the parameter .
Secondly, we would like to use a discrete distribution that maximizes the entropy. This is the case for the continuous version of CMA-ES with the normal distribution. However, for discrete distribution, this maximum entropy condition is not as easy. It is well known that the maximum entropy discrete distribution with a given mean is not the binomial distribution but rather the distribution given by
[TABLE]
where and where is determined such as which leads to the implicit equation for :
[TABLE]
using the well known geometric identities: and . The distribution is sometimes referred to as the truncated geometric distribution. This is not our desirable binomial distribution. Obviously, we can rule out this truncated geometric distribution as its probability mass function does not make sense for our parameter. The probability mass function is decreasing which is not a desirable feature. Rather, we would like a bell shape, which is the case for our binomial distribution. The tricky question is how to relate our binomial distribution to a maximum entropy principle as this is the case for the normal.
We can first remark that the binomial distribution is not too far away from a geometric distribution when the number of trials tends to infinity at least for some terms. Indeed, the probability mass function is given by . And using the Sterling formula, we can see that for large, we can approximate factorial as follows , which leads an asymptotic term similar to the geometric distribution. This gives some hope that there should be a way to relate our binomial distribution to a maximum entropy principle. And the trick here is to reduce the space of possible distributions. It instead of looking at the entire space of distribution, we reduce the space of possible distributions to any Poisson binomial distributions (also referred to in the statistics literature as the generalized binomial distribution), we could find a solution. The latter distribution named after the famous French mathematician Siméon Denis Poisson is the discrete probability distribution of a sum of independent Bernoulli trials that are not necessarily identically distributed. And nicely, restricting the space of possible distribution to any Poisson binomial distributions, theorem 3 proves that the binomial distribution is the distribution that maximizes the entropy for a given mean.
Theorem 3**.**
Among all Poisson binomial distributions with trials, the distribution that maximizes the Shannon entropy : subject to the constraint and the obvious probability constraints is the binomial distribution such that
Proof.
See A.6 ∎
2.3 Multivariate and Correlated Binomials
Equipped with the intuition of the first section, we can see the profound connection between multivariate normal and multivariate binomial. We will define our multivariate binomial as the sum for independent trials of multivariate Bernoulli defined as before.
Let be a k-dimensional random vector of possibly correlated binomial random variables that may have different parameters and and let be a realization of . The joint probability is given naturally by
[TABLE]
Like for the simple case of section 2, we can re-write this joint probability in the exponential form. Let us give some notations.
Let be the vector of size whose elements represents all the possible to selection of . These to selections of are all the possible monomial polynomials of of degree to . By monomial, we mean that we can take only distinct power of with all of them having an exponent equal to 0 or 1. We also denote by an ordered set of elements of the integers from to and by the set of all the order sets with elements elements. is also the sets of all possible non empty sets with integer elements in . Similarly, is the sets of all possible non empty set with elements in . Finally, (respectively ) is the subset of for set whose cardinality is even (respectively odd).
We are now able to provide the following proposition that gives the exponential form of the multi variate binomial mass probability function:
Proposition 5** (Exponential form).**
The multivariate Bernoulli model has a probability mass function of the exponential form given by
[TABLE]
where the sufficient statistic is , the log partition function is and the coefficients are given by:
[TABLE]
Similarly, we can compute the regular probabilities from the canonical parameters as follows:
[TABLE]
where is the sum of all the theta parameters indexed by any non empty selection within :
[TABLE]
with the convention for the empty set, and is the normalizing constant such that all the probabilities sum to 1:
[TABLE]
with the convention for that .
Proof.
See A.7 ∎
Last but not least, we can extend the result already found for the simple two dimension Bernoulli variable to the general multi dimensional Bernoulli concerning independence and correlation. Recall that one of the important statistical properties for the multivariate Gaussian distribution is the equivalence of independence and no correlation. This is a remarkable properties of the Gaussian (although more could be said about independent and Gaussian as explained for instance in [6]).
The independence of a random vector is determined by the separability of coordinates in its probability mass function. If we use the natural (or moment) parameter form of the probability mass function, this is not obvious. However, using the exponential form, the result is almost trivial and is given by the following proposition
Proposition 6** ((Independence of Bernoulli outcomes)).**
The multivariate Bernoulli variable is independent element-wise if and only if
[TABLE]
Proof.
See A.8 ∎
Remark 2.2*.*
The condition of equivalence between independence and no correlation can also be rewritten as
[TABLE]
Remark 2.3*.*
A general multi variate binomial model implies parameters, which is way to many when is large. A simpler model is to impose that only the probabilities involving one state or two states are non zero. This is in fact the Ising model.
3 Algorithm
3.0.1 CMA-ES estimation
Another radically difference approach is to minimize some cost function depending on the Kalman filter parameters. As opposed to the maximum likelihood approach that tries to find the best suitable distribution that fits the data, this approach can somehow factor in some noise and directly target a cost function that is our final result. Because our model is an approximation of the reality, this noise introduction may leads to a better overall cost function but a worse distribution in terms of fit to the data.
Let us first introduce the CMA-ES algorithm. Its name stands for covariance matrix adaptation evolution strategy. As it points out, it is an evolution strategy optimization method, meaning that it is a derivative free method that can accomodate non convex optimization problem. The terminology covariance matrix alludes to the fact that the exploration of new points is based on a multinomial distribution whose covariance matrix is progressively determined at each iteration. Hence the covariance matrix adapts in a sense to the sampling space, contracts in dimension that are useless and expands in dimension where natural gradient is steep. This algorithm has led to a large number of papers and articles and we refer to [19], [17], [2], [1], [9], [4], [8], [3], [14], [5] to cite a few of the numerous articles around CMA-ES. We also refer the reader to the excellent wikipedia page [21].
In order to adapt CMA ES to discrete variables, we change in the algorithm the generation so Gaussian variables into the ones of multi variate binomials as follows:
[TABLE]
The corresponding algorithm is given in 1.
4 Conclusion
In this paper, we showed that using multi-variate correlated binomial distribution, we can derive an efficient adaptation of CMA-ES for discrete variable optimization problem using correlated binomials. We have proved that correlated binomials share some similarities with normal distribution in terms of independence and correlation equivalence as well as rich information for correlation structure. In order to avoid too many parameters, we impose that only single state and bi-state probabilities are not null. In the future, we hope to develop additional variations around this CMA-ES version for the combination of discrete and continuous variables mixing potentially multivariate binomial and normal distributions.
Appendix A Proofs
A.1 Proof of proposition 1
Proof.
We can trivially infer all the moment parameters from equations 2, 3 and 4. ∎
A.2 Proof of proposition 2
Proof.
The exponential family formulation of the bivariate Bernoulli distribution shows that a necessary and sufficient condition for the distribution to seperable into two components with each only depending on and respectively is that . This proves the first assertion of proposition 2.
Proving equivalence between correlation and independence is the same as proving equivalence between covariance and independence. The covariance between and is easy to calculate and given by
[TABLE]
where in equation 29, we have used that the four probabilities sum to one. Hence, the correlation or the covariance is null for non trivial probabilities if and only if , which is equivalent to the independence. ∎
A.3 Proof of proposition 3
Proof.
For the coordinate , it is trivial to see that
[TABLE]
which shows that follows the univariate Bernoulli distribution with density given by equation (11). Likewise, it is trivial to see that
[TABLE]
Similar results apply for the condition , which shows the second result and concludes the proof. ∎
A.4 Proof of proposition 4
Proof.
Let us write the limit for the binomial distribution when number of trials , and probability of success in trial but remains finite. We have for a given
[TABLE]
which proves that the binomial converges to the Poisson distribution. ∎
A.5 Proof of theorem 2
Proof.
We follow the proof of Theorem 11.1.1 of [7]. If we write the Lagrangian for the problem
[TABLE]
where the Lagrange multipliers are for the three constraints, we have
[TABLE]
and noticing that the function to optimize is convex and satisfies the Slater’s constraint, we can use Lagrange duality to characterize the solution as the solution of the critical point given by
[TABLE]
or equivalently,
[TABLE]
As this solution always satisfies the condition , we have necessarily that the Lagragian multiplier related to the constraint should be null: . The solution should be a probability distribution, which implies that
[TABLE]
which imposes that
[TABLE]
or equivalently, writing in the exponential form , we have that satisfies
[TABLE]
which shows that the distribution is part of the exponential family.
To prove its uniqueness, we use the fact that the Shannon entropy is related to the Kullback Leibler divergence as follows:
[TABLE]
which concludes the proof as the Kullback Leibler divergence unless ∎
A.6 Proof of theorem 3
Proof.
We will prove a stronger result that the entropy of a generalized binomial distribution with parameters is Schur concave (see [18] for a definition and some properties). A straight consequence of Schur concavity is that the function is maximum for the constant function as follows:
[TABLE]
with . This will prove that the regular binomial distribution satisfies the maximum entropy principle.
Our proof of the Schur concavity uses the same trick as in [13], namely the usage of elementary symmetric functions. Let us denote by the independent Bernoulli variables with parameter and their sum the variable for the canonical Poisson binomial variable. Its probability mass function writes as
[TABLE]
where is the set of all subsets of integers selected from . The entropy is permutation symmetric, hence to prove Schur concavity, it suffices to show that the cross term is negative. Let us compute
[TABLE]
We can notice that for and
[TABLE]
where . The equation (41) can be extended for or with the convention that for and for . Hence equation (41) is valid for any . Deriving equation (41) with respect to leads to
[TABLE]
Combining equations (40) and (42), we have
[TABLE]
Recall a result that is allegedly attributed to Newton about elementary symmetric functions. Denote the product
[TABLE]
with the kth elementary function of the a’s. We have
[TABLE]
unless all a are equal (see for instance [12] theorem 51 page 52 section 2.22). Let us take the function
[TABLE]
we have therefore that
[TABLE]
Combining equations (45) and (48), we proved that
[TABLE]
which concludes the proof ∎
A.7 Proof of proposition5
Proof.
Comparing the equations (2.3) and (17), and using the provided sufficient statistics given in proposition5, we see by identification that the parameters should be given by the equation (18) with the terms with a plus sign given by equation (19) and the terms with a negative sign given by equation (20)
Similarly, if we take equation (21), (22) and (23), we can notice that the probabilities given sum to one, that and that from the expression giving the theta’s (18), we back out the probabilities. This concludes the proof. ∎
A.8 Proof of proposition6
Proof.
The proof of proposition 6 is immediate using the exponential form as the independence is equivalent to the separability which is equivalent to equation (24) ∎
Appendix B Pseudo code
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Youhei Akimoto, Anne Auger, and Nikolaus Hansen. Continuous optimization and CMA-ES. In Genetic and Evolutionary Computation Conference, GECCO 2015, Madrid, Spain, July 11-15, 2015, Companion Material Proceedings , pages 313–344, 2015.
- 2[2] Youhei Akimoto, Anne Auger, and Nikolaus Hansen. CMA-ES and advanced adaptation mechanisms. In Genetic and Evolutionary Computation Conference, GECCO 2016, Denver, CO, USA, July 20-24, 2016, Companion Material Proceedings , pages 533–562, 2016.
- 3[3] Anne Auger and Nikolaus Hansen. Benchmarking the (1+1)-CMA-ES on the BBOB-2009 noisy testbed. In Genetic and Evolutionary Computation Conference, GECCO 2009, Proceedings, Montreal, Québec, Canada, July 8-12, 2009, Companion Material , pages 2467–2472, 2009.
- 4[4] Anne Auger and Nikolaus Hansen. Tutorial CMA-ES: evolution strategies and covariance matrix adaptation. In Genetic and Evolutionary Computation Conference, GECCO ’12, Philadelphia, PA, USA, July 7-11, 2012, Companion Material Proceedings , pages 827–848, 2012.
- 5[5] Anne Auger, Marc Schoenauer, and Nicolas Vanhaecke. LS-CMA-ES: A second-order algorithm for covariance matrix adaptation. In Parallel Problem Solving from Nature - PPSN VIII, 8th International Conference, Birmingham, UK, September 18-22, 2004, Proceedings , pages 182–191, 2004.
- 6[6] Eric Benhamou, Beatrice Guez, and Nicolas Paris. Three remarkable properties of the Normal distribution. ar Xiv e-prints , October 2018.
- 7[7] T. M. Cover and J. A. Thomas. Elements of Information Theory (Wiley Series in Telecommunications and Signal Processing) . Wiley-Interscience, New York, NY, USA, 2006.
- 8[8] Nikolaus Hansen and Anne Auger. CMA-ES: evolution strategies and covariance matrix adaptation. In 13th Annual Genetic and Evolutionary Computation Conference, GECCO 2011, Companion Material Proceedings, Dublin, Ireland, July 12-16, 2011 , pages 991–1010, 2011.
